Skip to content

Suggest a tutorial: Using zero-knowledge for a secret state #13234

Closed
@qbzzt

Description

@qbzzt

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

  1. Why do this? Why do games need a secret state?
  2. How can we trust it? Precommitments and zero-knowledge proofs.
  3. 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
  4. Design choice: should verification happen onchain or in the client?
  5. 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

Metadata

Metadata

Assignees

Labels

Status: StaleThis issue is stale because it has been open 30 days with no activity.content 🖋️This involves copy additions or editsfeature ✨This is enhancing something existing or creating something newproposal 🤔This is a proposalrequest for comments 🗣️A request for comments has been made; discussion and input is encouraged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions