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.
Install SDK
Add the StellarID verification SDK to your project
npm install @stellarid/sdkInitialize Client
Set up the verification client with your API key
import { StellarID } from '@stellarid/sdk';
const stellarid = new StellarID({
apiKey: 'your_api_key',
network: 'testnet'
});Verify a Proof
Accept and verify a user's ZK proof in one call
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
┌─────────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Next.js Client │────▶│ Express API │────▶│ Stellar Chain │
│ (ZK Proof Gen) │ │ (Verify + Issue) │ │ (NFT + Revoke) │
└─────────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
snarkjs + Circom PostgreSQL + Redis Soroban ContractsAPI Reference
Base URL: https://api.stellarid.com/api/v1
| Method | Endpoint | Description | Auth |
|---|---|---|---|
| POST | /api/v1/auth/login | Authenticate with Stellar wallet | Public |
| POST | /api/v1/credentials/request | Request a new credential | JWT |
| GET | /api/v1/credentials | List your credentials | JWT |
| POST | /api/v1/verify | Verify a ZK proof | Public |
| GET | /api/v1/issuers | List trusted issuers | Public |
| POST | /api/v1/platforms/register | Register as verifier platform | JWT |
| GET | /api/v1/github-issuer/auth | Start GitHub OAuth flow | Public |
Example: Verify a Proof
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
{
"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_checkProves age ≥ threshold without revealing birthdate
Inputs: birthYear, currentYear, threshold
income_checkProves income in range without revealing exact amount
Inputs: income, minIncome, maxIncome
residency_checkProves residency in a country without revealing address
Inputs: countryCode, allowedCountries[]
membership_checkProves group membership without revealing identity
Inputs: memberSecret, merkleProof, groupRoot
# 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