Zero-Knowledge Proofs (ZKP)
Zero-Knowledge Proofs enable you to prove a statement is true without revealing any information beyond the validity of the statement itself. In the context of SSI, ZKPs allow you to prove claims about your credentials without disclosing the actual data.What is a Zero-Knowledge Proof?
A Zero-Knowledge Proof is a cryptographic method where one party (the prover) can prove to another party (the verifier) that a statement is true, without revealing any information beyond the truth of that statement.Example: Prove you’re over 21 years old without revealing your exact birthdate, or prove you’re a citizen without showing your passport number.
How ZKP Works
ZKP Properties
A valid zero-knowledge proof must have three properties:Completeness
If the statement is true, an honest prover can convince an honest verifier
Soundness
If the statement is false, no dishonest prover can convince the verifier (except with negligible probability)
Zero-Knowledge
The verifier learns nothing except that the statement is true
Real-World Examples
Age Verification
Traditional Approach:Income Verification
Scenario: Loan application requires proof of income over $50,000 Traditional:Citizenship Proof
Scenario: Access to service requires EU citizenship Traditional: Show passport (reveals name, birthdate, passport number, photo) Zero-Knowledge: Prove “I am an EU citizen” without showing passport detailsTypes of ZKP
Range Proofs
Range Proofs
Prove a value falls within a range without revealing the exact value.Example: Prove age is between 18-65 without showing exact age
Membership Proofs
Membership Proofs
Prove you belong to a set without revealing which member you are.Example: Prove you’re an employee of approved companies without saying which one
Equality Proofs
Equality Proofs
Prove two values are equal without revealing the values.Example: Prove your name in two different credentials is the same
Computation Proofs
Computation Proofs
Prove the result of a computation without revealing inputs.Example: Prove average salary of a group without revealing individual salaries
ZKP in Sphyre
Sphyre implements ZKP for selective disclosure and privacy-preserving verification:Implementation
Use Cases in Sphyre
Age Verification
Prove you meet age requirements without revealing exact birthdate
Income Verification
Prove income threshold without disclosing exact salary
Location Proof
Prove residency in a region without revealing exact address
Qualification Proof
Prove you meet educational requirements without showing full transcript
Credit Score Range
Prove credit score is above threshold without exact number
Access Control
Prove membership in authorized group without identifying yourself
ZKP Workflow in Sphyre
1
Verifier Creates Request
Verifier specifies what they want to prove
2
User Receives Request
Request appears in Sphyre ALV wallet
3
User Selects Credential
Choose which credential to use for the proof
4
Generate ZKP
Wallet generates proof using credential data
5
Submit Proof
Send proof to verifier (no raw data included)
6
Verifier Validates
Verifier cryptographically validates the proof
Advanced ZKP Techniques
zk-SNARKs
Zero-Knowledge Succinct Non-Interactive Arguments of KnowledgeSuccinct
Proofs are very small (hundreds of bytes)
Non-Interactive
No back-and-forth needed between prover and verifier
Fast Verification
Verification is extremely quick
Privacy-Preserving
Complete privacy for the prover
- Complex credential combinations
- Multiple claim verification
- Blockchain scalability
zk-STARKs
Zero-Knowledge Scalable Transparent Arguments of Knowledge Advantages:- No trusted setup required
- Quantum-resistant
- Transparent and auditable
- Larger proof sizes than SNARKs
- Slower proof generation
Credential Predicates
Predicates define conditions that can be proven with ZKP:Privacy Levels
Different scenarios require different privacy levels:- Full Disclosure
- Selective Disclosure
- Zero-Knowledge Proof
When: High trust relationship, legal requirementPrivacy: ⭐ (Low)
Implementation Example
Complete Age Verification Flow
Security Considerations
Replay Attacks
Replay Attacks
Risk: Reusing the same proof multiple timesMitigation: Include unique challenges and timestamps
Linkability
Linkability
Risk: Correlating proofs to track usersMitigation: Use different credentials or randomized proofs
Side-Channel Attacks
Side-Channel Attacks
Risk: Leaking information through timing or resourcesMitigation: Constant-time operations, noise injection
Credential Revocation
Credential Revocation
Risk: Proving claims from revoked credentialsMitigation: Include non-revocation proofs
Performance Considerations
| ZKP Type | Proof Size | Proof Time | Verify Time | Setup |
|---|---|---|---|---|
| zk-SNARK | ~200 bytes | ~1 second | ~1 ms | Trusted setup |
| zk-STARK | ~50 KB | ~5 seconds | ~10 ms | Transparent |
| Bulletproofs | ~1 KB | ~2 seconds | ~5 ms | None |
| Range Proofs | ~2 KB | ~500 ms | ~2 ms | None |
Comparison: Traditional vs ZKP
| Aspect | Traditional Verification | Zero-Knowledge Proof |
|---|---|---|
| Data Shared | Full credential | No raw data |
| Privacy | Low | Maximum |
| Trust Required | High | Minimal |
| Verification | Check all data | Verify proof only |
| Complexity | Low | Medium to High |
| Speed | Instant | ~1-5 seconds |
| Standards | Well established | Emerging |
ZKP Libraries & Tools
Sphyre uses and recommends these ZKP libraries:circom
Circuit compiler for zk-SNARKscircom documentation
snarkjs
JavaScript library for zk-SNARKssnarkjs on GitHub
ZoKrates
High-level language for ZKPZoKrates documentation
libsnark
C++ library for zk-SNARKslibsnark on GitHub
Future of ZKP in Sphyre
1
Enhanced Privacy
More granular ZKP options for complex predicates
2
Performance Optimization
Faster proof generation using optimized circuits
3
Recursive Proofs
Combine multiple proofs into a single compact proof
4
Universal Composability
Standard ZKP format across all SSI systems
Common Use Cases
KYC Compliance
Prove identity verification without revealing PII
Financial Services
Prove creditworthiness without exposing financial details
Healthcare
Prove insurance coverage without sharing medical history
Education
Prove qualifications without full transcript
Employment
Prove work authorization without visa details
Voting
Prove eligibility without revealing identity
Resources
ZKProof Standards
Community-driven ZKP standardization
Zero Knowledge Podcast
Learn about ZKP developments
Awesome ZKP
Curated list of ZKP resources
ZKP Course
Learn ZKP fundamentals
Next Steps
1
Try ZKP in Sphyre
Use ZKP for age verification in the quickstart guide
2
Explore Wallet Features
Learn about Sphyre ALV ZKP capabilities
3
Developer Integration
Implement ZKP in your app with our API guide
4
Advanced Tutorials
Check out developer guides for custom ZKP circuits