Overview
The identity_registration circuit creates a Poseidon commitment over identity attributes. This commitment hides the user’s document details behind a salt while allowing on-chain verification that the commitment was correctly formed.Circuit source:
/home/daytona/workspace/source/circuits/identity_registration.circom:1Constraint count: ~700 (fast proving, ~0.5 seconds)Circuit Interface
Private Inputs
These values remain hidden in the zero-knowledge proof:Hash of the issuing authority’s certificate (e.g., government CA).Computed as
Poseidon(issuerName, certPublicKey, expiryDate) off-chain.Hash of the identity document number (passport, ID card, etc.).Computed as
Poseidon(documentNumber) off-chain.Hash of the date of birth.Computed as
Poseidon(birthYear, birthMonth, birthDay) off-chain.Important: This same value is reused in the age_check circuit.Random salt chosen by the user (minimum 128 bits of entropy).CRITICAL: Store this salt securely. It’s required for all future proofs that reference this identity commitment.
Public Output
The Poseidon commitment over all four private inputs.Formula:
Poseidon(issuerCertHash, docNumberHash, dobHash, userSalt)This commitment is published on-chain in the identity registry.Circuit Implementation
The circuit is straightforward, consisting of a single Poseidon hash:identity_registration.circom
- Uses
Poseidon(4)for hashing 4 inputs - All inputs are private by default (no
{public [...]}declaration) - Output
identityCommitmentis automatically made public - ~700 constraints (mostly from Poseidon internals)
Proof Generation
Step 1: Prepare Inputs
Step 2: Generate Proof
Step 3: Register On-Chain
Security Analysis
Commitment Security
The identity commitment is computationally hiding and binding:-
Hiding: Given only
identityCommitment, an attacker cannot determine the preimage values without breaking Poseidon collision resistance (~128-bit security). - Binding: The user cannot produce a valid proof with different identity attributes that result in the same commitment (Poseidon collision resistance).
Salt Uniqueness
Best practice:Input Validation
This circuit does NOT validate that the input hashes correspond to real documents. That validation happens off-chain during the KYC process before proof generation.
- “I know a preimage (issuerCertHash, docNumberHash, dobHash, userSalt) that hashes to this commitment”
- That the issuer is legitimate
- That the document number is valid
- That the DOB is formatted correctly
Integration with Other Circuits
Age Check Circuit
Theage_check circuit reuses the same identityCommitment and userSalt:
Trust Registry
Merchants can query the on-chain trust registry to check if an identity commitment is associated with a trusted issuer:Performance
| Metric | Value |
|---|---|
| Constraints | ~700 |
| Proving time (browser, M1) | ~0.5 seconds |
| Proving time (server, AMD 5950X) | ~0.2 seconds |
| Proof size | 128 bytes (Groth16) |
| Verification gas (Sui) | ~0.001 SUI |
| WASM size | ~5MB |
| zkey size | ~8MB |
Testing
Next Steps
Age Check Circuit
Prove minimum age using the same identity commitment
Meta Address Registry
Register identity commitments on-chain
