Skip to content

Tutorial: Write your own app-specific zero knowledge plasma #16078

@qbzzt

Description

@qbzzt

Tutorial title

Write your own app-specific zero knowledge plasma

Tutorial description

In this tutorial, we build a semi-secret bank for deposits. The bank is a centralized component; it knows the balance of each user. However, this information is not stored onchain. Instead, the bank posts a hash of the state. Every time there is a transaction, the bank posts the new hash, along with a zero-knowledge proof that it has a (signed) transaction that changes the hash state to the new one.

Deposits are automatically detected by the bank (looking at Transfer events). Withdrawals use a zero-knowledge proof that includes not just the new state, but also the amount and destination to send.

After reading this tutorial, you will understand not just how to use zero knowledge proofs, but also why you use them and how to do so securely.

Tutorial tags

Zero-Knowledge, Server, Offchain

Skill level

Advanced

Hosted on ethereum.org or hosted elsewhere?

Hosted on ethereum.org

For tutorials to be hosted on Ethereum.org: Tutorial Content

  1. Introduction
  2. Design
    2.1. Components
    2.2. Data and control flows
    2.2.1. Intrabank transfers (remember that the bank also needs to issue a receipt to the transactor that proves the hash change is due to that particular transaction).
    2.2.2. Deposits
    2.2.3. Withdrawals
  3. Implementation
    3.1. Zero knowledge flows (Noir or Zokrates, I'm not sure yet)
    3.2. Server and client-side code
    3.3. Smart contracts
  4. Abusing this system (as the bank)
    4.1. Integrity is easy, availability is hard, confidentiality is impossible
    4.2. Posting transactions on Ethereum (and how the bank can ignore that)
    4.3. Availability bonds (and how the bank can withdraw them)
    4.4. Better privacy with correspondent banks.
  5. Conclusion

For tutorials hosted elsewhere: URL to tutorial

No response

Would you like to work on this issue?

  • Yes
  • No

Metadata

Metadata

Assignees

Labels

content 🖋️This involves copy additions or editsfeature ✨This is enhancing something existing or creating something new

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions