๐Ÿ›ก๏ธ Chapter 5: Zero-Knowledge Proofs & Privacy

WIA-FIN-010 Digital Identity Standard | Part 5 of 8

In this chapter: We explore zero-knowledge proofs (ZKPs), the cryptographic technique that enables proving facts about yourself without revealing the underlying data, and advanced privacy techniques for identity systems.

5.1 What Are Zero-Knowledge Proofs?

Imagine proving you're over 18 without revealing your exact birthdate. Or proving you have enough money in your account without disclosing the balance. Or proving you're a citizen without showing your passport. This is the power of zero-knowledge proofs.

A zero-knowledge proof is a cryptographic method where one party (the prover) can convince another party (the verifier) that a statement is true without revealing any information beyond the validity of the statement itself.

๐Ÿ” The Magic of ZKPs

ZKPs sound impossibleโ€”how can you prove something without showing it? The answer lies in advanced mathematics, specifically cryptographic protocols that allow verification without disclosure. It's like proving you know a secret without ever revealing the secret.

5.2 ZKP Properties

A proper zero-knowledge proof must have three properties:

5.3 Types of Zero-Knowledge Proofs

5.3.1 Interactive vs Non-Interactive

Interactive ZKPs: Require back-and-forth communication between prover and verifier (multiple rounds of challenge-response)

Non-Interactive ZKPs (NIZKs): Single message from prover to verifier. Better for credentials because the proof can be reused

5.3.2 zk-SNARKs

Zero-Knowledge Succinct Non-Interactive Arguments of Knowledge

5.3.3 zk-STARKs

Zero-Knowledge Scalable Transparent Arguments of Knowledge

5.3.4 BBS+ Signatures

Specialized ZKP scheme perfect for selective disclosure in credentials:

5.4 ZKP Applications in Digital Identity

5.4.1 Age Verification

Prove you're over a certain age without revealing exact birthdate:

// Claim: age >= 18
// Private input: birthdate = 1995-06-15
// Public input: current_date, minimum_age = 18
// ZKP proves: (current_date - birthdate) >= (18 * 365.25)

The verifier learns only that you're over 18, not your exact age or birthdate.

5.4.2 Income Range Proof

Prove income falls within a range for loan qualification without revealing exact salary:

// Claim: $50,000 <= income <= $100,000
// Private input: income = $75,000
// ZKP proves: income is in range

5.4.3 Credential Validity

Prove you have a valid credential from an authorized issuer without revealing the credential details:

5.4.4 Membership Proofs

Prove you're a member of a group without revealing your identity:

5.5 Privacy Techniques in Identity Systems

5.5.1 Pairwise Pseudonymous DIDs

Create a unique DID for each relationship to prevent correlation:

Even if services collude, they can't link these DIDs to the same person.

5.5.2 Blinded Signatures

Issuer signs a credential without seeing its contents. Holder can later reveal and prove authenticity:

5.5.3 Anonymous Credentials

Credentials that can be shown multiple times without creating trackable correlation:

5.6 Privacy vs Accountability

While privacy is crucial, some accountability is necessary. The challenge is balancing:

5.6.1 Privacy for Users

5.6.2 Accountability for Compliance

5.6.3 Balanced Approaches

5.7 Implementing ZKPs in Practice

Several frameworks make ZKPs accessible to developers:

5.7.1 Circom + SnarkJS

Popular tools for building zk-SNARKs:

// Circom circuit for age verification
template AgeVerification() {
    signal input birthYear;
    signal input currentYear;
    signal input minimumAge;
    signal output valid;

    signal age;
    age <== currentYear - birthYear;
    
    component gte = GreaterEqThan(32);
    gte.in[0] <== age;
    gte.in[1] <== minimumAge;
    valid <== gte.out;
}

5.7.2 ZoKrates

High-level language for ZKP circuits, compiles to Ethereum-compatible proofs

5.7.3 Practical Considerations

Chapter Summary