ZKPDL: A Language-Based System for Zero- Knowledge Proofs and - - PowerPoint PPT Presentation

zkpdl a language based system for zero knowledge proofs
SMART_READER_LITE
LIVE PREVIEW

ZKPDL: A Language-Based System for Zero- Knowledge Proofs and - - PowerPoint PPT Presentation

ZKPDL: A Language-Based System for Zero- Knowledge Proofs and Electronic Cash Sarah Meiklejohn (UC San Diego) C. Chris Erway (Brown University) Alptekin Kpc (Brown University) Theodora Hinkle (UW Madison) Anna Lysyanskaya (Brown


slide-1
SLIDE 1

ZKPDL: A Language-Based System for Zero- Knowledge Proofs and Electronic Cash

Sarah Meiklejohn (UC San Diego)

  • C. Chris Erway (Brown University)

Alptekin Küpcü (Brown University) Theodora Hinkle (UW Madison) Anna Lysyanskaya (Brown University)

1

slide-2
SLIDE 2

Bridging the gap Crypto Systems

2

slide-3
SLIDE 3

Bridging the gap Crypto Systems

2

slide-4
SLIDE 4

Bridging the gap Crypto Systems

2

slide-5
SLIDE 5

Bridging the gap Crypto Systems

2

slide-6
SLIDE 6

Bridging the gap Crypto Systems

2

slide-7
SLIDE 7

Bridging the gap... for zero knowledge proofs Crypto Systems

3

slide-8
SLIDE 8

P2P file sharing

Bridging the gap... for zero knowledge proofs Crypto Systems

3

slide-9
SLIDE 9

P2P file sharing

Bridging the gap... for zero knowledge proofs Crypto Systems

3

e-cash library

slide-10
SLIDE 10

P2P file sharing

Bridging the gap... for zero knowledge proofs Crypto Systems

3

e-cash library

Zero knowledge

slide-11
SLIDE 11

P2P file sharing

Bridging the gap... for zero knowledge proofs Crypto Systems

Wrote language for zero-knowledge proofs Removes obstacle, easy to translate from description to implementation Wrote library for e-cash using this language/interpreter framework

3

e-cash library

Zero knowledge

slide-12
SLIDE 12

Zero-knowledge proofs [GMR89,BdSMP91]

4

Prover Verifier

slide-13
SLIDE 13

Zero-knowledge proofs [GMR89,BdSMP91]

I have access credentials

4

Prover Verifier

slide-14
SLIDE 14

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials

4

Prover Verifier

slide-15
SLIDE 15

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials Okay

4

Prover Verifier

slide-16
SLIDE 16

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials Okay

Soundness: system won’t accept incorrect proof Zero-knowledge: system won’t learn anything it didn’t already know

4

Prover Verifier

slide-17
SLIDE 17

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials Okay

Soundness: system won’t accept incorrect proof Zero-knowledge: system won’t learn anything it didn’t already know

anonymous

  • nion routing

deniable authentication electronic voting blind signatures fair exchange anonymous credentials group signatures multi-party computation non- transferable signatures verifiable encryption verifiable secret sharing electronic cash

4

Prover Verifier

slide-18
SLIDE 18

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials Okay

Soundness: system won’t accept incorrect proof Zero-knowledge: system won’t learn anything it didn’t already know

anonymous

  • nion routing

deniable authentication electronic voting blind signatures fair exchange anonymous credentials group signatures multi-party computation non- transferable signatures verifiable encryption verifiable secret sharing electronic cash

4

Prover Verifier

slide-19
SLIDE 19

Zero-knowledge proofs [GMR89,BdSMP91]

...

I have access credentials Okay

Soundness: system won’t accept incorrect proof Zero-knowledge: system won’t learn anything it didn’t already know

anonymous

  • nion routing

deniable authentication electronic voting blind signatures fair exchange anonymous credentials group signatures multi-party computation non- transferable signatures verifiable encryption verifiable secret sharing

Zero-knowledge proofs have applications, but can be complex

electronic cash

4

Prover Verifier

slide-20
SLIDE 20

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

5

slide-21
SLIDE 21

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

Our first attempt: write library from scratch

5

slide-22
SLIDE 22

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

Our first attempt: write library from scratch

5

slide-23
SLIDE 23

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

Our first attempt: write library from scratch

}

5

slide-24
SLIDE 24

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

Our first attempt: write library from scratch e-cash library

}

5

slide-25
SLIDE 25

Implementing zero knowledge (take 1)

Zero knowledge P2P file sharing

Crypto Systems

Our first attempt: write library from scratch

  • Not reusable
  • Time-consuming
  • Error prone

e-cash library

}

5

slide-26
SLIDE 26

Implementing zero knowledge (take 1)

6

slide-27
SLIDE 27

Implementing zero knowledge (take 1)

  • Lesson learned: even though you know the math, coding can get messy

6

slide-28
SLIDE 28

Implementing zero knowledge (take 1)

  • Lesson learned: even though you know the math, coding can get messy

Coin::Coin(const BankParameters *params, int stat, int lx, hashalg_t hashAlg, const ZZ &coinIndex, const ZZ &walletSize, int coinDenom, const ZZ &sk_u, const ZZ &s, const ZZ &t, const vec_ZZ &clSig, const vector<SecretValue> &clPrivateSecrets, const vector<SecretValue> &clPrivateRandoms, const ZZ &r) { ...

6

slide-29
SLIDE 29

Implementing zero knowledge (take 1)

  • Lesson learned: even though you know the math, coding can get messy
  • Functionality is there, but not easy to use

Coin::Coin(const BankParameters *params, int stat, int lx, hashalg_t hashAlg, const ZZ &coinIndex, const ZZ &walletSize, int coinDenom, const ZZ &sk_u, const ZZ &s, const ZZ &t, const vec_ZZ &clSig, const vector<SecretValue> &clPrivateSecrets, const vector<SecretValue> &clPrivateRandoms, const ZZ &r) { ...

6

slide-30
SLIDE 30

Implementing zero knowledge (take 2)

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

7

slide-31
SLIDE 31

Implementing zero knowledge (take 2)

Zero knowledge P2P file sharing

Crypto Systems

e-cash library How can we lighten the implementation load?

}

7

slide-32
SLIDE 32

Implementing zero knowledge (take 2)

Zero knowledge P2P file sharing

Crypto Systems

e-cash library How can we lighten the implementation load?

  • Design a language: ZKPDL (Zero Knowledge Proof Description Language)
  • Build an interpreter to automatically translate from ZKPDL to proofs

}

7

slide-33
SLIDE 33

Implementing zero knowledge (take 2)

Zero knowledge P2P file sharing

Crypto Systems

e-cash library How can we lighten the implementation load?

  • Design a language: ZKPDL (Zero Knowledge Proof Description Language)
  • Build an interpreter to automatically translate from ZKPDL to proofs

}

interpreter

7

slide-34
SLIDE 34

Step 1: writing programs in ZKPDL

8

High-level language, goal was to mirror theoretical descriptions

slide-35
SLIDE 35

Step 1: writing programs in ZKPDL

Description in paper

8

High-level language, goal was to mirror theoretical descriptions

slide-36
SLIDE 36

Step 1: writing programs in ZKPDL

computation: ... compute: S := g^(1/(s+x+1)) T := g^u * (g^(1/(t+x+1)))^R proof: given: group: G = <g,h> elements in G: S, T prove knowledge of: exponents in G: u,s,t,x integer: J such that: range: 0 <= J < n S = g^(1/(s+x+1))

Description in paper Description in ZKPDL

8

High-level language, goal was to mirror theoretical descriptions

slide-37
SLIDE 37

Step 1: writing programs in ZKPDL

computation: ... compute: S := g^(1/(s+x+1)) T := g^u * (g^(1/(t+x+1)))^R proof: given: group: G = <g,h> elements in G: S, T prove knowledge of: exponents in G: u,s,t,x integer: J such that: range: 0 <= J < n S = g^(1/(s+x+1))

Description in paper Description in ZKPDL

8

High-level language, goal was to mirror theoretical descriptions

slide-38
SLIDE 38

Step 1: writing programs in ZKPDL

computation: ... compute: S := g^(1/(s+x+1)) T := g^u * (g^(1/(t+x+1)))^R proof: given: group: G = <g,h> elements in G: S, T prove knowledge of: exponents in G: u,s,t,x integer: J such that: range: 0 <= J < n S = g^(1/(s+x+1))

Currently support four ZKP types, enough for vast majority of applications Should also be easy to add new types if they’re needed

Description in paper Description in ZKPDL

8

High-level language, goal was to mirror theoretical descriptions

slide-39
SLIDE 39

Sample usage of the interpreter

I have access credentials

9

Prover Verifier

slide-40
SLIDE 40

Sample usage of the interpreter

Interpreter Interpreter

ZKPDL program

9

Prover Verifier

slide-41
SLIDE 41

Sample usage of the interpreter

Interpreter Interpreter

  • At compile time, check program syntax, types, etc.

ZKPDL program

9

Prover Verifier

slide-42
SLIDE 42

Sample usage of the interpreter

Interpreter Interpreter

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-43
SLIDE 43

Sample usage of the interpreter

Interpreter Interpreter

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-44
SLIDE 44

Sample usage of the interpreter

PROOF

Interpreter Interpreter

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-45
SLIDE 45

Sample usage of the interpreter

PROOF

Interpreter Interpreter

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-46
SLIDE 46

Sample usage of the interpreter

PROOF

Interpreter Interpreter

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-47
SLIDE 47

Sample usage of the interpreter

PROOF

Interpreter Interpreter

/

public values secret values

  • At compile time, check program syntax, types, etc.
  • At run time, need all values to be proved

9

Prover Verifier

slide-48
SLIDE 48

Step 2: using the interpreter to write a library

10

slide-49
SLIDE 49

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

10

slide-50
SLIDE 50

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

Interpreter

program

10

slide-51
SLIDE 51

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

Interpreter

publics secrets

10

slide-52
SLIDE 52

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

PROOF

Interpreter

publics secrets

10

slide-53
SLIDE 53

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

Proof MyZKP::prove(group_map g, variable_map v, string program) { InterpreterProver p; p.check(program); p.compute(g,v); return p.prove(); }

10

slide-54
SLIDE 54

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

  • Specify crypto protocol of choice in the program string

Proof MyZKP::prove(group_map g, variable_map v, string program) { InterpreterProver p; p.check(program); p.compute(g,v); return p.prove(); }

10

slide-55
SLIDE 55

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

  • Specify crypto protocol of choice in the program string
  • Feed numeric values in and you’re done!

Proof MyZKP::prove(group_map g, variable_map v, string program) { InterpreterProver p; p.check(program); p.compute(g,v); return p.prove(); }

10

slide-56
SLIDE 56

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

  • Specify crypto protocol of choice in the program string
  • Feed numeric values in and you’re done!

Solves issues of reusability and of time

Proof MyZKP::prove(group_map g, variable_map v, string program) { InterpreterProver p; p.check(program); p.compute(g,v); return p.prove(); }

10

slide-57
SLIDE 57

Step 2: using the interpreter to write a library

Use simple procedure to create wrapper classes for interpreter

  • Specify crypto protocol of choice in the program string
  • Feed numeric values in and you’re done!

Solves issues of reusability and of time Took 3-4 months to build interpreter, then one month to reconstruct library

Proof MyZKP::prove(group_map g, variable_map v, string program) { InterpreterProver p; p.check(program); p.compute(g,v); return p.prove(); }

10

slide-58
SLIDE 58

Optimizations: caching

In addition to usability, can achieve improvements in efficiency

11

slide-59
SLIDE 59

Optimizations: caching

In addition to usability, can achieve improvements in efficiency

11

Have optimizations built into the interpreter

slide-60
SLIDE 60

Optimizations: caching

In addition to usability, can achieve improvements in efficiency

11

Have optimizations built into the interpreter

  • Cache powers of bases used for modular exponentiation

Often have g^x*h^r mod N, numbers are 1000 bits long! Use common single- and multi-exponentiation techniques

slide-61
SLIDE 61

Optimizations: caching

In addition to usability, can achieve improvements in efficiency

11

Have optimizations built into the interpreter

  • Cache powers of bases used for modular exponentiation

Often have g^x*h^r mod N, numbers are 1000 bits long! Use common single- and multi-exponentiation techniques

  • Save copy of interpreter state after compilation
slide-62
SLIDE 62

Did caching help?

12

On the prover side, saw about a 50% speed-up using all optimizations On the verifier side, about 30% (less computation)

slide-63
SLIDE 63

Did caching help?

12

On the prover side, saw about a 50% speed-up using all optimizations On the verifier side, about 30% (less computation)

slide-64
SLIDE 64

Did caching help?

12

On the prover side, saw about a 50% speed-up using all optimizations On the verifier side, about 30% (less computation)

slide-65
SLIDE 65

Case study: using ZKPDL for e-cash

13

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

interpreter

slide-66
SLIDE 66

Case study: using ZKPDL for e-cash

13

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

interpreter

slide-67
SLIDE 67

Case study: using ZKPDL for e-cash

13

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

interpreter

slide-68
SLIDE 68

Case study: using ZKPDL for e-cash

13

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

interpreter

slide-69
SLIDE 69

Case study: using ZKPDL for e-cash

13

E-cash was originally developed [Ch82] as replacement for currency Now, view e-cash in context of token systems

  • Our usage in P2P file-sharing schemes [BCE+07]
  • Provides anonymous transportation ticketing (future work)

Zero knowledge P2P file sharing

Crypto Systems

e-cash library

}

interpreter

slide-70
SLIDE 70

How e-cash works [Ch82, CHL05, CLM07]

14

slide-71
SLIDE 71

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank

slide-72
SLIDE 72

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank

slide-73
SLIDE 73

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase

slide-74
SLIDE 74

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase

slide-75
SLIDE 75

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase

slide-76
SLIDE 76

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase Unlinkability: if Alice spends twice, Bob won’t even know it’s the same person

slide-77
SLIDE 77

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase Unlinkability: if Alice spends twice, Bob won’t even know it’s the same person Deposit: Bob deposits these coins with the bank

slide-78
SLIDE 78

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase Unlinkability: if Alice spends twice, Bob won’t even know it’s the same person Deposit: Bob deposits these coins with the bank

slide-79
SLIDE 79

How e-cash works [Ch82, CHL05, CLM07]

14

Withdraw: Alice gets coins from bank Buy: Alice gives Bob coin in exchange for her purchase Unlinkability: if Alice spends twice, Bob won’t even know it’s the same person Deposit: Bob deposits these coins with the bank Untraceability: Bank cannot trace the deposited coins back to Alice

slide-80
SLIDE 80

CashLib: integrating e-cash into a P2P system

15

slide-81
SLIDE 81

CashLib: integrating e-cash into a P2P system

15

slide-82
SLIDE 82

CashLib: integrating e-cash into a P2P system

15

Operations: Actors: How e-cash can improve P2P interactions:

slide-83
SLIDE 83

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors: How e-cash can improve P2P interactions:

slide-84
SLIDE 84

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

slide-85
SLIDE 85

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

slide-86
SLIDE 86

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

slide-87
SLIDE 87

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

slide-88
SLIDE 88

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

slide-89
SLIDE 89

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
slide-90
SLIDE 90

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy
  • Barter

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
slide-91
SLIDE 91

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy
  • Barter
  • Withdraw

Actors:

  • Buyer
  • Seller

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
slide-92
SLIDE 92

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy
  • Barter
  • Withdraw

Actors:

  • Buyer
  • Seller
  • Bank
  • Peer

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
slide-93
SLIDE 93

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy
  • Barter
  • Withdraw
  • Deposit

Actors:

  • Buyer
  • Seller
  • Bank
  • Peer

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
slide-94
SLIDE 94

CashLib: integrating e-cash into a P2P system

15

Operations:

  • Buy
  • Barter
  • Withdraw
  • Deposit

Actors:

  • Buyer
  • Seller
  • Bank
  • Peer

How e-cash can improve P2P interactions:

  • Guarantees fair exchange [BCE+07,KL10] between peers
  • Allows bank to monitor upload/download ratio without sacrificing privacy
slide-95
SLIDE 95

Related work

16

slide-96
SLIDE 96

Related work

16

So what aren’t we doing?

slide-97
SLIDE 97

Related work

16

So what aren’t we doing?

  • Aren’t guaranteeing anything about the quality of the proofs

You give us a bad (e.g., not sound) proof, get a bad proof back Checking soundness is well studied by others [CACE]

slide-98
SLIDE 98

Related work

16

So what aren’t we doing?

  • Aren’t guaranteeing anything about the quality of the proofs

You give us a bad (e.g., not sound) proof, get a bad proof back Checking soundness is well studied by others [CACE]

  • As application of zero knowledge, provide library only for e-cash

Idemix project [CH02, BBC+09] provides anonymous credentials

slide-99
SLIDE 99

In summary...

  • Wrote interpreter to make cryptographer’s job easier
  • Demonstrated efficiency and usability
  • Wrote library to make programmer’s job easier
  • All source code and documentation available freely online:
  • http://github.com/brownie/cashlib

17

slide-100
SLIDE 100

In summary...

  • Wrote interpreter to make cryptographer’s job easier
  • Demonstrated efficiency and usability
  • Wrote library to make programmer’s job easier
  • All source code and documentation available freely online:
  • http://github.com/brownie/cashlib

Any questions?

17

slide-101
SLIDE 101

Zero knowledge proof types

  • What types of proofs do we support?
  • Proof of discrete log representation (DLR): given c, prove c = g^x*h^r
  • Equality of DLR: given c and d, prove c = g^x*h^r and d = g^x*h^s
  • Multiplication: prove x = y*z for secret values x, y, z
  • Range: for secret x and public lo, hi, prove lo <= x < hi

18