Skip to main content

Noir Contracts

Noir is the zero-knowledge programming language used for ZKNetwork's privacy-preserving smart contracts and verification systems. It compiles to multiple backends (Barretenberg, Aztec) and supports circuit composition.

Core Contracts

ZK-PKI (Privacy-Preserving Public Key Infrastructure)

// Simplified ZK-PKI registration proof
fn verify_registration(
identity_commitment: Field,
issuer_sig: [u8; 64],
merkle_proof: [Field; 32]
) -> bool {
// Verify issuer signature without revealing identity
// Verify inclusion in registry without revealing which index
// Return commitment for future verification
}

ZK-Firewall (Access Control)

// Age verification without revealing birthdate
fn verify_age(
birth_year_commitment: Field,
current_year: u32,
threshold: u32,
proof: Proof
) -> bool {
// Verify birth year > current_year - threshold
// Return boolean without revealing actual age
}

ZK-BOM (Bill of Materials Provenance)

// Supply chain verification
fn verify_component(
manufacturer_id: Field,
component_hash: Field,
provenance_chain: [Field; 10],
signature: [u8; 64]
) -> bool {
// Recursively verify each link in supply chain
// Confirm component authenticity
// Return provenance proof
}

Integration with Aztec

Noir contracts compile to Aztec's privacy layer:

Noir Contract → Noir Compiler → Aztec ACIR → Aztec Prover → Privacy Proof

This enables:

  • Confidential token transfers
  • Private DeFi operations
  • Shielded voting and governance

See also: Aztec Integration | Mix Networks