Skip to content

zkrypto-inc/zkDNA

Repository files navigation

     _____ _    ____  _   _    _
    |__  /| | _|  _ \| \ | |  / \
      / / | |/ / | | |  \| | / _ \
     / /_ |   <| |_| | |\  |/ ___ \
    /____||_|\_\____/|_| \_/_/   \_\
  

Dual-Format Digital Identity with Zero-Knowledge Proofs

CI npm License


Key Features

  • ZKP Privacy -- Groth16 zk-SNARK proofs (prove age without revealing birth date)
  • Dual Format -- W3C Verifiable Credentials + ISO 18013-5 mDoc + SD-JWT
  • OID4VP 1.0 -- Standard OpenID for Verifiable Presentations protocol
  • AI Agent Identity -- DID issuance + delegation chains for autonomous AI agents
  • MCP Auth -- Authentication middleware for Model Context Protocol tool calls
  • Korean Mobile ID -- OpenDID (Raon Secure) compatible credential format
  • Native Apps -- iOS (Swift) + Android (Kotlin) reference implementations

Quick Start

npm install @zkdna/core @zkdna/agent-sdk
import { generateDIDKey, createCredential, signCredential,
         createPredicateProof, verifyPredicateProof } from '@zkdna/core';

// 1. Generate a DID
const issuer = generateDIDKey();
const holder = generateDIDKey();

// 2. Issue a credential
const vc = signCredential(createCredential({
  issuerDID: issuer.did, subjectDID: holder.did,
  claims: { name: 'Alice', birthDate: '1995-06-15' },
}), issuer);

// 3. Create a ZK age proof (prove age >= 19, hide actual birth date)
const proof = createPredicateProof({
  credential: vc, field: 'birthDate', predicate: 'gte_years', threshold: 19,
  holderKeyPair: holder,
});

// 4. Verify -- returns true/false, verifier never sees birth date
const valid = verifyPredicateProof(proof);

Architecture

                        zkDNA Stack

 Format Layer        Privacy Layer       Presentation       Agent Layer
 +-----------+      +-------------+     +------------+     +-------------+
 | W3C VC    |----->|             |---->|            |---->|  Agent SDK  |
 | ISO mDoc  |----->|  ZK Proofs  |---->|  OID4VP    |---->|  MCP Auth   |
 | SD-JWT    |----->|  (Groth16)  |---->|  QR Offline|---->|  LangChain  |
 +-----------+      +-------------+     +------------+     +-------------+
                          |
                    +-------------+
                    | Rust Circuits|
                    | (arkworks)  |
                    +-------------+

Packages

Package Description npm
@zkdna/core DID, Verifiable Credentials, ZKP primitives, mDoc, SD-JWT, OID4VP npm
@zkdna/agent-sdk AI Agent identity lifecycle and delegation chains npm
@zkdna/mcp-auth MCP protocol authentication middleware npm
@zkdna/mcp-server Production-ready MCP server with zkDNA auth npm
@zkdna/langchain LangChain tool wrapper with identity verification npm
@zkdna/credential-qr QR-based offline credential presentation npm
@zkdna/bridge WASM bridge for Groth16 circuits in browser/Node npm
@zkdna/platform-api Credential platform API with template-based issuance --
@zkdna/eudi-wallet EU EUDI Wallet verifier SDK --
@zkdna/verifier-sdk Verifier application SDK --
circuits/ Groth16 zk-SNARK circuits (Rust / arkworks) --
ios/ iOS reference app (Swift) --
android/ Android reference app (Kotlin) --

Use Cases

Convenience Store Age Verification (편의점 성인인증) Prove you are 19+ to buy alcohol without showing your ID card. The clerk scans a QR code; the ZK proof confirms age without revealing name, address, or birth date.

AI Agent Authorization Give each AI agent a DID with scoped capabilities. An agent can prove it has permission to call a tool without exposing the full delegation chain from the human principal.

EU EUDI Wallet Compatibility Issue and verify credentials that align with the European Digital Identity framework (Sept 2026 mandate), enhanced with zero-knowledge selective disclosure.

Development

# Install dependencies
npm install

# Run all TypeScript tests
npx vitest run

# Run Rust circuit tests
cd circuits && cargo test

# Run everything
scripts/test-all.sh

Prerequisites

  • Node.js >= 20
  • Rust stable (for circuits)

Contributing

See CONTRIBUTING.md for guidelines.

License

Apache-2.0

About

Dual-Format Digital Identity with Zero-Knowledge Proofs — W3C VC + ISO mDoc + SD-JWT + Groth16 ZKP

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors