Closed
Description
Tutorial title
Using zero-knowledge for a secret state
Tutorial description
Onchain games are limited because they cannot keep any hidden information. After reading this tutorial, a reader will be able to combine zero-knowledge proofs and server components (see #13228) to create verifiable games with a secret state, offchain, component.
The technique to do this will be demonstrated by creating a minesweeper game.
Tutorial tags
server, offchain, centralized, zero-knowledge
Skill level
Intermediate
Hosted on ethereum.org or hosted elsewhere?
Hosted on ethereum.org
For tutorials to be hosted on Ethereum.org: Tutorial Content
- Why do this? Why do games need a secret state?
- How can we trust it? Precommitments and zero-knowledge proofs.
- Minesweeper, a complete example.
- The server
- Reporting the hash of a randomly generated map.
- Reporting a move's results.
- The zero-knowledge component, using Cairo or Zokrates to prove that a map with hash H has n mines around location (x,y).
- The onchain component
- Relaying moves
- Verifying zero-knowledge proofs
- Relaying results
- The client
- How it works
- The server
- Design choice: should verification happen onchain or in the client?
- Conclusion: when is this the appropriate technique?
For tutorials hosted elsewhere: URL to tutorial
No response
Would you like to work on this issue?
- Yes
- No