Developer Documentationv2.0

StellarID Documentation

Integrate privacy-preserving identity verification in minutes. Full API reference, ZK circuit docs, and integration guides.

Quick Start

Get up and running with StellarID verification in 3 steps. The SDK handles proof validation, credential checking, and on-chain verification automatically.

Step 01

Install SDK

Add the StellarID verification SDK to your project

bash
npm install @stellarid/sdk
Step 02

Initialize Client

Set up the verification client with your API key

typescript
import { StellarID } from '@stellarid/sdk';

const stellarid = new StellarID({
  apiKey: 'your_api_key',
  network: 'testnet'
});
Step 03

Verify a Proof

Accept and verify a user's ZK proof in one call

typescript
const result = await stellarid.verify({
  proof: userProof,
  claim: 'age_over_18',
  credentialId: 'cred_abc123'
});

console.log(result.valid);    // true
console.log(result.dataExposed); // "none"

Core Concepts

Zero-Knowledge Proofs

Groth16 ZK-SNARKs via Circom. Proofs generated client-side — your data never leaves your device.

NFT Credentials

Non-transferable NFTs on Stellar containing cryptographic commitments (Poseidon hash), not raw data.

Selective Disclosure

Prove specific claims (age 18+, income bracket) without revealing underlying identity data.

Privacy by Design

Zero personal data stored. All credentials encrypted client-side. Blockchain stores only hashed commitments.

Architecture

StellarID uses a three-layer architecture separating client-side operations, API logic, and blockchain interactions.

Client Layer

  • Next.js 14 Frontend
  • Zustand State
  • snarkjs Proof Generation
  • Freighter Wallet

API Layer

  • Express.js REST API
  • JWT + API Key Auth
  • Rate Limiting
  • GitHub OAuth Issuer

Data Layer

  • PostgreSQL 15
  • Redis 7 Cache
  • Pinata IPFS
  • Stellar Blockchain
text
┌─────────────────────┐     ┌──────────────────┐     ┌─────────────────┐
│   Next.js Client    │────▶│   Express API    │────▶│  Stellar Chain  │
│  (ZK Proof Gen)     │     │  (Verify + Issue) │     │  (NFT + Revoke) │
└─────────────────────┘     └──────────────────┘     └─────────────────┘
         │                          │                         │
         ▼                          ▼                         ▼
   snarkjs + Circom           PostgreSQL + Redis        Soroban Contracts

API Reference

Base URL: https://api.stellarid.com/api/v1

MethodEndpointDescriptionAuth
POST/api/v1/auth/loginAuthenticate with Stellar walletPublic
POST/api/v1/credentials/requestRequest a new credentialJWT
GET/api/v1/credentialsList your credentialsJWT
POST/api/v1/verifyVerify a ZK proofPublic
GET/api/v1/issuersList trusted issuersPublic
POST/api/v1/platforms/registerRegister as verifier platformJWT
GET/api/v1/github-issuer/authStart GitHub OAuth flowPublic

Example: Verify a Proof

bash
curl -X POST https://api.stellarid.com/api/v1/verify \
  -H "Content-Type: application/json" \
  -H "X-API-Key: sk_live_abc123" \
  -d '{
    "proof": { "pi_a": [...], "pi_b": [...], "pi_c": [...] },
    "publicSignals": ["1"],
    "credentialId": "cred_abc123",
    "circuitType": "age_check"
  }'

Response

json
{
  "valid": true,
  "claim": "age_over_18",
  "dataExposed": "none",
  "verifiedAt": "2026-03-19T14:22:00Z",
  "txHash": "abc123...def456"
}

ZK Circuits

StellarID includes 4 pre-built Circom circuits. All circuits use Poseidon hashing and Groth16 proving.

age_check

Proves age ≥ threshold without revealing birthdate

Inputs: birthYear, currentYear, threshold

income_check

Proves income in range without revealing exact amount

Inputs: income, minIncome, maxIncome

residency_check

Proves residency in a country without revealing address

Inputs: countryCode, allowedCountries[]

membership_check

Proves group membership without revealing identity

Inputs: memberSecret, merkleProof, groupRoot

bash
# Compile a circuit
cd zk-circuits
circom age_check.circom --r1cs --wasm --sym -o build/

# Generate proving key
snarkjs groth16 setup build/age_check.r1cs pot12_final.ptau age_check_0000.zkey

# Export verification key
snarkjs zkey export verificationkey age_check_0000.zkey verification_key.json

Ready to integrate?

Start building with StellarID in under 5 minutes.