SlideShare une entreprise Scribd logo
1  sur  35
Télécharger pour lire hors ligne
Zero Knowledge Proof:
What It Is and How It Works
Jim Zhang, Co-Founder, Head of Protocol
Kaleido
Agenda
Using Examples To Think About the Concept of “Zero Knowledge”
zkSNARK Construction
Application of ZKPs
Further Reading and Hands-on Tutorials
Who Is Jim?
Co-founder of Kaleido, Head of Protocol
Committer of Hyperledger FireFly FabConnect
Serves on the Hyperledger Technical Steering Committee
Used to be the lead architect of IBM Blockchain Platform and committer of
Hyperledger Fabric
Scenario #1: Where’s Waldo
Alice runs a booth in the state fair, showing a
large picture with thousands of people. If
someone finds it in under 10 seconds, there’s a
prize.
How does she convince Bob, who couldn’t
manage to find Waldo in time, that Waldo is really
in the picture?
Obviously she doesn’t want to simply point Bob to
Waldo in the picture, such that Bob can tell future
players and ruin her game.
Scenario #2: Sudoku puzzle has a solution
Alice: hey Bob, here’s a new Sudoku puzzle I
designed yesterday, would you like to try it?
Bob: I’m interested only if it really has a solution!
Scenario #3: I know the password
Alice: I’d like to access the database
Bob: tell me your password
“Zero Knowledge”
Alice wants to convince Bob of something
● Waldo is in the picture
● The Sudoku puzzle has a solution
● Alice is not an imposter
Bob should not learn “too much”
● Waldo’s location
● The Sudoku solution
● Alice’s password
Mike Rosulek (UIUC)
How To Convince Bob Waldo Is in the Map?
Alice Bob
How To Convince Bob Waldo Is in the Map?
Alice Bob
How To Convince Bob the Puzzle Has a Solution?
Step 1: Alice to hide the solution by using different numbers, 1->9, 7->8, 9->2,
etc.
Alice
How To Convince Bob the Puzzle Has a Solution?
Step 2: Alice then masks the solution, so it’s ready to be presented to Bob
Alice
How To Convince Bob the Puzzle Has a Solution?
Step 3: the masked solution is presented to Bob
Alice Bob
How To Convince Bob the Puzzle Has a Solution?
Step 4: Bob randomly picks a unit (row, column or 3x3 square) and asks Alice to
reveal the (mutated) solution; Bob verifies it for correctness
Alice Bob
How To Convince Bob the Puzzle Has a Solution?
Step 5: Alice permutes the solution again to get a different set of numbers (still
mapped from the original solution)
Alice Bob
How To Convince Bob the Puzzle Has a Solution?
Step 6: the new masked solution is presented to Bob
Alice Bob
How To Convince Bob the Puzzle Has a Solution?
Step 7: Bob randomly picks another unit and asks Alice to reveal the (mutated)
solution; Bob verifies it for correctness
Alice Bob
How To Convince Bob the Presented Solution Is For the
Right Puzzle?
Step 8: for any round, Bob could also ask for the original positions of the puzzle to be
disclosed. Seeing the scrambled numbers, Bob can be convinced that it’s properly
mapped from the original public positions
Alice Bob
5
4
8
9
2
2
3 4
7 6
2 6
9 3
7 5 8
How To Convince Bob the Puzzle Has a Solution?
Repeat the procedure (mutate -> mask -> pick unit) n times, if Alice gets it right
every time, Bob knows that the chance she achieved this by cheating without a
valid solution, is at most (27/28)n
. For n=200, the chance is ~ 0.05%
Alice Bob
The above protocol for Zero Knowledge Proof is
a probabilistic proof
…
Per the Computational Complexity Theory, the Sudoku puzzle is known to be in
the complexity class NP-Complete.
What this means is that, the protocol Alice designed above, can be used to solve
ANY problem in the NP class, by translating it into the Sudoku puzzle.
In practice, turning every problem into a Sudoku puzzle is too inefficient. So we
need to design the proof protocol around a different kind of puzzle in the
NP-Complete class.
Enter the world of large number factorization and logarithm maths.
Can The Previous Protocols Be Generalized?
Alice To Prove She Knows a Secret Key
A secret key in the world of cryptography is a large random number, a.
The corresponding public key is PK = ga
We know from math that:
- g(ac)
= (ga
)c
= PKc
- gm
. gk
= g(m+k)
Alice To Prove She Knows a Secret Key
Alice Bob
Using the same idea as how Alice proves to Bob she knows the Sudoku solution,
she asks Bob to pick a random large number c, so she can prove to Bob she
knows the secret a, without telling Bob what a is, by presenting s=ac+k.
Recall that: gs
= g(ac+k)
= (ga
)c
. gk
And that the public key PKA
= ga
is public knowledge
From Interactive to Non-Interactive
The above protocol requires both parties, Alice (prover), and Bob (verifier) to be
online and are able to interact with each other in real time.
In addition, Alice and Bob are not able to convince a 3rd party, Charlie, that the
proof based on the interactions b/w Alice and Bob have been conducted honestly.
That’s because Alice and Bob could have colluded, such that Bob tells Alice all the
“random” picks ahead of time, so Alice could come up with the right answer.
For a robust protocol, we need to make it work in non-interactive mode.
Converting to Non-Interactive
Bob’s role in the interactions is to pick the random challenge value c. What if we
replace Bob’s random number generator with a verifiable random number
generator function that Alice can run to produce c?
Alice could produce c as c = H(gk
|| M) where H() is a hash function, and M
is an (optional) and arbitrary message string
From Interactive to Non-Interactive
With the challenges generated by Alice herself, using a “random number
generator” (really called a random oracle) , she can present a proof directly to
Bob.
Alice Bob
proof
Time To Get Technical
We now look at one of the most popular zero knowledge proof schemes: SNARK
(succinct non-interactive argument of knowledge).
Given a function f(x), and public output y, using zkSNARK, one can generate a
proof to demonstrate the knowledge of a solution s, without revealing the value of
s.
Given: f(x) = y
Produce s, such as that f(s) = y
SNARK consumes the “code” of the function f(x) and public input y as input, and
produces the zk proof as the output.
Converting Functions into SNARK Circuits
Suppose our target function f(x) is a polynomial equation,
f(x) = x3
- x + 7 mod 13
Alice wants to generate a proof that she knows a solution to f(x) ≡ 12.
She first writes the function in Circom language (circuit compiler):
template FakeHash() {
signal private input x;
signal x_squared;
signal x_cubed;
signal output out;
x_squared <== x * x;
x_cubed <== x_squared * x;
out <== x_cubed - x + 7;
}
component main = FakeHash();
- Only 3 operations: +, -, *
- Only operated on elements in prime fields
How To Capture Performed Computations
Think of the circuit as a network of “gates” with two input wires and an output wire:
For (a+b)*(b*c):
a
b
c
+
x
x (a+b)*(b*c)
Using a Rank 1 Constraint System (R1CS), the computations can be captured in a
collection of vectors.
“Compress” The Verifier’s Task
Now that all the computations performed by the prover have been captured, the
verifier just need to check each of the steps in the computation.
But is it possible to make the verification faster? It’d be ideal to have a protocol
that’s easier to verify than to compute.
We can use another transformation with Quadratic Arithmetic Programs to turn
the result of the R1CS vectors into polynomial expressions.
P(x) = c0
+ c1
x1
+ c2
x2
+ … + cd
xd
Why Polynomials?
Two interesting properties about polynomials are useful:
- One expression can embed infinite amount of information
- The coefficients of a polynomial can represent arbitrary information
- Comparing the knowledge of the set of coefficients of a polynomial is easy
- Just plug in a few x values, if Alice is able to return the expected result, then she must know
the set of coefficients
Almost There
With the transformations so far, the problem becomes this:
- Alice needs to prove to Bob she knows a set of coefficients for a polynomial
P(x)
- Bob wants to use a secret value s to challenge Alice
- Alice must not know the value s, Bob must not know P(x)
Alice Bob
A few more steps involved to complete the protocol:
- Homomorphic Hiding
- Blind Evaluation of Polynomials
- Convert to non-interactive using a Common Reference String
obtained from a Trusted Setup
Usage of ZKPs
● Digital Signatures (eg. ECDSA) is essentially a zero knowledge proof
of the knowledge of the private key
Usage of ZKPs
● Hide transaction payloads in a blockchain
○ Alice sends Bob 10 fungible tokens, by executing the transaction privately and
sends a ZKP of the tx
○ All validators in the blockchain network can see the zkp, and verify that the
transaction has been executed honestly, without knowing the details of the
transaction
○ zCash, EY Nightfall confidential token
Usage of ZKPs
● Layer-2 Scaling Solutions
○ ZKP is great at compressing a large amount of computation into a small proof that
can be verified fast
○ zkSync, Loopring, StarkNet, Polygon Hermez, etc.
Usage of ZKPs
● Self-Sovereign Identities
○ Presenting a claim about “are you over 21 years old to be admitted into the bar?”
without disclosing the birth date, but by using a ZKP
Where to Learn More
Best learning websites with curated content:
- https://learn.0xparc.org/
Step-by-Step Explanation of SNARK (without skipping the math):
- https://electriccoin.co/blog/snark-explain/
101 Level hands-on tutorials:
- https://github.com/privacy-scaling-explorations/zkp-app-boilerplate
Circuit Compiler & Proof Generation:
- https://github.com/iden3/circom
- https://github.com/iden3/snarkjs

Contenu connexe

Tendances

Starkware: Account Abstraction
Starkware: Account AbstractionStarkware: Account Abstraction
Starkware: Account AbstractionTinaBregovi
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key ExchangeSAURABHDHAGE6
 
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...Clare Nelson, CISSP, CIPP-E
 
The Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmThe Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmJay Nagar
 
Basics of Zcash Cryptocurrency Protocol
Basics of Zcash Cryptocurrency Protocol Basics of Zcash Cryptocurrency Protocol
Basics of Zcash Cryptocurrency Protocol Vaideeswaran Sethuraman
 
A Zero-Knowledge Proof: Improving Privacy on a Blockchain
A Zero-Knowledge Proof:  Improving Privacy on a BlockchainA Zero-Knowledge Proof:  Improving Privacy on a Blockchain
A Zero-Knowledge Proof: Improving Privacy on a BlockchainAltoros
 
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...SSIMeetup
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.pptUday Meena
 
Hyperledger Fabric Technical Deep Dive 20190618
Hyperledger Fabric Technical Deep Dive 20190618Hyperledger Fabric Technical Deep Dive 20190618
Hyperledger Fabric Technical Deep Dive 20190618Arnaud Le Hors
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractThanh Nguyen
 
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...SSIMeetup
 
Decentralized Identifier (DIDs) fundamentals deep dive
Decentralized Identifier (DIDs) fundamentals deep diveDecentralized Identifier (DIDs) fundamentals deep dive
Decentralized Identifier (DIDs) fundamentals deep diveSSIMeetup
 
Blockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricBlockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricAraf Karsh Hamid
 
Blockchain Consensus Protocols
Blockchain Consensus ProtocolsBlockchain Consensus Protocols
Blockchain Consensus ProtocolsMelanie Swan
 

Tendances (20)

Starkware: Account Abstraction
Starkware: Account AbstractionStarkware: Account Abstraction
Starkware: Account Abstraction
 
Diffie Hellman Key Exchange
Diffie Hellman Key ExchangeDiffie Hellman Key Exchange
Diffie Hellman Key Exchange
 
SSL TLS Protocol
SSL TLS ProtocolSSL TLS Protocol
SSL TLS Protocol
 
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...
Privacy-Preserving Authentication, Another Reason to Care about Zero-Knowledg...
 
IPSec and VPN
IPSec and VPNIPSec and VPN
IPSec and VPN
 
The Diffie-Hellman Algorithm
The Diffie-Hellman AlgorithmThe Diffie-Hellman Algorithm
The Diffie-Hellman Algorithm
 
Basics of Zcash Cryptocurrency Protocol
Basics of Zcash Cryptocurrency Protocol Basics of Zcash Cryptocurrency Protocol
Basics of Zcash Cryptocurrency Protocol
 
A Zero-Knowledge Proof: Improving Privacy on a Blockchain
A Zero-Knowledge Proof:  Improving Privacy on a BlockchainA Zero-Knowledge Proof:  Improving Privacy on a Blockchain
A Zero-Knowledge Proof: Improving Privacy on a Blockchain
 
Cryptography - 101
Cryptography - 101Cryptography - 101
Cryptography - 101
 
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...
Decentralized Key Management (DKMS): An Essential Missing Piece of the SSI Pu...
 
Cryptography.ppt
Cryptography.pptCryptography.ppt
Cryptography.ppt
 
Hyperledger Fabric Technical Deep Dive 20190618
Hyperledger Fabric Technical Deep Dive 20190618Hyperledger Fabric Technical Deep Dive 20190618
Hyperledger Fabric Technical Deep Dive 20190618
 
Introduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart ContractIntroduction to Ethereum Blockchain & Smart Contract
Introduction to Ethereum Blockchain & Smart Contract
 
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...
Peer DIDs: a secure and scalable method for DIDs that’s entirely off-ledger –...
 
Caesar cipher
Caesar cipherCaesar cipher
Caesar cipher
 
Decentralized Identifier (DIDs) fundamentals deep dive
Decentralized Identifier (DIDs) fundamentals deep diveDecentralized Identifier (DIDs) fundamentals deep dive
Decentralized Identifier (DIDs) fundamentals deep dive
 
Blockchain - HyperLedger Fabric
Blockchain - HyperLedger FabricBlockchain - HyperLedger Fabric
Blockchain - HyperLedger Fabric
 
Hyperledger Fabric
Hyperledger FabricHyperledger Fabric
Hyperledger Fabric
 
Blockchain Consensus Protocols
Blockchain Consensus ProtocolsBlockchain Consensus Protocols
Blockchain Consensus Protocols
 
Internet Key Exchange Protocol
Internet Key Exchange ProtocolInternet Key Exchange Protocol
Internet Key Exchange Protocol
 

Similaire à Zero Knowledge Proofs: What they are and how they work

Demystifying Zero Knowledge Proofs [FINAL].pptx
Demystifying Zero Knowledge Proofs [FINAL].pptxDemystifying Zero Knowledge Proofs [FINAL].pptx
Demystifying Zero Knowledge Proofs [FINAL].pptxRedWhite12
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptographywtyru1989
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.pptMIBrand
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.pptShounakDas16
 
Cryptography by Epul
Cryptography by EpulCryptography by Epul
Cryptography by EpulAgate Studio
 
Cryptography-Diffie Hellman Key Exchange Algorithm.pptx
Cryptography-Diffie Hellman Key Exchange Algorithm.pptxCryptography-Diffie Hellman Key Exchange Algorithm.pptx
Cryptography-Diffie Hellman Key Exchange Algorithm.pptxssuser7e0a0e
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computersSpeck&Tech
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithmSunita Kharayat
 
Explanation methods for Artificial Intelligence Models
Explanation methods for Artificial Intelligence ModelsExplanation methods for Artificial Intelligence Models
Explanation methods for Artificial Intelligence ModelsDeep Learning Italia
 
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...44CON
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptographydrewz lin
 

Similaire à Zero Knowledge Proofs: What they are and how they work (20)

public-key cryptography Shamir
public-key cryptography Shamirpublic-key cryptography Shamir
public-key cryptography Shamir
 
Demystifying Zero Knowledge Proofs [FINAL].pptx
Demystifying Zero Knowledge Proofs [FINAL].pptxDemystifying Zero Knowledge Proofs [FINAL].pptx
Demystifying Zero Knowledge Proofs [FINAL].pptx
 
The security of quantum cryptography
The security of quantum cryptographyThe security of quantum cryptography
The security of quantum cryptography
 
Crypto2
Crypto2Crypto2
Crypto2
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
 
CS283-PublicKey.ppt
CS283-PublicKey.pptCS283-PublicKey.ppt
CS283-PublicKey.ppt
 
Cryptography
CryptographyCryptography
Cryptography
 
Cryptography by Epul
Cryptography by EpulCryptography by Epul
Cryptography by Epul
 
Cryptography-Diffie Hellman Key Exchange Algorithm.pptx
Cryptography-Diffie Hellman Key Exchange Algorithm.pptxCryptography-Diffie Hellman Key Exchange Algorithm.pptx
Cryptography-Diffie Hellman Key Exchange Algorithm.pptx
 
1329 n 9460
1329 n 94601329 n 9460
1329 n 9460
 
Privacy in the era of quantum computers
Privacy in the era of quantum computersPrivacy in the era of quantum computers
Privacy in the era of quantum computers
 
Rsa example
Rsa exampleRsa example
Rsa example
 
Diffie hellman key exchange algorithm
Diffie hellman key exchange algorithmDiffie hellman key exchange algorithm
Diffie hellman key exchange algorithm
 
Explanation methods for Artificial Intelligence Models
Explanation methods for Artificial Intelligence ModelsExplanation methods for Artificial Intelligence Models
Explanation methods for Artificial Intelligence Models
 
DH-Attack
DH-AttackDH-Attack
DH-Attack
 
DH-Attack
DH-AttackDH-Attack
DH-Attack
 
Bit commitment
Bit commitmentBit commitment
Bit commitment
 
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
How to Explain Post-Quantum Cryptography to a Middle School Student - Klaus S...
 
13
1313
13
 
13 asymmetric key cryptography
13   asymmetric key cryptography13   asymmetric key cryptography
13 asymmetric key cryptography
 

Plus de All Things Open

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityAll Things Open
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best PracticesAll Things Open
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public PolicyAll Things Open
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...All Things Open
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashAll Things Open
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptAll Things Open
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?All Things Open
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractAll Things Open
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlowAll Things Open
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and SuccessAll Things Open
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with BackgroundAll Things Open
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblyAll Things Open
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksAll Things Open
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptAll Things Open
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramAll Things Open
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceAll Things Open
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamAll Things Open
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in controlAll Things Open
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsAll Things Open
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...All Things Open
 

Plus de All Things Open (20)

Building Reliability - The Realities of Observability
Building Reliability - The Realities of ObservabilityBuilding Reliability - The Realities of Observability
Building Reliability - The Realities of Observability
 
Modern Database Best Practices
Modern Database Best PracticesModern Database Best Practices
Modern Database Best Practices
 
Open Source and Public Policy
Open Source and Public PolicyOpen Source and Public Policy
Open Source and Public Policy
 
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
Weaving Microservices into a Unified GraphQL Schema with graph-quilt - Ashpak...
 
The State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil NashThe State of Passwordless Auth on the Web - Phil Nash
The State of Passwordless Auth on the Web - Phil Nash
 
Total ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScriptTotal ReDoS: The dangers of regex in JavaScript
Total ReDoS: The dangers of regex in JavaScript
 
What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?What Does Real World Mass Adoption of Decentralized Tech Look Like?
What Does Real World Mass Adoption of Decentralized Tech Look Like?
 
How to Write & Deploy a Smart Contract
How to Write & Deploy a Smart ContractHow to Write & Deploy a Smart Contract
How to Write & Deploy a Smart Contract
 
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
Spinning Your Drones with Cadence Workflows, Apache Kafka and TensorFlow
 
DEI Challenges and Success
DEI Challenges and SuccessDEI Challenges and Success
DEI Challenges and Success
 
Scaling Web Applications with Background
Scaling Web Applications with BackgroundScaling Web Applications with Background
Scaling Web Applications with Background
 
Supercharging tutorials with WebAssembly
Supercharging tutorials with WebAssemblySupercharging tutorials with WebAssembly
Supercharging tutorials with WebAssembly
 
Using SQL to Find Needles in Haystacks
Using SQL to Find Needles in HaystacksUsing SQL to Find Needles in Haystacks
Using SQL to Find Needles in Haystacks
 
Configuration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit InterceptConfiguration Security as a Game of Pursuit Intercept
Configuration Security as a Game of Pursuit Intercept
 
Scaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship ProgramScaling an Open Source Sponsorship Program
Scaling an Open Source Sponsorship Program
 
Build Developer Experience Teams for Open Source
Build Developer Experience Teams for Open SourceBuild Developer Experience Teams for Open Source
Build Developer Experience Teams for Open Source
 
Deploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache BeamDeploying Models at Scale with Apache Beam
Deploying Models at Scale with Apache Beam
 
Sudo – Giving access while staying in control
Sudo – Giving access while staying in controlSudo – Giving access while staying in control
Sudo – Giving access while staying in control
 
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML ApplicationsFortifying the Future: Tackling Security Challenges in AI/ML Applications
Fortifying the Future: Tackling Security Challenges in AI/ML Applications
 
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
Securing Cloud Resources Deployed with Control Planes on Kubernetes using Gov...
 

Dernier

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 

Dernier (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Zero Knowledge Proofs: What they are and how they work

  • 1. Zero Knowledge Proof: What It Is and How It Works Jim Zhang, Co-Founder, Head of Protocol Kaleido
  • 2. Agenda Using Examples To Think About the Concept of “Zero Knowledge” zkSNARK Construction Application of ZKPs Further Reading and Hands-on Tutorials
  • 3. Who Is Jim? Co-founder of Kaleido, Head of Protocol Committer of Hyperledger FireFly FabConnect Serves on the Hyperledger Technical Steering Committee Used to be the lead architect of IBM Blockchain Platform and committer of Hyperledger Fabric
  • 4. Scenario #1: Where’s Waldo Alice runs a booth in the state fair, showing a large picture with thousands of people. If someone finds it in under 10 seconds, there’s a prize. How does she convince Bob, who couldn’t manage to find Waldo in time, that Waldo is really in the picture? Obviously she doesn’t want to simply point Bob to Waldo in the picture, such that Bob can tell future players and ruin her game.
  • 5. Scenario #2: Sudoku puzzle has a solution Alice: hey Bob, here’s a new Sudoku puzzle I designed yesterday, would you like to try it? Bob: I’m interested only if it really has a solution!
  • 6. Scenario #3: I know the password Alice: I’d like to access the database Bob: tell me your password
  • 7. “Zero Knowledge” Alice wants to convince Bob of something ● Waldo is in the picture ● The Sudoku puzzle has a solution ● Alice is not an imposter Bob should not learn “too much” ● Waldo’s location ● The Sudoku solution ● Alice’s password Mike Rosulek (UIUC)
  • 8. How To Convince Bob Waldo Is in the Map? Alice Bob
  • 9. How To Convince Bob Waldo Is in the Map? Alice Bob
  • 10. How To Convince Bob the Puzzle Has a Solution? Step 1: Alice to hide the solution by using different numbers, 1->9, 7->8, 9->2, etc. Alice
  • 11. How To Convince Bob the Puzzle Has a Solution? Step 2: Alice then masks the solution, so it’s ready to be presented to Bob Alice
  • 12. How To Convince Bob the Puzzle Has a Solution? Step 3: the masked solution is presented to Bob Alice Bob
  • 13. How To Convince Bob the Puzzle Has a Solution? Step 4: Bob randomly picks a unit (row, column or 3x3 square) and asks Alice to reveal the (mutated) solution; Bob verifies it for correctness Alice Bob
  • 14. How To Convince Bob the Puzzle Has a Solution? Step 5: Alice permutes the solution again to get a different set of numbers (still mapped from the original solution) Alice Bob
  • 15. How To Convince Bob the Puzzle Has a Solution? Step 6: the new masked solution is presented to Bob Alice Bob
  • 16. How To Convince Bob the Puzzle Has a Solution? Step 7: Bob randomly picks another unit and asks Alice to reveal the (mutated) solution; Bob verifies it for correctness Alice Bob
  • 17. How To Convince Bob the Presented Solution Is For the Right Puzzle? Step 8: for any round, Bob could also ask for the original positions of the puzzle to be disclosed. Seeing the scrambled numbers, Bob can be convinced that it’s properly mapped from the original public positions Alice Bob 5 4 8 9 2 2 3 4 7 6 2 6 9 3 7 5 8
  • 18. How To Convince Bob the Puzzle Has a Solution? Repeat the procedure (mutate -> mask -> pick unit) n times, if Alice gets it right every time, Bob knows that the chance she achieved this by cheating without a valid solution, is at most (27/28)n . For n=200, the chance is ~ 0.05% Alice Bob The above protocol for Zero Knowledge Proof is a probabilistic proof …
  • 19. Per the Computational Complexity Theory, the Sudoku puzzle is known to be in the complexity class NP-Complete. What this means is that, the protocol Alice designed above, can be used to solve ANY problem in the NP class, by translating it into the Sudoku puzzle. In practice, turning every problem into a Sudoku puzzle is too inefficient. So we need to design the proof protocol around a different kind of puzzle in the NP-Complete class. Enter the world of large number factorization and logarithm maths. Can The Previous Protocols Be Generalized?
  • 20. Alice To Prove She Knows a Secret Key A secret key in the world of cryptography is a large random number, a. The corresponding public key is PK = ga We know from math that: - g(ac) = (ga )c = PKc - gm . gk = g(m+k)
  • 21. Alice To Prove She Knows a Secret Key Alice Bob Using the same idea as how Alice proves to Bob she knows the Sudoku solution, she asks Bob to pick a random large number c, so she can prove to Bob she knows the secret a, without telling Bob what a is, by presenting s=ac+k. Recall that: gs = g(ac+k) = (ga )c . gk And that the public key PKA = ga is public knowledge
  • 22. From Interactive to Non-Interactive The above protocol requires both parties, Alice (prover), and Bob (verifier) to be online and are able to interact with each other in real time. In addition, Alice and Bob are not able to convince a 3rd party, Charlie, that the proof based on the interactions b/w Alice and Bob have been conducted honestly. That’s because Alice and Bob could have colluded, such that Bob tells Alice all the “random” picks ahead of time, so Alice could come up with the right answer. For a robust protocol, we need to make it work in non-interactive mode.
  • 23. Converting to Non-Interactive Bob’s role in the interactions is to pick the random challenge value c. What if we replace Bob’s random number generator with a verifiable random number generator function that Alice can run to produce c? Alice could produce c as c = H(gk || M) where H() is a hash function, and M is an (optional) and arbitrary message string
  • 24. From Interactive to Non-Interactive With the challenges generated by Alice herself, using a “random number generator” (really called a random oracle) , she can present a proof directly to Bob. Alice Bob proof
  • 25. Time To Get Technical We now look at one of the most popular zero knowledge proof schemes: SNARK (succinct non-interactive argument of knowledge). Given a function f(x), and public output y, using zkSNARK, one can generate a proof to demonstrate the knowledge of a solution s, without revealing the value of s. Given: f(x) = y Produce s, such as that f(s) = y SNARK consumes the “code” of the function f(x) and public input y as input, and produces the zk proof as the output.
  • 26. Converting Functions into SNARK Circuits Suppose our target function f(x) is a polynomial equation, f(x) = x3 - x + 7 mod 13 Alice wants to generate a proof that she knows a solution to f(x) ≡ 12. She first writes the function in Circom language (circuit compiler): template FakeHash() { signal private input x; signal x_squared; signal x_cubed; signal output out; x_squared <== x * x; x_cubed <== x_squared * x; out <== x_cubed - x + 7; } component main = FakeHash(); - Only 3 operations: +, -, * - Only operated on elements in prime fields
  • 27. How To Capture Performed Computations Think of the circuit as a network of “gates” with two input wires and an output wire: For (a+b)*(b*c): a b c + x x (a+b)*(b*c) Using a Rank 1 Constraint System (R1CS), the computations can be captured in a collection of vectors.
  • 28. “Compress” The Verifier’s Task Now that all the computations performed by the prover have been captured, the verifier just need to check each of the steps in the computation. But is it possible to make the verification faster? It’d be ideal to have a protocol that’s easier to verify than to compute. We can use another transformation with Quadratic Arithmetic Programs to turn the result of the R1CS vectors into polynomial expressions. P(x) = c0 + c1 x1 + c2 x2 + … + cd xd
  • 29. Why Polynomials? Two interesting properties about polynomials are useful: - One expression can embed infinite amount of information - The coefficients of a polynomial can represent arbitrary information - Comparing the knowledge of the set of coefficients of a polynomial is easy - Just plug in a few x values, if Alice is able to return the expected result, then she must know the set of coefficients
  • 30. Almost There With the transformations so far, the problem becomes this: - Alice needs to prove to Bob she knows a set of coefficients for a polynomial P(x) - Bob wants to use a secret value s to challenge Alice - Alice must not know the value s, Bob must not know P(x) Alice Bob A few more steps involved to complete the protocol: - Homomorphic Hiding - Blind Evaluation of Polynomials - Convert to non-interactive using a Common Reference String obtained from a Trusted Setup
  • 31. Usage of ZKPs ● Digital Signatures (eg. ECDSA) is essentially a zero knowledge proof of the knowledge of the private key
  • 32. Usage of ZKPs ● Hide transaction payloads in a blockchain ○ Alice sends Bob 10 fungible tokens, by executing the transaction privately and sends a ZKP of the tx ○ All validators in the blockchain network can see the zkp, and verify that the transaction has been executed honestly, without knowing the details of the transaction ○ zCash, EY Nightfall confidential token
  • 33. Usage of ZKPs ● Layer-2 Scaling Solutions ○ ZKP is great at compressing a large amount of computation into a small proof that can be verified fast ○ zkSync, Loopring, StarkNet, Polygon Hermez, etc.
  • 34. Usage of ZKPs ● Self-Sovereign Identities ○ Presenting a claim about “are you over 21 years old to be admitted into the bar?” without disclosing the birth date, but by using a ZKP
  • 35. Where to Learn More Best learning websites with curated content: - https://learn.0xparc.org/ Step-by-Step Explanation of SNARK (without skipping the math): - https://electriccoin.co/blog/snark-explain/ 101 Level hands-on tutorials: - https://github.com/privacy-scaling-explorations/zkp-app-boilerplate Circuit Compiler & Proof Generation: - https://github.com/iden3/circom - https://github.com/iden3/snarkjs