Skip to content

aethelred-foundation/zeroid

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

254 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
ZeroID

ZeroID

Self-sovereign identity. Zero-knowledge proofs. TEE-verified credentials.

CI Coverage Audit License

TypeScript Solidity Circom Rust snarkjs

App Β· Docs Β· API Reference Β· Discord


Overview

ZeroID is a full-stack self-sovereign identity platform built on Aethelred β€” a sovereign Layer 1 optimised for verifiable AI computation. Users can create decentralised identities, issue and verify credentials using zero-knowledge proofs, bridge identities across chains, and manage regulatory compliance β€” all without revealing private data.

The platform combines 12 on-chain smart contracts, 9 ZK circuits (Circom), a TEE attestation layer, AI-powered compliance services, and multi-language SDKs (Go, Python) into a single cohesive identity stack.

Status β€” Pre-mainnet. 20+ pages, 12 contracts, and 9 ZK circuits under active development.


Table of Contents


Features

Self-Sovereign Identity

  • DID creation and resolution (W3C-compliant)
  • Verifiable credential issuance and management
  • Selective disclosure with BBS+ signatures
  • Cross-chain identity bridge (EVM, Cosmos)

Zero-Knowledge Proofs

  • Age verification without revealing date of birth
  • Residency and nationality proof circuits
  • Credit tier scoring with privacy preservation
  • BBS+ selective disclosure and threshold credentials

AI-Powered Compliance

  • AI agent identity registry and verification
  • Behavioral biometrics for fraud detection
  • Real-time risk scoring engine
  • Compliance copilot for regulatory guidance

Enterprise & Government

  • Multi-jurisdiction regulatory compliance
  • OFAC and global sanctions screening
  • Jurisdiction-aware policy engine
  • Data sovereignty with geographic constraints

Architecture

graph TB
    subgraph Frontend
        A[Next.js 14 / React 18<br/>Tailwind CSS / RainbowKit / wagmi]
    end

    subgraph API Gateway
        B[Express / TypeScript<br/>Prisma ORM / JWT Auth]
    end

    subgraph ZK Circuit Layer
        C[Circom 2.1 / snarkjs<br/>9 proof circuits]
    end

    subgraph Smart Contracts
        D[Solidity 0.8.20<br/>Foundry + Hardhat<br/>12 contracts]
    end

    subgraph AI / ML Services
        E[Agent Identity / Fraud Detection<br/>Risk Scoring / Compliance Copilot<br/>Behavioral Biometrics]
    end

    subgraph Rust SDK
        F[TEE Attestation<br/>Go + Python Bindings]
    end

    A <-->|REST + WS| B
    B <-->|snarkjs| C
    B <-->|ethers.js| D
    B --- E
    B --- F
    C --- D
Loading

Tech Stack

Layer Technology
Frontend Next.js 14, React 18, Tailwind CSS, RainbowKit, wagmi/viem
Backend Express, TypeScript 5.3, Prisma ORM
Smart Contracts Solidity 0.8.20, Foundry + Hardhat dual build
ZK Circuits Circom 2.1, snarkjs, Groth16
Native Rust (TEE attestation crate)
SDKs Go, Python
AI/ML Agent identity, fraud detection, risk scoring

Quick Start

Prerequisites

Tool Version
Node.js >= 20.0.0
Rust >= 1.75.0
Circom >= 2.1.0
Docker + Compose latest
PostgreSQL >= 16
Foundry latest

Installation

# Clone
git clone https://github.com/aethelred-foundation/zeroid.git
cd zeroid

# Install dependencies
npm ci

# Install backend dependencies
cd backend && npm ci && cd ..

# Configure
cp .env.example .env
# Edit .env with your configuration

# Compile ZK circuits
cd circuits && ./build.sh && cd ..

# Compile smart contracts (Foundry)
forge build

# Run database migrations
cd backend && npx prisma migrate dev && cd ..

# Start development servers
npm run dev           # Frontend  β€” http://localhost:3000
npm run dev:api       # API       β€” http://localhost:3001
Environment variables
# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/zeroid

# Blockchain
RPC_URL=http://localhost:8545
CHAIN_ID=31337

# ZK Proofs
CIRCUITS_PATH=./circuits
PROVING_KEY_PATH=./circuits/keys

# TEE
TEE_ATTESTATION_ENDPOINT=http://localhost:8443

# Security
JWT_SECRET=your-secret-key
JWT_REFRESH_SECRET=your-refresh-secret

# AI Services
AI_RISK_SCORING_URL=http://localhost:5000
AI_FRAUD_DETECTION_URL=http://localhost:5001

# External Services
SENTRY_DSN=your-sentry-dsn

Project Structure

zeroid/
β”œβ”€β”€ src/                            # Next.js 14 frontend (App Router)
β”‚   β”œβ”€β”€ app/                        # Routes β€” identity, credentials, verification,
β”‚   β”‚   β”‚                           #   governance, admin, agent-identity, ai-compliance,
β”‚   β”‚   β”‚                           #   analytics, audit, cross-chain, enterprise,
β”‚   β”‚   β”‚                           #   integrations, marketplace, regulatory, revocation,
β”‚   β”‚   β”‚                           #   settings
β”‚   β”‚   └── api/                    # Next.js API routes
β”‚   β”œβ”€β”€ components/                 # React components (identity, zkp, tee, ai, ...)
β”‚   β”œβ”€β”€ contexts/                   # Global state providers
β”‚   β”œβ”€β”€ hooks/                      # Custom React hooks
β”‚   β”œβ”€β”€ lib/                        # Utilities (zk, tee, ai, crypto, regulatory)
β”‚   β”œβ”€β”€ config/                     # App configuration
β”‚   β”œβ”€β”€ styles/                     # Tailwind CSS styles
β”‚   β”œβ”€β”€ types/                      # TypeScript type definitions
β”‚   └── __tests__/                  # Frontend test suites
β”‚
β”œβ”€β”€ backend/
β”‚   β”œβ”€β”€ src/
β”‚   β”‚   β”œβ”€β”€ routes/                 # Express API routes
β”‚   β”‚   β”œβ”€β”€ services/               # Core services
β”‚   β”‚   β”‚   β”œβ”€β”€ ai/                 # Agent identity, behavioral biometrics,
β”‚   β”‚   β”‚   β”‚                       #   compliance copilot, fraud detection, risk scoring
β”‚   β”‚   β”‚   β”œβ”€β”€ compliance/         # Data sovereignty, jurisdiction engine,
β”‚   β”‚   β”‚   β”‚                       #   regulatory reporting, sanctions screening
β”‚   β”‚   β”‚   └── enterprise/         # API gateway, OIDC bridge, SLA monitor, webhooks
β”‚   β”‚   β”œβ”€β”€ middleware/             # Auth, rate limiting, validation
β”‚   β”‚   β”œβ”€β”€ workers/                # Background job processors
β”‚   β”‚   └── lib/                    # Shared utilities
β”‚   β”œβ”€β”€ prisma/                     # Database schema and migrations
β”‚   └── test/                       # API integration tests
β”‚
β”œβ”€β”€ contracts/                      # Solidity smart contracts
β”‚   β”œβ”€β”€ ZeroID.sol                  # Core identity contract
β”‚   β”œβ”€β”€ ZKCredentialVerifier.sol    # ZK proof on-chain verification
β”‚   β”œβ”€β”€ CredentialRegistry.sol      # Verifiable credential registry
β”‚   β”œβ”€β”€ BBSPlusCredential.sol       # BBS+ signature credentials
β”‚   β”œβ”€β”€ SelectiveDisclosure.sol     # Selective disclosure proofs
β”‚   β”œβ”€β”€ ThresholdCredential.sol     # Threshold signature credentials
β”‚   β”œβ”€β”€ AccumulatorRevocation.sol   # Cryptographic accumulator revocation
β”‚   β”œβ”€β”€ CrossChainIdentityBridge.sol# Cross-chain identity bridging
β”‚   β”œβ”€β”€ AIAgentRegistry.sol         # AI agent identity registry
β”‚   β”œβ”€β”€ TEEAttestationRegistry.sol  # TEE attestation verification
β”‚   β”œβ”€β”€ GovernanceModule.sol        # Identity governance
β”‚   β”œβ”€β”€ RegulatoryCompliance.sol    # On-chain compliance checks
β”‚   β”œβ”€β”€ bridges/                    # Bridge adapters
β”‚   β”œβ”€β”€ interfaces/                 # Contract interfaces
β”‚   β”œβ”€β”€ libraries/                  # Shared libraries (BN254)
β”‚   └── verifiers/                  # ZK proof verifier contracts
β”‚
β”œβ”€β”€ circuits/                       # Circom 2.1 ZK circuits
β”‚   β”œβ”€β”€ age/                        # Age verification proof
β”‚   β”œβ”€β”€ residency/                  # Residency proof
β”‚   β”œβ”€β”€ credit/                     # Credit tier proof
β”‚   β”œβ”€β”€ nationality/                # Nationality proof
β”‚   β”œβ”€β”€ biometric/                  # Biometric match proof
β”‚   β”œβ”€β”€ accumulator/                # Non-revocation proof
β”‚   β”œβ”€β”€ bbs/                        # BBS+ selective disclosure
β”‚   β”œβ”€β”€ composite/                  # Composite proof aggregation
β”‚   └── threshold/                  # Threshold signature verification
β”‚
β”œβ”€β”€ sdk/                            # Multi-language SDKs
β”‚   β”œβ”€β”€ go/                         # Go SDK (DID, credential, crypto, compliance, TEE)
β”‚   └── python/                     # Python SDK (DID, credential, crypto, compliance, TEE)
β”‚
β”œβ”€β”€ crates/
β”‚   └── zeroid-tee/                 # Rust TEE attestation crate
β”‚
β”œβ”€β”€ test/                           # End-to-end and integration tests
β”œβ”€β”€ docs/                           # Architecture and security documentation
β”œβ”€β”€ .github/workflows/              # CI/CD pipeline
└── .env.example                    # Environment template

Testing

# Frontend β€” unit and component tests
npm test
npm run test:coverage
npm run test:watch

# Backend β€” API tests
cd backend && npm test && cd ..

# Smart contracts β€” Foundry
forge test -vvv
forge coverage

# Smart contracts β€” Hardhat
npx hardhat test

# ZK circuits
cd circuits && npm test && cd ..

# SDK β€” Go
cd sdk/go && go test ./... && cd ../..

# SDK β€” Python
cd sdk/python && pytest && cd ../..

# E2E tests (Playwright)
npx playwright install
npm run test:e2e

Security

ZK circuit layer: Groth16 proofs with trusted setup, circuit constraint validation, proof non-malleability checks, input range verification, nullifier uniqueness enforcement.

Smart contract layer: Reentrancy guard (checks-effects-interactions), checked arithmetic, role-based access control, emergency pause mechanism, accumulator-based revocation, TEE attestation verification.

Application layer: JWT + refresh-token auth, RBAC, Zod input validation, per-endpoint rate limiting, CORS, Helmet security headers, parameterised queries (Prisma), XSS sanitisation.

AI/ML layer: Behavioral biometrics anomaly detection, real-time fraud scoring, sanctions screening with OFAC integration, jurisdiction-aware policy enforcement.


Performance

Metric Target Current
First Contentful Paint < 1.5 s 1.1 s
Largest Contentful Paint < 2.5 s 1.9 s
Time to Interactive < 3.5 s 2.4 s
API Response Time (p95) < 200 ms 130 ms
ZK Proof Generation (age) < 3 s 1.8 s
ZK Proof Verification (on-chain) < 250 k gas 210 k gas
DID Resolution < 100 ms 45 ms

Optimisations: code splitting, Next.js image optimisation, snarkjs WASM prover, proof caching, CDN edge delivery, Gzip/Brotli compression, database indexing.


Development

npm run lint && npm run lint:fix    # ESLint
npm run format                      # Prettier
npm run type-check                  # TypeScript strict mode
npm run validate                    # All checks
forge fmt                           # Solidity formatting

Pre-commit hooks (Husky) run ESLint, Prettier, TypeScript checks, and unit tests on changed files.

CI/CD Pipeline

On every PR: security audit, lint + format, unit tests (frontend, backend, contracts, circuits), integration tests, E2E tests, build verification.

On merge to main: Docker build, push to registry, deploy to staging, smoke tests, ZK circuit trusted setup verification, deploy to production.


API Reference

REST

# Identity
POST /v1/identity/create            # Create a new DID
GET  /v1/identity/:did               # Resolve a DID document
PUT  /v1/identity/:did/rotate-keys   # Rotate DID keys

# Credentials
POST /v1/credentials/issue           # Issue a verifiable credential
POST /v1/credentials/verify          # Verify a credential proof
GET  /v1/credentials/:id             # Retrieve credential by ID
POST /v1/credentials/revoke          # Revoke a credential

# ZK Proofs
POST /v1/proofs/generate             # Generate a ZK proof
POST /v1/proofs/verify               # Verify a ZK proof off-chain

# Compliance
POST /v1/compliance/screen           # Run sanctions screening
GET  /v1/compliance/jurisdiction/:code # Get jurisdiction rules

WebSocket

const ws = new WebSocket("wss://api.aethelred.io/zeroid/ws");

ws.send(
  JSON.stringify({
    method: "subscribe",
    channel: "credentials",
    filter: { issuer: "did:aethelred:..." },
  }),
);
ws.send(JSON.stringify({ method: "subscribe", channel: "revocations" }));

Full reference: api.aethelred.io/zeroid/docs


Contributing

We welcome contributions. Please see the Contributing Guide before opening a PR.

Standard Requirement
Commits Conventional Commits
Solidity Foundry forge fmt + NatSpec documentation
Circom Circuit constraint documentation + test vectors
TypeScript ESLint + Prettier + strict mode
Tests All new features must include unit + integration tests
  1. Fork the repository
  2. Create a feature branch β€” git checkout -b feature/my-feature
  3. Run npm run validate && forge test
  4. Commit with Conventional Commits
  5. Open a Pull Request

License

Apache 2.0 β€” see LICENSE for details.


Acknowledgments

Circom Β· snarkjs Β· Foundry Β· Next.js Β· Tailwind CSS Β· RainbowKit Β· Prisma


App Β· Docs Β· Discord Β· Twitter Β· Support

Copyright Β© 2024–2026 Aethelred Foundation

Releases

No releases published

Packages

 
 
 

Contributors