diff --git a/content/SUMMARY.md b/content/SUMMARY.md index 031f410..f5abbab 100644 --- a/content/SUMMARY.md +++ b/content/SUMMARY.md @@ -7,9 +7,12 @@ --- - [RISC Zero](./risc-zero/index.md) - - [πŸ—ƒοΈ Zypher Games Buildathon - June 2024](./risc-zero/zypher-buildathon/materials.md) + - [πŸ—ƒοΈ Zypher Games Buildathon - Online - June 2024](./risc-zero/zypher-buildathon/materials.md) - [πŸͺ§ Verifiable Games Using RISC Zero](./risc-zero/zypher-buildathon/presentation.md) - [πŸ‘· ZK Chess Checkmate](./risc-zero/zypher-buildathon/workshop.md) + - [πŸ—ƒοΈ LmabdaClass Hackathon - Brussels - June 2024](./risc-zero/lambdaclass-ethcc-brussels/materials.md) + - [πŸͺ§ No Circuits Required - Building ZK Proof Systems in Pure Rust](./risc-zero/lambdaclass-ethcc-brussels/presentation.md) + - [πŸ‘· ZK ERC20 Balance of EDCSA Verified Account](./risc-zero/lambdaclass-ethcc-brussels/workshop.md) - [πŸ™‹ Contribute](./contribute/index.md) - [πŸŒ€ Topic Template](./contribute/template/page.md) diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/img/r0_link_ethcc.svg b/content/risc-zero/lambdaclass-ethcc-brussels/img/r0_link_ethcc.svg new file mode 100644 index 0000000..75f7b1a --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/img/r0_link_ethcc.svg @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + RISC Zero + @ ETHCC + + \ No newline at end of file diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/img/risc0-ethereum-bonsai.png b/content/risc-zero/lambdaclass-ethcc-brussels/img/risc0-ethereum-bonsai.png new file mode 120000 index 0000000..ac6756a --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/img/risc0-ethereum-bonsai.png @@ -0,0 +1 @@ +../../zypher-buildathon/img/risc0-ethereum-bonsai.png \ No newline at end of file diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/img/steel-banner.png b/content/risc-zero/lambdaclass-ethcc-brussels/img/steel-banner.png new file mode 100644 index 0000000..8bc8236 Binary files /dev/null and b/content/risc-zero/lambdaclass-ethcc-brussels/img/steel-banner.png differ diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/img/zkVM-diagram-black.png b/content/risc-zero/lambdaclass-ethcc-brussels/img/zkVM-diagram-black.png new file mode 120000 index 0000000..dff1eb6 --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/img/zkVM-diagram-black.png @@ -0,0 +1 @@ +../../zypher-buildathon/img/zkVM-diagram-black.png \ No newline at end of file diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/materials.md b/content/risc-zero/lambdaclass-ethcc-brussels/materials.md new file mode 100644 index 0000000..c4ef0c5 --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/materials.md @@ -0,0 +1,19 @@ +# LambdaClass Hackathon - ETHCC Brussels + +## πŸ“ Hackathon Specific Info + +- DoraHacks Event Page (APPLY HERE) +- RISC Zero Bounty Info +- LambdaClass Homepage +- RISC Zero [πŸͺ§ Presentation (Video & Sides)](./presentation.md) +- RISC Zero [πŸ‘· Workshop (Signing and STEELing)](./workshop.md) + +## 🀩 More @ ETHCC from RISC Zero + +### πŸ‘‰ https://r0.link/ethcc πŸ‘ˆ + +This cheatsheet tells you: + +- The who, what, when, where, for events at ETHCC 2024 πŸ‡§πŸ‡ͺ +- Links to join our socials +- Perhaps a little alpha πŸ˜‰ diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/presentation.md b/content/risc-zero/lambdaclass-ethcc-brussels/presentation.md new file mode 100644 index 0000000..b9dad4d --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/presentation.md @@ -0,0 +1,14 @@ +# No Circuits Required - Building ZK Proof Systems in Pure Rust + + +
+ +
+ How to use the slides - + Full screen (new tab) +
+ + +
Slides Content
+{{#include slides.md}} + diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/slides.md b/content/risc-zero/lambdaclass-ethcc-brussels/slides.md new file mode 100644 index 0000000..bb96738 --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/slides.md @@ -0,0 +1,257 @@ +--- +title: No Circuits Required - Building ZK Proof Systems in Pure Rust +tags: RISC Zero, Talk, Presentation, Workshop, zkVM, Steel, EVM, LambdaClass, Hackathon, Zero Knowledge Proof, Applied Cryptography, Rust, ETHCC, Brussels +duration: 60 minuets +description: RISC Zero Workshop for the Zypher Provable Games Buildathon - June 2024 +date: 2024-06-01 +# +# RevealJS Settings +# +# Add custom css files for your slides here, comma separated: +separator: "\r?\n---\r?\n" +verticalSeparator: "\r?\n---v\r?\n" +# Below can be any of these: https://revealjs.com/config/ +revealOptions: + transition: "convex" # animation between slides = none/fade/slide/convex/concave/zoom + backgroundTransition: "none" # background swap between slides = none/fade/slide/convex/concave/zoom + slideNumber: true + controls: true + progress: true +--- + + + +
+ +# No Circuits Required + +## Building ZK Proof Systems in _Pure Rust_ + +Event Materials ↗️ + +--- + +## Why RISC Zero? + +### _Write Rust πŸ¦€
Not Circuits π›Œ_ + +Notes: + +### Story time! + +Started in self-sovereign tech rabbit whole 2018 ETHDenver. +Mesh networks, local first, DAOs and co-ops, token engineering... +Then I found out about ZKPs and what they can do to fundamentally change the game and enable things that were impossible before. +As an fanboi of the ZK Podcast for years, I wanted so much to get in... but there was a problem: learning curve on cryptography. +I want to build cryptographic systems, but not need to deeply understand the moon math... +Enter zkVMs: RISC Zero. +Now we can all make ZKPs with only a strong conceptual grasp of constraint systems and Rust (more languages to come!) + +--- + +## Why RISC Zero? + +- **Verifiable Computation**: outsource-able +- **Highly Scalable**: low-cost verification +- **Tunable Privacy**: robust & universal\* + +Notes: + +- you can verify that a computation of a specific program ran exactly as it should, even if done by untrusted executor! +- _Prover_ that runs program & produces _receipt_ reveals as little as nothing to everything about execution to _verifier_. +- Verification is significantly cheaper than running computation yourself... at the cost of prover doing significantly more work to run the _zkVM_ +- \* Privacy is from everyone outside the prover, if you are the prover, no one but you has secret data. + +--- + +## What key web3 problems can ZK address? + + + + +### EVM Devs + +- **Referring to historical state** +- **Trusting off-chain logic** +- Calldata limits restrict logic +- Prohibitive gas costs +- Most blockchains lack privacy + + + + +### Layer <0|1|2|...> Devs + +- **True ZK (Privacy)** +- **Scalability (Compression)** +- **Interoperability (πŸŒ‰, rollups)** +- Proof composition (Recursion) +- Proof continuation (Boundless) + + + + +> See RISC Zero docs and blog for **lots** more + +Notes: + +- **ZK coprocessor** - run verifiable program logic in zkVM by 3rd party or yourself to untrusting parties +- Added **security** and **fairness** and **privacy** that zero knowledge proofs can provide, as they involve complex decision-making and competitive interactions. +- Privacy is optional, fully transparent games with ZKPs _can_ provided added guarantees around many things other than that (if carefully designed) + +--- + +## RISC Zero Bounties + +- 🀩 Best zkVM Application - _1,500 USD Up to 3x 500 USD_ +- 🀝 ZK Coprocessor - _1,000 USD Up to 2x 500 USD_ +- πŸ‘ͺ Integrations - _1,000 USD Up to 2x 500 USD_ + +> **Qualifications on [DoraHacks](https://dorahacks.io/hackathon/lambdahackweek2/bounties#risc-zero) πŸ‘€** + +Notes: + +--- + +## RISC Zero 101 + + + +> Read Getting Started and/or watch the playlist. + +Notes: + +- deeper understanding as exercise for views of this presentation. +- very happy to answer questions on our discord! + +--- + +## RISC Zero On-chain + + + +> Read about Blockchain Integration and watch the Foundry Template playlist. + +--- + +# ✨ Inspiration + +##### ⚠️ -- Do not copy 🍝 -- πŸ™ + +Notes: + +Plagiarism, missing attribution and violating licenses will disqualify you! +Building on them to something significantly enhancements _**may**_ be considered - please let us know what you are planning :grin: + +--- + +## zkSnake (R0 v0.20) + + + +#### zkSnake Source ↗️ + +Notes: + +- Winner of RISC Zero Coprocessor Bounty at ETHDenver 2024 and did well in community quadratic voting too! +- Idea: take it further and make a bevy app in wasm w/ webGPU with **shared core logic identical on web & "re-player" zkVM** + +--- + + + +Notes: + +Want to build even more complicated or otherwise impossible contract logic? +Enter Steel - view call library. + +--- + +# πŸ‘· Signing and Steeling Workshop + + + +**Join in following the [Hands-on instructions ↗️](./workshop.md)** + +--- + +## πŸŽ‡ What is special about RISC Zero? (1) + +- Developer productivity (@ hackathons & beyond) +
  Top 1000 crates.io tested nightly, +
  benchmarks and more: reports.risczero.com +- Hard in zkDSL, easy in zkVM: +
  Loops & branching +
  Design 👺 Implementation 👺 Auditing + +Notes: + +- Lots of ZKP options, why use R0? + - zkDSL _could_ be more performant, but time to market is very high, small set of humans can implement them at all. + - Why use us over other zkVMs? + First, arguably best devex, v1.0 release stability and prover performance milestones! + +--- + +## πŸŽ‡ What is special about RISC Zero? (2) + +- Proof continuation +
  Unbounded guest programs +- Proof composition +
  "Proof-ception" +
  Hybrid Client side {πŸ•΅οΈprivacy} & server {🦾power} +- Execution _separate_ from proof generation + +Notes: + +- Proof-ception = efficient verification of proofs within a guest. + - Privacy for small client side proofs and the bulk of proof computational overhead outsourced to an untrusted prover. + - Reuse of existing proofs included in new proof using their journal + - Batching/compression of many proofs + - Proof transposition for compatibility of specific verifiers. +- Execution is near zero overhead, proving is high overhead. + - Realtime exec & prove in parallel / after / remote is possible +- What killer features does R0 provide? + +--- + +## πŸŽ‡ What is special about RISC Zero? (3) + +### ⛓️ EVM Support + +- RISC Zero Foundry template +
  Write unbounded programs that are low cost to verify on any EVM chain +- Ethereum contracts, proof systems, and more +
  View call proofs with **Steel** +
  ZK Rollups & RollApps +
  ... Help us define more! + +Notes: + +- Zeth _could_ run existing solidity games off chain, optionally unbounded computation per block (gasless). [Zeth deep dive](https://www.youtube.com/watch?v=4pBmf839eOA) +- mention: 256 view call limit - could you do inclusion proof checkpoints? contract state is simply recursive proof of minimal thing needed (maybe block header / hash?) updated by anyone to use for deep archival view calls? prove "this state was in block X that is a child of recent block {younger than 256}" + +--- + +## 🀿 Before you dive deep... + +- You _must_ match versions of `cargo risczero` and your Cargo.toml deps +
  Some examples / templates may not be the version you need! +
  Bonsai (proving service) is 0.21, updating mid-July 2024 to 1.0 +- Keep guest minimal - extra cycles are _**expensive**_ +
  ...But this is a hackathon, don't stress too much! +- When experimenting, always use `DEV_MODE`! +
  Execution _only_ with mocked proving (fast!) +- Bonsai API key priority & support +
  Apply: bonsai.xyz/ +- 🧠 You are designing a cryptographic system, not just a game! +- Discord `#πŸ’»|support-forum` channel for help +
  Join: discord.gg/risczero + +--- + +# Further Reading & Resources + + + +## [r0.link/ethcc](https://r0.link/ethcc) diff --git a/content/risc-zero/lambdaclass-ethcc-brussels/workshop.md b/content/risc-zero/lambdaclass-ethcc-brussels/workshop.md new file mode 100644 index 0000000..a89fb21 --- /dev/null +++ b/content/risc-zero/lambdaclass-ethcc-brussels/workshop.md @@ -0,0 +1,33 @@ +## ZK ERC20 Balance of ECDSA Verified Account (R0 v1.0) + +### _Signing and Steeling_ + +Let's experiment with the powers provided by the [Steel library](https://github.com/risc0/risc0-ethereum/tree/main/steel) by taking the ERC20 example and extending it. +The base example only proves that some address holds a balance, with the essential proof being "Some address holds over 1 token at some ERC20 contract at the most recent block" +That isn't a particularly useful statement... let's constrain the proof a bit more to assert that the prover also holds the key to the account in question. + +> NOTE: The address and contract are optionally hidden to the verifier, so we can know the prover has a balance, but not DOX them! + +1. Watch this playlist to learn the basics of RISC Zero. +1. Use `rzup` to setup your development environment based on the **correct version of the RISC Zero Getting Started Docs** for you. + ```sh + # Get rzup + curl -L https://risczero.com/install | bash + # Follow command instructions to use rzup + # ... This will take a while first time! + ``` +1. TODO workshop repo will be up soonℒ️ + +## πŸ“ Key Takeaways + +- Use crates in the zkVM without modification - no need to rewrite in circuits or zkDSL! +- Use standard patterns like `println!` & `fmt!` normally for basic experiments and debugging in `DEV_MODE`. +- 10s on lines of code overall -> useful proof, easily extensible! +- There is still many risks of creating privacy and security faults via bugs and all the normal ways cryptographic systems can break down... + _**With zkVMs you are abstracting the math/circuits of zk... NOT the robust design and audits required to harden your system!**_ + +## πŸ€“ Taking it Further + +Here are some ideas to keep extending this example to learn more: + +- Soonℒ️ diff --git a/content/risc-zero/zypher-buildathon/materials.md b/content/risc-zero/zypher-buildathon/materials.md index 5354814..2a0bcba 100644 --- a/content/risc-zero/zypher-buildathon/materials.md +++ b/content/risc-zero/zypher-buildathon/materials.md @@ -2,7 +2,7 @@ ## πŸ“ Event Specific Info -- Dora Hacks Event Page (APPLY HERE) +- DoraHacks Event Page (APPLY HERE) - Event & RISC Zero Track Info - Zypher Homepage - RISC Zero [πŸͺ§ Presentation (Video & Sides)](./presentation.md) diff --git a/content/risc-zero/zypher-buildathon/slides.md b/content/risc-zero/zypher-buildathon/slides.md index ff7bb6c..f782674 100644 --- a/content/risc-zero/zypher-buildathon/slides.md +++ b/content/risc-zero/zypher-buildathon/slides.md @@ -1,6 +1,6 @@ --- title: Verifiable Games Using RISC Zero -tags: RISC Zero, Talk, Presentation, Workshop, zkVM, zkGames, Zypher, Hackathon, Buildathon, Zero Knowledge Proof, Applied Cryptography, Rust, Zypher +tags: RISC Zero, Talk, Presentation, Workshop, zkVM, zkGames, Hackathon, Buildathon, Zero Knowledge Proof, Applied Cryptography, Rust, Zypher duration: 60 minuets description: RISC Zero Workshop for the Zypher Provable Games Buildathon - June 2024 date: 2024-06-01 @@ -27,6 +27,8 @@ revealOptions: + + **_On-chain_ $~~~$ πŸ‘‰ $ZK$ πŸ‘ˆ $~~~$ _Off-chain_** Event Materials ↗️ @@ -247,7 +249,7 @@ Notes: - RISC Zero Foundry template
  Write unbounded programs that are low cost to verify on any EVM chain - Ethereum contracts, proof systems, and more -
  View call proofs with **Steel** +
  View call proofs with **STEEL**
  ZK Rollups & RollApps
  ... Help us define more!