Skip to content

obscra/sdk

Repository files navigation

@obscra/sdk

Official TypeScript SDK for Obscra — the privacy-preserving marketplace for sensitive data, built on Solana.

npm CI License: MIT TypeScript

Obscra lets people buy and sell sensitive data without exposing the raw payload. The SDK is a thin, type-safe layer over the building blocks that make that possible:

  • Solana — fast, cheap settlement
  • x402 — HTTP-native micropayments (pay-per-request)
  • IPFS — content-addressed encrypted storage
  • zk-proofs — verifiable claims about data without revealing it

Status: early development. APIs will change before v1.0.0. Pin exact versions.

Install

npm install @obscra/sdk
# peer dependency
npm install @solana/web3.js

Quick start

import { createObscraClient } from '@obscra/sdk';

const obscra = createObscraClient({ cluster: 'devnet' });

const listings = await obscra.marketplace.getListings({
  category: 'health',
  limit: 20,
});

Modules

Module What it does
marketplace List, browse, and purchase datasets
x402 HTTP 402 payment flow (fetch with automatic settle)
ipfs Resolve and fetch encrypted blobs from IPFS gateways
zk Pluggable verifiers for zero-knowledge proofs

Example: HTTP 402 paid fetch

import { createObscraClient } from '@obscra/sdk';

const obscra = createObscraClient({ cluster: 'devnet' });

const res = await obscra.x402.fetchWithPayment('https://api.obscra.xyz/datasets/123', {
  onPaymentRequired: async (requirement) => {
    // Sign and return an X-PAYMENT header for the requirement.
    return await mySolanaWallet.signX402(requirement);
  },
});

const data = await res.json();

Example: register a zk verifier

import { createObscraClient } from '@obscra/sdk';

const obscra = createObscraClient();

obscra.zk.registerVerifier('groth16', {
  async verify(proof, vk) {
    // Plug in snarkjs, arkworks-wasm, etc.
    return await myGroth16Verify(proof, vk);
  },
});

Roadmap

See ROADMAP.md. Daily progress is tracked there.

Contributing

Issues and PRs welcome — please open a discussion first for non-trivial changes.

License

MIT © Obscra

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors