Zero-Knowledge DNSSEC Validation for Trustless, Private DNS
- Overview
- DNS Basics & Problems
- DNSSEC: Cryptographic DNS Security
- Architecture & Design
- Use Cases
- Installation & Usage
- Future Roadmap
- Performance & Benchmarks
zkdnssec is a privacy-preserving DNSSEC validator using zero-knowledge proofs (ZKPs). It allows users to prove that a DNS record (e.g., A, TXT, CNAME) is cryptographically signed under DNSSEC rules (RFC 4034) without revealing the record itself, its signature (RRSIG), or the queried domain name.
- Zero-Knowledge DNSSEC: Prove RRSIG validity while hiding all sensitive DNS data.
- Web3 Compatibility: Generate proofs verifiable on Ethereum and other EVM chains (Groth16/PLONK).
- Multi-Proof Systems: Support for SP1(Core/Compressed), Groth16, and PLONK backends.
- RFC 4034 Compliance: Implements DNSSEC signing/validation logic natively in ZK circuits.
Built with: Succinct SP1 ZKVM.
The Domain Name System (DNS) is the internet’s phonebook, mapping domains (e.g., google.com) to IP addresses. It operates via a distributed hierarchy:
- Recursive Resolvers: Fetch DNS records from authoritative servers (e.g., Cloudflare, Google DNS).
- Authoritative Servers: Store DNS records for specific zones (e.g.,
.com,example.com).
Traditional DNS has no security guarantees:
- Spoofing: Attackers forge DNS responses (e.g., redirect
bank.comto a phishing site).- Example: The 2008 Kaminsky attack exploited DNS cache poisoning.
- No Integrity: Records can be modified in transit (MITM attacks).
- Cache Poisoning: Malicious data propagates across resolvers.
- Privacy Leaks: Queries expose user activity (e.g.,
torproject.orglookups).
DNSSEC (DNS Security Extensions) adds cryptographic signatures to DNS records.
-
Zone Signing:
- A zone owner (e.g.,
example.com) generates:- Zone Signing Key (ZSK): Signs individual DNS records.
- Key Signing Key (KSK): Signs the zone’s public keys (DNSKEY).
- Each DNS record (e.g.,
A 1.2.3.4) is signed with the ZSK, producing an RRSIG.
- A zone owner (e.g.,
-
Chain of Trust:
- Parent zones (e.g.,
.com) store a Delegation Signer (DS) record, a hash of the child zone’s KSK. - Resolvers validate the hierarchy:
- Root Zone (
.) → TLD (.com) → Domain (example.com).
- Root Zone (
- Parent zones (e.g.,
-
Validation Flow:
- A resolver checks:
- The RRSIG matches the DNS record.
- The DNSKEY validates the RRSIG.
- The DS record (from the parent zone) matches the DNSKEY’s hash.
- Recursively verify up to the root zone’s trusted anchor.
- A resolver checks:
- Centralized Trust: Relies on ICANN-controlled root keys.
- Privacy Leaks: Validation exposes queried domains and zone data.
- RRset: The DNS record set (e.g.,
example.com. 3600 IN A 1.2.3.4). - RRSIG: Signature over the RRset (RFC 4034 format).
- DNSKEY: Public key (ZSK) of the zone.
- Parsing:
- Extract the RRset, RRSIG, and DNSKEY.
- Parse RRSIG fields: Signer Name, Algorithm (e.g., RSA/SHA256), Labels, etc.
- Cryptographic Validation:
- Hash the RRset using the algorithm specified in RRSIG.
- Verify the signature against the DNSKEY’s public key.
| Type | Backend | Features | EVM-Compatible |
|---|---|---|---|
| Core | STARK | List of STARK Proofs | ❌ |
| Compressed | STARK | Constant Sized, small size | ❌ |
| Groth16 | SNARK | Gas-efficient ~260 bytes | ✅ |
| PLONK | SNARK | No trusted setup, ~868 bytes | ✅ |
- Private Domain Ownership Proof
- Trustless Cross-Chain Bridging: Prove a TXT record (e.g.,
_bridge.chain.example.com) authorizes a cross-chain transaction. - DNSSEC-Anchored Confidential PKI: Certificate Authorities (CAs) use DNS (CAA/DANE records) to validate domain ownership, but queries leak certificate metadata. Prove a domain’s CAA or TLSA (DANE) record authorizes a TLS certificate without revealing the certificate’s public key or DNS query.
- Light Client Bootstrapping: Light clients (e.g., Ethereum LES) rely on DNS for peer discovery, exposing them to sybil attacks. Validate peer lists via DNSSEC-signed ENR (Ethereum Node Records) with ZK proofs, ensuring peers are legitimate without trusting resolvers.
- and many more...
- Rust 1.81+
- SP1 ZKVM
- Foundry (for EVM verifiers)
To execute the Circuit, navigate to the scripts directory and run:
cargo run -- --executeThis will execute the circuit and print the output to the console. (This does not produce a proof.)
To generate a proof, navigate to the scripts directory and run:
cargo run -- --prove {mode}Mode can be one of the following:
core: Generate a Core SP1 STARK proof.compressed: Generate a Compressed SP1 STARK proof.groth16: Generate a Groth16 proof.plonk: Generate a PLONK proof.
example:
# Generate a Core proof
cargo run -- --prove core
# Generate a Compressed proof
cargo run -- --prove compressed
# Generate a Groth16 proof
cargo run -- --prove groth16
# Generate a PLONK proof
cargo run -- --prove plonkMore Args can be found in entrypoint.rs.
To test the foundry Contracts, navigate to the contracts directory and run:
forge test -vv- Recursive Chain of Trust: Validate root → TLD → domain in a single ZK proof.
- Authenticated Denial: NSEC/NSEC3 proofs to non-existence of DNS records.
The current implementation is not optimized for performance. For execution it takes around 270k cycles. Though this will be optimized in the future, on average it can take around 100k cycles to execute production-ready circuits.
