You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
NoirZeppelin is a comprehensive, production-ready privacy library for the Noir programming language that ports battle-tested OpenZeppelin contract patterns into zero-knowledge circuits. This library enables developers to build privacy-preserving applications for both Web2 and Web3 environments without requiring deep cryptographic expertise.
The library standardizes common privacy patterns (authentication, access control, token operations, voting) while maintaining the security guarantees of zero-knowledge proofs. It aims to become the industry standard for privacy-preserving circuit development in Noir.
Current Challenges
Lack of Standardized Privacy Patterns: Developers building ZK applications must reinvent privacy primitives from scratch, leading to security vulnerabilities and inefficient code.
High Barrier to Entry: Understanding cryptographic proofs requires specialized knowledge. There's no "OpenZeppelin equivalent" for Noir that abstracts complexity.
Code Reusability: No established library pattern for privacy circuits. Each project siloes its implementation, wasting effort and creating maintenance burden.
Security Inconsistency: Without audited reference implementations, privacy bugs proliferate. Different projects implement the same concepts differently, reducing auditability.
Bridge Gap Between Web2 and Web3: Privacy needs exist in both centralized and decentralized applications, but Noir lacks tooling to serve both ecosystems simultaneously.
Verification Complexity: Integrating ZK proofs with smart contracts requires manual Solidity verifier generation and testing. This process is error-prone.
Why Now?
Noir is gaining adoption (Aztec Contracts, Solidity integration, NoirJS)
Industry recognizes privacy as critical infrastructure
OpenZeppelin's success proves developers will adopt standardized libraries
Web3 needs privacy solutions; Web2 seeks regulatory-compliant authentication
Happy Case
Core Vision
Create an audited, production-ready library that:
Ports OpenZeppelin's most critical functions to Noir circuits
Works seamlessly with both Web2 backends and Web3 smart contracts
Provides clear security patterns and best practices
Reduces development time and security risk
Establishes Noir as the standard for privacy-preserving applications
1. Access Control Module
Ported from: OpenZeppelin's AccessControl.sol and Ownable.sol
Functions
verify_role() - Prove user has a specific role without revealing identity
verify_multisig() - Prove M-of-N signatures for governance
verify_permission() - Check permissions against a Merkle tree of privileges
verify_ownership() - Prove ownership of a resource
Sample Implementation
// Prove user has admin role without revealing identitypubfnverify_role(
user_commitment: Field,
role: Field,
role_commitment: Field,
salt: Field
) ->bool {
// User commitment hides actual identity// Prove: hash(user_commitment + role + salt) == role_commitmentletcomputed = std::hash::poseidon::bn254::hash_3([user_commitment, role, salt]);
computed == role_commitment
}
// Prove M-of-N multisig without revealing which signerspubfnverify_multisig<N>(
signers: [Field; N],
threshold: u32,
message_hash: Field,
signatures: [Field; N]
) ->bool {
letmut valid_count = 0;
foriin0..N {
// Check if signature is valid for this signerifsignatures[i] == std::hash::poseidon::bn254::hash_2([signers[i], message_hash]) {
valid_count += 1;
}
}
valid_count >= threshold
}
Use Cases
Web3: Private governance systems (DAO voting without revealing voter identity)
Web2: Role-based authentication (access corporate systems without exposing roles)
// Prove valid vote with eligibility and replay protectionpubfnprove_valid_vote<letTREE_DEPTH: u32>(
voter_id: Field,
vote: u32,
vote_commitment: Field,
voters_root: Field,
voter_merkle_proof: [Field; TREE_DEPTH],
salt: Field
) ->bool {
// Vote must be valid (0 = No, 1 = Yes)letvalid_vote = (vote == 0) | (vote == 1);
// Prove voter is in eligible voters registryletvoter_commitment = std::hash::poseidon::bn254::hash_2([voter_id, salt]);
letvalid_voter = verify_merkle_proof(
voter_commitment,
0,
voter_merkle_proof,
voters_root
);
// Verify vote commitment matchesletcommitment_matches = vote_commitment ==
std::hash::poseidon::bn254::hash_3([voter_id, voteasField, salt]);
valid_vote & valid_voter & commitment_matches
}
// Generate nullifier to prevent double votingpubfnprevent_double_voting(
voter_secret: Field,
proposal_id: Field
) ->Field {
// Nullifier uniquely identifies this voter+proposal combination// Prevents same voter from voting twice on same proposalstd::hash::poseidon::bn254::hash_2([voter_secret, proposal_id])
}
// Verify voter eligibility via Merkle proofpubfnverify_voter_eligibility<letTREE_DEPTH: u32>(
voter_id: Field,
voters_root: Field,
merkle_proof: [Field; TREE_DEPTH],
index: u32
) ->bool {
verify_merkle_proof(voter_id, index, merkle_proof, voters_root)
}
Use Cases
Web3: Private governance (voting without revealing your stance)
Web2: Private surveys/polls (aggregated results without individual responses)
5. Merkle Proof Module
Core utility for all privacy patterns
Functions
verify_merkle_proof() - Standard Merkle proof verification
verify_merkle_batch() - Prove membership in multiple trees
update_merkle_path() - Generate proofs for dynamic trees
Sample Implementation
// Standard Merkle proof verificationpubfnverify_merkle_proof<letTREE_DEPTH: u32>(
leaf: Field,
index: u32,
sibling_path: [Field; TREE_DEPTH],
root: Field
) ->bool {
letmut computed = leaf;
foriin0..TREE_DEPTH {
// Check if we're on left or right branchif (index >> i) & 1 == 1 {
// We're on the right, sibling is on leftcomputed = std::hash::poseidon::bn254::hash_2([sibling_path[i], computed]);
} else {
// We're on the left, sibling is on rightcomputed = std::hash::poseidon::bn254::hash_2([computed, sibling_path[i]]);
}
}
computed == root
}
// Prove membership in multiple Merkle trees (batch verification)pubfnverify_merkle_batch<letN: u32, letTREE_DEPTH: u32>(
leaves: [Field; N],
indices: [u32; N],
sibling_paths: [[Field; TREE_DEPTH]; N],
roots: [Field; N]
) ->bool {
letmut all_valid = true;
foriin0..N {
letvalid = verify_merkle_proof(
leaves[i],
indices[i],
sibling_paths[i],
roots[i]
);
all_valid = all_valid & valid;
}
all_valid
}
// Generate nullifier for Merkle tree membership (privacy-preserving)pubfngenerate_merkle_nullifier(
leaf: Field,
nullifier_secret: Field
) ->Field {
std::hash::poseidon::bn254::hash_2([leaf, nullifier_secret])
}
Use Cases
Efficient membership proofs for whitelists, token registries, voting rolls
Anonymous credential systems
Private airdrop claims
Summary
NoirZeppelin brings the OpenZeppelin developer experience to privacy-preserving applications. Just as OpenZeppelin made smart contract development accessible and secure, NoirZeppelin makes zero-knowledge proof development simple and safe.
Developer Experience:
Simple API: Import functions like verify_password() or prove_token_balance() - no cryptography PhD required
Copy-paste ready: Production-ready circuits that work out of the box
Universal compatibility: Same code works for Web2 backends and Web3 smart contracts
Fast integration: Go from idea to working privacy app in hours, not weeks
Key Benefits:
Security by default: Audited, battle-tested patterns prevent common ZK vulnerabilities
Reduced development time: 10x faster than building privacy circuits from scratch
Lower risk: No need to reinvent cryptographic primitives - use proven patterns
Privacy without complexity: Abstract away circuit details, focus on your application logic
Impact:
NoirZeppelin establishes Noir as the standard for privacy-preserving applications, enabling developers to build with confidence whether they're creating private authentication systems, confidential DeFi protocols, or anonymous voting platforms.
With NoirZeppelin, privacy becomes a feature you can add, not a mountain you have to climb. (NOIR GUD 👽)
Alternatives Considered
Alternative 1: Roll Your Own
Pros: Full control, custom optimization Cons:
High security risk (no audits)
Months of development time
No community support
Maintenance burden
Alternative 2: Use Aztec.nr
Pros: Mature, well-tested Cons:
Aztec-specific (not general purpose)
Limited Web2 support
Tightly coupled to Aztec network
Not modular enough for standalone use
Alternative 3: Port from Circom
Pros: Existing implementations Cons:
Different language paradigm
Manual porting required
Not idiomatic Noir
No Noir-specific optimizations
Why NoirZeppelin is Better
Additional Context
Why This Matters
For the Noir Ecosystem
Accelerates Adoption: Lower barrier to entry for privacy apps
Security: Audited reference implementations reduce vulnerabilities
Standardization: Industry-standard patterns for privacy circuits
Documentation: Clear examples and best practices
For Developers
Time Savings: Stop reinventing the wheel
Security: Built on battle-tested cryptographic patterns
Flexibility: Works with any Noir backend (Barretenberg, Marlin, etc.)
Dual Use: Same library for Web2 and Web3
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Problem
NoirZeppelin is a comprehensive, production-ready privacy library for the Noir programming language that ports battle-tested OpenZeppelin contract patterns into zero-knowledge circuits. This library enables developers to build privacy-preserving applications for both Web2 and Web3 environments without requiring deep cryptographic expertise.
The library standardizes common privacy patterns (authentication, access control, token operations, voting) while maintaining the security guarantees of zero-knowledge proofs. It aims to become the industry standard for privacy-preserving circuit development in Noir.
Current Challenges
Lack of Standardized Privacy Patterns: Developers building ZK applications must reinvent privacy primitives from scratch, leading to security vulnerabilities and inefficient code.
High Barrier to Entry: Understanding cryptographic proofs requires specialized knowledge. There's no "OpenZeppelin equivalent" for Noir that abstracts complexity.
Code Reusability: No established library pattern for privacy circuits. Each project siloes its implementation, wasting effort and creating maintenance burden.
Security Inconsistency: Without audited reference implementations, privacy bugs proliferate. Different projects implement the same concepts differently, reducing auditability.
Bridge Gap Between Web2 and Web3: Privacy needs exist in both centralized and decentralized applications, but Noir lacks tooling to serve both ecosystems simultaneously.
Verification Complexity: Integrating ZK proofs with smart contracts requires manual Solidity verifier generation and testing. This process is error-prone.
Why Now?
Noir is gaining adoption (Aztec Contracts, Solidity integration, NoirJS)
Industry recognizes privacy as critical infrastructure
OpenZeppelin's success proves developers will adopt standardized libraries
Web3 needs privacy solutions; Web2 seeks regulatory-compliant authentication
Happy Case
Core Vision
Create an audited, production-ready library that:
1. Access Control Module
Ported from: OpenZeppelin's
AccessControl.solandOwnable.solFunctions
verify_role()- Prove user has a specific role without revealing identityverify_multisig()- Prove M-of-N signatures for governanceverify_permission()- Check permissions against a Merkle tree of privilegesverify_ownership()- Prove ownership of a resourceSample Implementation
Use Cases
2. Authentication Module
Ported from: OpenZeppelin's
ERC721Permit.sol,ERC2612.solpatternsFunctions
prove_secret_knowledge()- Prove you know a secret without revealing itverify_password()- Verify a password against a salted hash (for Web2 apps)verify_2fa()- Time-window-based OTP verificationprove_ownership_key()- Prove control of a private key/accountsign_and_verify()- Fiat-Shamir-based signature verificationSample Implementation
Use Cases
3. Token Operations Module
Ported from: OpenZeppelin's
ERC20.sol,ERC721.sol,ERC1155.solFunctions
prove_token_balance()- Prove you own tokens without revealing amountprove_transfer_valid()- Prove a transfer is valid (sufficient funds, proper permissions)prove_token_spending()- Anonymous token spending with nullifiers (prevent double-spend)verify_nft_ownership()- Prove ownership of an NFT without revealing which oneprove_batch_transfer()- Verify multiple transfers without revealing amountsSample Implementation
Use Cases
4. Voting & Governance Module
Ported from: OpenZeppelin's
Governor.solpatternsFunctions
prove_valid_vote()- Prove you're eligible to vote and cast a valid voteprove_vote_tally()- Aggregate votes without revealing individual votesverify_voter_eligibility()- Merkle-tree based voter registry checkprevent_double_voting()- Nullifier-based replay protectionSample Implementation
Use Cases
5. Merkle Proof Module
Core utility for all privacy patterns
Functions
verify_merkle_proof()- Standard Merkle proof verificationverify_merkle_batch()- Prove membership in multiple treesupdate_merkle_path()- Generate proofs for dynamic treesSample Implementation
Use Cases
Summary
NoirZeppelin brings the OpenZeppelin developer experience to privacy-preserving applications. Just as OpenZeppelin made smart contract development accessible and secure, NoirZeppelin makes zero-knowledge proof development simple and safe.
Developer Experience:
verify_password()orprove_token_balance()- no cryptography PhD requiredKey Benefits:
Impact:
NoirZeppelin establishes Noir as the standard for privacy-preserving applications, enabling developers to build with confidence whether they're creating private authentication systems, confidential DeFi protocols, or anonymous voting platforms.
With NoirZeppelin, privacy becomes a feature you can add, not a mountain you have to climb. (NOIR GUD 👽)
Alternatives Considered
Alternative 1: Roll Your Own
Pros: Full control, custom optimization
Cons:
Alternative 2: Use Aztec.nr
Pros: Mature, well-tested
Cons:
Alternative 3: Port from Circom
Pros: Existing implementations
Cons:
Why NoirZeppelin is Better
Additional Context
Why This Matters
For the Noir Ecosystem
Accelerates Adoption: Lower barrier to entry for privacy apps
Security: Audited reference implementations reduce vulnerabilities
Standardization: Industry-standard patterns for privacy circuits
Documentation: Clear examples and best practices
For Developers
Time Savings: Stop reinventing the wheel
Security: Built on battle-tested cryptographic patterns
Flexibility: Works with any Noir backend (Barretenberg, Marlin, etc.)
Dual Use: Same library for Web2 and Web3
NoirZeppelin - Implementation Roadmap
Phase 1: MVP (Months 1-2)
Core Deliverables:
Phase 2: Extended (Months 3-4)
Core Deliverables:
Phase 3: Ecosystem (Months 5-6)
Core Deliverables:
Security Considerations
Threat Model
1. Proof Forgery
2. Replay Attacks
3. Information Leakage
4. Circuit Vulnerabilities
Audit Plan
Internal:
External:
Community:
Formal Verification:
Would you like to submit a PR for this Issue?
Yes
Support Needs
NoirZeppelin - Support Needs
Looking for support from the community in these areas:
1. Technical Review
2. Security Audit
3. Documentation
4. Community
5. Ecosystem Integration
Beta Was this translation helpful? Give feedback.
All reactions