Skip to content

solidusnetwork/sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Solidus Network

Solidus SDK

License

TypeScript packages for building on the Solidus Network — a blockchain protocol for decentralized identity and verifiable credentials.

Published packages

Published to npm under the @solidus-network scope. Versions in the badges are live from the registry — this page does not restate them, because a number typed into prose goes stale the day after you type it.

Core

Package npm Description
@solidus-network/sdk npm Main SDK — DID resolution + rotation, credential issuance/verification, SD-JWT VC (incl. KB-JWT, status list, nested-path disclosure), on-chain queries
@solidus-network/auth npm DID-based authentication primitives — Ed25519 challenge, W3C VP verification
@solidus-network/types npm Shared TypeScript types — DIDs, Verifiable Credentials (Data Model 2.0), auth challenges
@solidus-network/bbs npm BBS+ selective-disclosure primitives — draft-irtf-cfrg-bbs-signatures, BLS12-381 SHA-256, byte-compatible with the on-chain implementation

Agent identity

Portable identity for AI agents. Built on the core above; you do not need these to issue or verify human credentials. Source lives in the Solidus monorepo, not this repo.

Package npm Description
@solidus-network/agent-identity npm did:solidus DIDs, BBS+ selective-disclosure credentials, and ERC-8004 passport anchoring for AI agents
@solidus-network/agent-identity-verify npm Hot-path verifier — offline BBS+ proof verification plus a cached, fail-closed OAuth Status List revocation check
@solidus-network/agent-identity-react npm React components — the Verified-by-Solidus badge, agent passport card, mandate-approval prompt

ID capture

Browser-side document capture, used by Solidus Verify. Source lives in the monorepo, not this repo.

Package npm Description
@solidus-network/capture npm Embeddable web ID-capture SDK — guided camera capture with quality gating and on-device MRZ/barcode extraction
@solidus-network/id-extract npm Client-side (WASM) extraction — barcode read, MRZ OCR, checksum reconstruction, confidence gate. Framework-free

Install

npm install \
  @solidus-network/sdk \
  @solidus-network/auth \
  @solidus-network/types \
  @solidus-network/bbs

Quick start

import { createSdk } from '@solidus-network/sdk'

const solidus = createSdk({
  mode: 'testnet',
  chain: {
    rpcUrl: 'https://rpc.solidus.network',
    network: 'testnet',
    signerPrivateKey: process.env.SOLIDUS_SIGNER_KEY!,
  },
})

// Resolve a DID — returns the W3C resolution metadata shape
const { didDocument, didDocumentMetadata } =
  await solidus.did.resolveWithMetadata('did:solidus:testnet:abc123')

// Issue a W3C VC 2.0 credential (as an authorised issuer)
const vc = await solidus.credentials.issue({
  subject: 'did:solidus:testnet:xyz789',
  type: ['VerifiableCredential', 'KYCVerified'],
  claims: { country: 'US', tier: 'standard' },
  validFrom: new Date().toISOString(),
})

SD-JWT VC (EUDI Wallet-aligned)

import { issueSdJwtVc, verifySdJwtVc, presentSdJwtVc } from '@solidus-network/sdk'

const sdJwt = await issueSdJwtVc({
  issuerPrivateKey,
  issuerDid: 'did:solidus:testnet:issuer1',
  vct: 'https://example.com/credentials/age',
  claims: { given_name: 'Ada', birth_date: '1990-01-01' },
  disclosable: ['birth_date'],
  holderJwk,
})

// Holder presents only the necessary claim, key-binding included
const presentation = await presentSdJwtVc({
  sdJwt, claimsToReveal: ['birth_date'],
  audience: 'https://verifier.example', nonce: 'abc',
  holderPrivateKey,
})

const result = await verifySdJwtVc({
  sdJwt: presentation,
  expectedAudience: 'https://verifier.example',
  expectedNonce: 'abc',
  issuerResolver: createChainBackedIssuerResolverFromRpc(),
})

BBS+ selective disclosure

import { signBbs, deriveProofBbs, verifyProofBbs } from '@solidus-network/bbs'

const signed = await signBbs({
  issuerSecretKey,
  messages: ['name=Ada', 'over18=true', 'birth_date=1990-01-01'],
})

// Holder discloses only "over18=true" — birth_date stays hidden
const proof = await deriveProofBbs({
  signature: signed,
  messages: signed.messages,
  reveal: [1], // index of "over18=true"
  nonce: 'verifier-nonce',
})

const ok = await verifyProofBbs({
  proof,
  revealedMessages: { 1: 'over18=true' },
  issuerPublicKey,
})

DID-based authentication

import { createChallenge, verifyPresentation } from '@solidus-network/auth'

const challenge = createChallenge('did:solidus:testnet:abc123', 300)
// Client signs the challenge nonce and returns a Verifiable Presentation
const result = await verifyPresentation({ presentation, challenge, getPublicKey })

Modes

  • stub — local Postgres-backed mock for development; no chain interaction.
  • testnet — talks to the Solidus testnet via JSON-RPC at rpc.solidus.network.
  • mainnet — reserved for the post-audit launch.

Documentation

Network

License

Apache-2.0 — see LICENSE (each published package ships its own copy).

About

Solidus SDK — TypeScript packages for decentralized identity (@solidus/auth, @solidus/sdk, @solidus/jwt)

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors