Threat Model

Date: 2026-02-09 Version: 1.0.0 Status: Production


1. System Overview

zk-id is a zero-knowledge proof system for selective disclosure of identity credentials. The system operates across three roles:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”           β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Issuer  │──(sign)──>β”‚ Holder  │──(prove)─>β”‚ Verifier β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜           β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Issuer β†’ Issues signed credentials containing birth year, nationality, and a random salt bound by Poseidon hash commitment.

Holder β†’ Stores credentials locally, generates zero-knowledge proofs using Groth16 SNARKs to prove properties (e.g., age β‰₯ 18) without revealing the underlying data.

Verifier β†’ Validates proofs cryptographically, enforces server-side policies, and maintains replay/revocation protection.


2. Trust Assumptions

The security of zk-id depends on the following trust assumptions:

2.1 Cryptographic Assumptions

  • Circuit correctness: The circom circuits (age-verify, nationality-verify, etc.) correctly encode the intended constraints. Malformed circuits could allow proof forgery.
  • Trusted setup integrity: The Groth16 Powers of Tau ceremony (Hermez, 177 participants) generated proving/verification keys without toxic waste retention. Compromised setup keys enable arbitrary proof generation.
  • Poseidon collision resistance: The Poseidon hash (BN128, t=3/4) is collision-resistant. Collisions would allow credential forgery.
  • EdDSA signature security: BabyJubJub EdDSA (in-circuit) and Ed25519 (off-chain) are unforgeable under chosen-message attacks.
  • BN128 discrete log hardness: The elliptic curve discrete logarithm problem on BN128 is computationally infeasible (~128-bit security).

2.2 System Assumptions

  • Issuer key security: Issuer private keys are stored securely (HSM recommended). Compromised keys allow arbitrary credential issuance.
  • Verification key distribution: Verification keys (.zkey) are distributed through trusted channels. Tampered keys could validate invalid proofs.
  • CSPRNG quality: crypto.randomBytes() (Node.js) provides cryptographically secure randomness for salts, nonces, and keys on all platforms (Linux: /dev/urandom, macOS: arc4random_buf, Windows: BCryptGenRandom).
  • Circuit artifact integrity: SHA-256 hashes in docs/circuit-hashes.json match deployed artifacts. Hash mismatches indicate tampering or build drift.

2.3 Operational Assumptions

  • Holder environment: Proofs are generated in a trusted client environment. Malware on the prover’s device could exfiltrate credentials.
  • Server time synchronization: Verifiers maintain accurate clocks. Large clock skew enables time-shifted proof attacks (mitigated by maxFutureSkewMs).
  • Audit log integrity: Audit logs are tamper-evident or write-only (e.g., append-only S3, Elasticsearch with WORM). Log deletion could hide attacks.

3. Threat Actors

ActorMotivationCapabilities
Malicious ProverBypass age/nationality restrictions, impersonate others, reuse proofsLocal circuit execution, network MitM, credential replay
Malicious VerifierHarvest user data, correlate sessions, de-anonymize usersLog analysis, timing attacks, traffic analysis
Compromised IssuerMass credential forgery, backdoor issuanceGenerate valid signatures for arbitrary credentials
Network AttackerIntercept/replay proofs, DoS verification serversPacket sniffing, replay attacks, rate limiting bypass
Colluding PartiesCross-issuer correlation, de-anonymize usersShare commitment hashes, nullifiers, or metadata

4. Attack Surface

4.1 Malicious Prover Attacks

Attack VectorImpactMitigationResidual Risk
Proof forgeryProver claims age β‰₯ 18 when age < 18Groth16 soundness + circuit constraints enforce age comparisonCircuit bugs (under-constrained signals) could allow bypass
Credential self-issuanceProver generates credential without trusted issuerVerifier checks issuer signature (validateSignedCredentialBinding)Requires compromised issuer key (out of scope)
Replay attackReuse proof from one verifier at anotherNonce binding (proof.publicSignals.nonce) + NonceStore marks nonces as usedNonce store must be persistent (Redis/DB); in-memory stores leak on restart
Time-shifted proofsGenerate proof with future timestamp to bypass expiryServer validates requestTimestamp against maxFutureSkewMs (default 60s)Clock skew <60s is tolerated; tighter bounds require NTP sync
Revocation bypassUse revoked credentialMerkle inclusion proof (revocable circuits) or commitment-based revocation checkRevocation root staleness (maxRevocationRootAgeMs) must be configured

4.2 Malicious Verifier Attacks

Attack VectorImpactMitigationResidual Risk
Metadata leakageInfer user attributes from timing, frequency, issuerNone (intentional tradeoff for usability)Verifier learns: issuer identity, claim type, timestamp, proof frequency
Session correlationLink multiple proofs from same userNullifiers (computeNullifier(commitment, scope)) create pseudonymous IDs per scopeVerifier can correlate within scope; cross-scope correlation requires colluding verifiers
Traffic analysisInfer user location/behavior from network metadataClient-side Tor/VPN (out of scope)IP addresses, request timing visible to verifier

4.3 Compromised Issuer Attacks

Attack VectorImpactMitigationResidual Risk
Mass forgeryIssue credentials for non-existent identitiesIssuerRegistry status checks (active, revoked, suspended)Requires real-time issuer status monitoring; InMemoryIssuerRegistry has no external sync
Backdated credentialsIssue credentials with past issuedAt datesVerifier can check signedCredential.issuedAt against issuer’s validFromNot currently enforced; requires policy configuration

4.4 Network Attacker Attacks

Attack VectorImpactMitigationResidual Risk
Replay via proxyReuse intercepted proof at different verifierNonce uniqueness + NonceStoreNonce store must be shared across verifiers (Redis)
DoS via floodOverwhelm verifier with proof requestsRate limiting (SimpleRateLimiter or external gateway)SimpleRateLimiter is IP-based (trivially bypassable); use authenticated rate limits in production
Proof tamperingModify proof in transitTLS encryption (deployment requirement)Assumes TLS termination at reverse proxy

4.5 Colluding Parties

Attack VectorImpactMitigationResidual Risk
Commitment linkageShare credential commitments across issuersUse separate commitments per issuer (requires holder privacy practices)Commitments are deterministic; same credential yields same hash
Nullifier linkageShare nullifiers across verifiersNullifier scopes (scopeHash) isolate per-verifier pseudonymsScope separation depends on verifier cooperation

5. Cryptographic Assumptions

PrimitiveAssumptionSecurity LevelFailure Impact
Groth16Knowledge soundness (BN128 discrete log)~128-bitForged proofs without valid witness
PoseidonCollision resistance (t=3: RF=8/RP=57, t=4: RF=8/RP=56)~128-bitCredential forgery via hash collision
EdDSA (BabyJub)Signature unforgeability (Baby Jubjub curve)~128-bitIn-circuit signature forgery
Ed25519Signature unforgeability (Curve25519)~128-bitOff-chain credential forgery
SHA-256Preimage resistance (circuit artifact hashing)256-bitBuild artifact tampering undetected

6. Metadata Leakage

6.1 What a Verifier Learns

Even with zero-knowledge proofs, verifiers inevitably learn:

MetadataLeakagePrivacy Impact
Issuer identitysignedCredential.issuer field is plaintextVerifier knows which government/org issued the credential
Claim typeclaimType: 'age' / 'nationality' / 'age-revocable'Verifier knows what property was proven
TimestamprequestTimestamp (ISO 8601)Verifier knows when proof was generated
FrequencyNumber of proofs per sessionVerifier can infer usage patterns
Network metadataIP address, TLS fingerprint, User-AgentStandard web privacy concerns (use Tor/VPN if needed)

6.2 Pseudonymity via Nullifiers

  • Nullifiers (Poseidon(commitment, scopeHash)) create per-scope pseudonyms.
  • Example: Alice proves age β‰₯18 at example.com twice β†’ same nullifier both times.
  • Cross-site tracking requires colluding verifiers sharing nullifiers (not prevented).

7. Known Limitations

LimitationImpactWorkaround / Future Work
3-field commitment bindingCredential schema locked to (birthYear, nationality, salt)Requires new circuits for schema changes; documented in Credential interface JSDoc
Merkle tree depth cap (1024)Valid credential set limited to 2^10 = 1024 entriesUse sparse Merkle trees (16-32 depth) for larger sets; scale horizontally with sharding
IP-based rate limitingSimpleRateLimiter bypassable via proxiesUse token bucket with authenticated sessions or API gateway rate limiting
In-memory stores leak on restartInMemoryNonceStore, InMemoryChallengeStore lose stateUse Redis or DB-backed stores in production
No cross-issuer revocationRevocation list is issuer-specificFederated revocation lists (future roadmap)
Timestamp freshness depends on clock syncLarge clock skew enables time-shifted proofsConfigure maxFutureSkewMs tightly; use NTP sync on servers

8. Mitigations Summary

ThreatControlImplementedConfiguration Required
Proof forgeryCircuit soundness + Groth16βœ… YesReview circuit constraints before trusted setup
Credential forgeryIssuer signature validationβœ… YesDistribute issuer public keys securely
Replay attacksNonce uniqueness + NonceStoreβœ… YesUse persistent nonce store (Redis)
Time-shifted proofsTimestamp validation (maxFutureSkewMs)βœ… YesSet maxFutureSkewMs ≀ 60000ms
Revocation bypassMerkle inclusion proof / commitment checkβœ… YesConfigure maxRevocationRootAgeMs
Rate limit bypassRateLimiter interface⚠️ Demo onlyUse authenticated rate limiter in production
Information leakageError sanitization (sanitizeError)βœ… Yes (v1.0)Set verboseErrors: false (default)
Metadata correlationNullifier scopesβœ… YesVerifiers must use unique scopeHash values
Circuit tamperingSHA-256 hash verificationβœ… YesRun npm run verify-circuits in CI
Key rotation gapsGrace period (rotationGracePeriodMs)βœ… Yes (v1.0)Set rotationGracePeriodMs on IssuerRecord

9. Recommendations for Deployment

9.1 Mandatory Security Controls

  1. Use TLS 1.3+ for all API endpoints (reverse proxy termination recommended).
  2. Persistent nonce store (Redis with TTL) to prevent replay across restarts.
  3. Authenticated rate limiting (token bucket per session ID, not IP).
  4. Set verboseErrors: false to prevent information leakage to attackers.
  5. Configure maxRequestAgeMs (e.g., 5 minutes) to reject stale proofs.
  6. Enable audit logging with tamper-evident storage (write-only S3, Elasticsearch WORM).
  1. HSM/KMS for issuer keys (AWS KMS, Azure Key Vault, HashiCorp Vault).
  2. Strict protocol version enforcement (protocolVersionPolicy: 'strict').
  3. Revocation root staleness checks (maxRevocationRootAgeMs: 300000 = 5 minutes).
  4. NTP clock synchronization for accurate timestamp validation.
  5. Circuit artifact verification (npm run verify-circuits) in CI/CD pipeline.

10. Out of Scope

The following are explicitly not addressed by this system and require external controls:

  • Secure key management (HSM/KMS integration)
  • Full anonymity network protections (Tor, VPN, traffic obfuscation)
  • Side-channel resistance in client environments (timing attacks, memory scraping)
  • Data retention and GDPR compliance (log lifecycle policies)
  • Physical security of issuer infrastructure
  • Social engineering (phishing for credentials)

11. Audit Recommendations

For third-party security audits, prioritize:

  1. Circuit constraint completeness β€” verify all signals used in output are properly constrained (no under-constrained paths).
  2. Poseidon parameter verification β€” confirm canonical parameters for BN128.
  3. Nonce/timestamp binding β€” ensure proof public signals match request nonce/timestamp.
  4. Replay protection robustness β€” test nonce store persistence, TTL expiry, and cross-instance synchronization.
  5. Error sanitization β€” verify verboseErrors: false does not leak internal state.
  6. Rate limiting bypass β€” test IP rotation, proxy evasion, and session forgery.

12. References

  • Protocol documentation: docs/PROTOCOL.md
  • Circuit complexity metrics: docs/CIRCUIT-COMPLEXITY.md
  • Cryptographic parameters: docs/CRYPTOGRAPHIC-PARAMETERS.md
  • Trusted setup ceremony: docs/TRUSTED-SETUP.md
  • Security policy: SECURITY.md
  • Audit checklist: docs/AUDIT.md

Last updated: 2026-02-09 Reviewed by: Claude Sonnet 4.5 (zk-id v1.0.0 release preparation)