Cryptocurrency Privacy Innovations Discussed in CS251 Fall 2020

 
Final topics:  Cute Crypto Tricks
 
CS251 Fall 2020
 
(cs251.stanford.edu)
 
Dan Boneh
Quick Recap:   Rollup with privacy
Alice: 
  
5 DAI
  3 ETH
Bob: 
  
2 ETH
Zoe: 
  
1 ETH
   3 BAT
Merkle Tree
root
Quick Recap:   Rollup with privacy
Alice: 
  
5 DAI
  
1 ETH
Bob: 
  
3 ETH
  2 BAT
Zoe: 
  
2 ETH
  1 BAT
block  354
 
Privacy?
 
The Rollup server sees:
all account balances, and
all transactions.
 
Can we hide this from the Rollup server?
 
Yes!      Using zkSNARKs
Replace balances with commitments (simplified)
Alice: 
  
com
A
Bob: 
  
com
B
Zoe: 
  
com
Z
Merkle Tree
root
(commitment to balances)
A 
 B:  2 ETH
Replace balances with commitments (simplified)
Alice: 
  
com’
A
Bob: 
  
com’
B
Zoe: 
  
com
Z
block  354
(commitment to balances)
open of 
com
A
A 
 B:  2 ETH
 
Replace balances with commitments (simplified)
Alice:
  
com’
A
Bob:
  
com’
B
 
Zoe:
  
com
Z
block  354
 
(commitment to balances)
 
open of 
com
A
A 
 B:  2 ETH
 
(zk)
2
-Rollup
 
Problem:   Rollup server sees identity of payer and payee
 
Better data structure enables fully private Tx
 
 
… can even run DAPPs privately  (e.g.,  
ZEXE
)
 
 
General discussion
 
Discussion Topics
 
Open problems in blockchains
The future of blockchains and crypto currencies
Where is this headed?
A career in blockchains?
Where can I learn more?
EE374
: Scaling blockchains (Winter 2021)
CS255
 and 
CS355
:  Cryptography
Stanford blockchain conference (SBC)
 
 
Fun crypto tricks
BLS signatures
 
Signatures make up
most of Tx data.
Can we compress
signatures?
Yes:  aggregation!
not possible for ECDSA
 
BLS Signatures
 
Used in modern blockchains:   Ehtereum 2.0,  Dfinity,  Chia,  etc.
 
The setup:
 
G = {1, g, …, g
q-1
}  a cyclic group of prime order q
 
H: M 
×
 G 
 G    a hash function    (e.g., based on SHA256)
BLS Signatures
How does verify work?
verify test
Properties:  signature aggregation  
[BGLS’03]
Anyone
 can compress  n  signatures into 
one
pk
1
  ,  m
1
  
  
σ
1
      
pk
n
  ,  m
n
  
  
σ
n
      
 
σ
*
Aggregation:  how
 
Verifying an aggregate signature:   
(incomplete)
user 1:   pk
1
 = g
α
1
 ,   m
1
   
    
σ
1
=H(m
1
,pk
1
)
α
1
user n:   pk
n
 = g
α
n
 ,   m
n
   
    
σ
n
=H(m
n
,pk
n
)
α
n
Compressing the blockchain with BLS
inputs
outputs
sig
sig
 
s
i
g
sig
sig
Tx1:
Tx2:
Tx3:
Tx4:
one Bitcoin block
 
if needed
:
 
compress all
 
signatures in a block
 
into a single
 
aggregate signatures
  shrink block
or:  aggregate in smaller
batches
sig*
 
 
Reducing Miner State
 
UTXO set size
 
≈70M UTXOs
 
Miners need to keep all UTXOs in memory to validate Txs
Can we do better?
Recall:  polynomial commitments
 
Homomorphic polynomial commitment
Committing to a set  (of UTXOs)
 
(accumulator)
How does this help?
Miners maintain two commitments:
 
(i)
 
commitment to set T of all UTXOs
 
(ii)
 
commitment to set S of spent TXOs
≤ 1KB
com
T
,  com
S
 
Tx processing
:   miners check eval proofs, and if valid,
 
add inputs to set S and outputs to set T.       That’s it!
Does this work ??
Is this practical?
 
Not quite …
Problem:
 
the factory’s work per proof is 
linear
 in the
 
number of UTXOs ever created
Many
 variations on this design:
can reduce factory’s work to  log
2
(# current UTXOs)  per proof
Factory’s memory is linear in (# current UTXOs)
 
End result:
  
outsource memory requirements to a
    
small number of 3
rd
 party service providers
 
 
Taproot:  semi-private
scripts in Bitcoin
 
Taproot is coming …
 
Script privacy
 
Currently:   Bitcoin scripts must be fully revealed in spending Tx
 
 
Can we keep the script secret?
 
Answer:  Yes, easily!     when all goes well …
How?
How?
The main point
 
Next lecture:  super cool final guest lecture
 
END  OF  LECTURE
Slide Note
Embed
Share

Privacy measures in cryptocurrency transactions were explored in CS251 Fall 2020, focusing on techniques like zkSNARKs and commitment schemes to conceal account balances and transaction data from Rollup servers. The session delved into advancements in privacy-preserving technologies for blockchain applications.

  • Cryptocurrency
  • Privacy
  • Innovation
  • CS251
  • Blockchain

Uploaded on Sep 26, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. CS251 Fall 2020 (cs251.stanford.edu) Final topics: Cute Crypto Tricks Dan Boneh

  2. Quick Recap: Rollup with privacy rollup server [A B: 2 ETH], ???? Layer 1 blockchain (e.g. Ethereum) atomic swap: [B Z: 1 ETH] [Z B: 2 BAT] ???? ???? root block 354 Merkle Tree Alice: 5 DAI 3 ETH Bob: 2 ETH Zoe: 1 ETH 3 BAT Tx

  3. Quick Recap: Rollup with privacy rollup server [A B: 2 ETH], ???? Layer 1 blockchain (e.g. Ethereum) atomic swap: [B Z: 1 ETH] [Z B: 2 BAT] ???? ???? new root block 354 block 357 Merkle Tree Alice: 5 DAI 1 ETH Bob: 3 ETH 2 BAT Zoe: 2 ETH 1 BAT Tx

  4. Privacy? The Rollup server sees: all account balances, and all transactions. Can we hide this from the Rollup server? Yes! Using zkSNARKs

  5. Replace balances with commitments (simplified) rollup server A B: 2 ETH Layer 1 blockchain (e.g. Ethereum) [ -com, SNARK], ???? root block 354 Merkle Tree open of comA Alice: comA Bob: comB Zoe: comZ Tx (commitment to balances)

  6. Replace balances with commitments (simplified) rollup server A B: 2 ETH Layer 1 blockchain (e.g. Ethereum) [ -com, SNARK], ???? new root block 354 block 357 Merkle Tree open of comA Alice: com A Bob: com B Zoe: comZ Tx (commitment to balances)

  7. Replace balances with commitments (simplified) rollup server A B: 2 ETH Layer 1 blockchain (e.g. Ethereum) [ -com, SNARK], ???? new root block 354 block 357 Merkle Tree open of comA Alice: com A Bob: com B Zoe: comZ Tx (commitment to balances)

  8. (zk)2-Rollup Problem: Rollup server sees identity of payer and payee Better data structure enables fully private Tx can even run DAPPs privately (e.g., ZEXE)

  9. General discussion

  10. Discussion Topics Open problems in blockchains The future of blockchains and crypto currencies Where is this headed? A career in blockchains? Where can I learn more? EE374: Scaling blockchains (Winter 2021) CS255 and CS355: Cryptography Stanford blockchain conference (SBC)

  11. Fun crypto tricks

  12. BLS signatures one Bitcoin block inputs sig outputs Signatures make up most of Tx data. sig sig Tx1: Tx2: sig sig sig sig Can we compress signatures? Yes: aggregation! not possible for ECDSA Tx3: sig sig sig sig sig Tx4:

  13. BLS Signatures Used in modern blockchains: Ehtereum 2.0, Dfinity, Chia, etc. The setup: G = {1, g, , gq-1} a cyclic group of prime order q H: M G G a hash function (e.g., based on SHA256)

  14. BLS Signatures KeyGen(): choose random ? in {1, ,?} output sk = ? , pk = ?? G Sign(sk, ?): output sig = ?(?,pk)? G Verify(pk, ?, sig): output accept if logg(pk) = logH(m,pk)(sig) Note: signature on ? is unique! (no malleability)

  15. How does verify work? A pairing: an efficiently computable function e:G G G such that e(??,??) = ?(?,?)?? for all ?,? {1, ?} and is not degenerate: ?(?,?) 1 verify test Observe: logg(pk) = logH(m,pk)(sig) if and only if e(g, sig) = e(pk, H(m,pk)) = = e(g, H(m,pk)?) = e(g?, H(m,pk))

  16. Properties: signature aggregation [BGLS03] Anyone can compress n signatures into one Verify( pk , m , *) = accept pk1 , m1 1 aggregate * convinces verifier that for i=1, ,n: user i signed msg mi pkn , mn n single short signature

  17. Aggregation: how user 1: pk1 = g 1 , m1 1=H(m1,pk1) 1 1 n user n: pkn = g n , mn n=H(mn,pkn) n Verifying an aggregate signature: (incomplete) i) e( , g) ? ?=1 e(H(mi,pki), g i, g) = e( i=1H(mi,pki) i, g) i=1 e(H(mi,pki)

  18. Compressing the blockchain with BLS one Bitcoin block if needed: compress all signatures in a block into a single aggregate signatures inputs sig outputs sig* sig sig Tx1: Tx2: sig sig sig sig shrink block Tx3: sig sig or: aggregate in smaller batches sig sig sig Tx4:

  19. Reducing Miner State

  20. UTXO set size 70M UTXOs Miners need to keep all UTXOs in memory to validate Txs Can we do better?

  21. Recall: polynomial commitments ( ?)? commit(pp, f, r) comf commitment to f ?? eval: goal: for a given comf and x, y ??, construct a SNARK to prove that f(x) = y.

  22. Homomorphic polynomial commitment A polynomial commitment is homomorphic if there are efficient algorithms such that: commit(pp, f1, r1) comf1commit(pp, f2, r2) comf2 Then: (i) for all ?,? ?? : comf1 , comf2 coma*f1+b*f2 comf1 comX*f1 (ii)

  23. Committing to a set (of UTXOs) (accumulator) Let ? = {?1, ,??} ?? be a set of UTXOs ( ?)? Define: ? ? = (? ?1) (? ??) ?? Set: comf = commit(??,?,?) short commitment to ? For ? ?? : ? ? if and only if ?(?) = 0 To add U to S: comf comX*f U*f short commitment to ? {?}

  24. How does this help? Miners maintain two commitments: (i) commitment to set T of all UTXOs (ii) commitment to set S of spent TXOs 1KB comT, comS Tx format: every input ? includes a proof (? ? && U ?) Two eval proofs: ?(?) = 0 && ?(?) 0(short) Tx processing: miners check eval proofs, and if valid, add inputs to set S and outputs to set T. That s it!

  25. Does this work ?? Problem: how does a user prove that her UTXO ? satisfies ?(?) = 0 && ?(?) 0 ??? This requires knowledge of the entire blockchain user needs large memory and compute time can be outsourced to an untrusted 3rd party UTXO ? , fee polynomials S and T proof ? spend ? The proof factory

  26. Is this practical? Not quite Problem: the factory s work per proof is linear in the number of UTXOs ever created Many variations on this design: can reduce factory s work to log2(# current UTXOs) per proof Factory s memory is linear in (# current UTXOs) End result: outsource memory requirements to a small number of 3rd party service providers

  27. Taproot: semi-private scripts in Bitcoin

  28. Taproot is coming

  29. Script privacy Currently: Bitcoin scripts must be fully revealed in spending Tx Can we keep the script secret? Answer: Yes, easily! when all goes well

  30. How? ECDSA and Schnorr public keys: KeyGen(): sk = ? , pk = ?? G for ? in {1, ,?} Suppose skA = ? , skB = ?. Alice and Bob can sign with respect to pk = ??? ???= ??+? an interactive protocol between Alice and Bob (note: much simpler with BLS) Alice & Bob can imply consent to Tx by signing with pk = ??+?

  31. How? S: Bitcoin script that must be satisfied to spend a UTXO ? S involves only Alice and Bob. Let ????= ??? ??? Goal: keep S secret when possible. How: modify S so that a signature with respect to pk = ???? ??(???? , ?) is sufficient to spend UTXO, without revealing S !!

  32. The main point If parties agree to spend UTXO, sign with respect to ???? and spend while keeping S secret If disagreement, Alice can reveal S and spend UTXO by proving that she can satisfy S. Taproot pk compactly supports both ways to spend the UTXO

  33. END OF LECTURE Next lecture: super cool final guest lecture

More Related Content

giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#giItT1WQy@!-/#