From 6d888a834443837db598d2d7739a1a010f1b9437 Mon Sep 17 00:00:00 2001 From: Kirk Haines Date: Tue, 5 Mar 2024 16:37:38 -0700 Subject: [PATCH] Switch the syntax highlighting to 'shell-session' on the zkevm page commands. (#36) --- content/module-2/4-topos-zkevm-demo.md | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/content/module-2/4-topos-zkevm-demo.md b/content/module-2/4-topos-zkevm-demo.md index ab5a994..f9236cf 100644 --- a/content/module-2/4-topos-zkevm-demo.md +++ b/content/module-2/4-topos-zkevm-demo.md @@ -30,7 +30,7 @@ Depending on your NodeJS environment and preferences, there are several ways to Our recommended way is to install the CLI using `npm`: - + ``` $ npm install -g @topos-protocol/topos-zkevm-demo ``` @@ -41,7 +41,7 @@ $ npm install -g @topos-protocol/topos-zkevm-demo If you are a `yarn` user, you can install the CLI using `yarn`: - + ``` $ yarn global add @topos-protocol/topos-zkevm-demo ``` @@ -52,7 +52,7 @@ $ yarn global add @topos-protocol/topos-zkevm-demo Alternatively, you can install and run via `npx`: - + ``` $ npx @topos-protocol/topos-zkevm-demo ``` @@ -78,7 +78,7 @@ Topos zkEVM Demo is built on top of two projects: Both of these will be installed for you. - + ``` $ topos-zkevm-demo install ``` @@ -97,7 +97,7 @@ $ topos-zkevm-demo install The demo utilizes Erigon, which is an implementation of Ethereum, to provide a local development chain. To start it, run: - + ``` $ topos-zkevm-demo start ``` @@ -114,7 +114,7 @@ Optionally, you can replace the contract and the script with your own. When you are ready to execute the demo script, run: - + ``` $ topos-zkevm-demo execute ``` @@ -124,7 +124,7 @@ The command will output whatever is logged in the demo script, which by default For example: - + ``` $ topos-zkevm-demo execute > demo @@ -168,7 +168,7 @@ Note: The merkle proof is based on a transaction's receipt instead of the transa Let's start by generating the merkle proof for your transaction. The `tx_hash` should be a transaction hash, such as the `Ketchup transaction` hash that was output by the `execute` command. - + ``` $ topos-zkevm-demo generate merkle-proof ``` @@ -176,7 +176,7 @@ $ topos-zkevm-demo generate merkle-proof For example: - + ``` $ topos-zkevm-demo generate merkle-proof 0x785102ca9881b284588452cd90685d2c713cf61f6e4f3fcc8451bb6f2a571130 node dist/main generate merkle-proof 0x785102ca9881b284588452cd90685d2c713cf61f6e4f3fcc8451bb6f2a571130 @@ -206,7 +206,7 @@ Note: When copying the merkle proof, make sure to copy the whole list. From the number of the block which includes your two transactions (reminder: the block number is output by the [execute](#3-execute-the-demo-script) command), you can generate a zk-proof of the block: - + ``` $ topos-zkevm-demo generate zk-proof ``` @@ -214,7 +214,7 @@ $ topos-zkevm-demo generate zk-proof For example: - + ``` $ topos-zkevm-demo generate zk-proof 4 Proving block 4... @@ -241,7 +241,7 @@ You will start by verifying the provided merkle proof. To do this, you will execute the following command: - + ``` $ topos-zkevm-demo verify merkle-proof ``` @@ -255,7 +255,7 @@ The `verify merkle-proof` command internally computes the right leaf for you, fr So, first thing first, you need to retrieve the receipt trie root: - + ``` $ topos-zkevm-demo util get-receipt-trie-root ``` @@ -263,7 +263,7 @@ $ topos-zkevm-demo util get-receipt-trie-root For example: - + ``` $ topos-zkevm-demo util get-receipt-trie-root 0x785102ca9881b284588452cd90685d2c713cf61f6e4f3fcc8451bb6f2a571130 > get-receipt-trie-root @@ -281,7 +281,7 @@ Now, you can verify the merkle proof. For example: - + ``` $ topos-zkevm-demo verify merkle-proof 0x785102ca9881b284588452cd90685d2c713cf61f6e4f3fcc8451bb6f2a571130 0xf851a02d247ca1770e3221e8aecf9d04fc9b6f7ff07361715c71ef8703bf24c7905d4580808080808080a0cfa9df4025f175e0c4338efc950dc2e30214a08e8ba6940226a97fd977b156b08080808080808080,0xf9011130b9010d02f90109018301155cb9010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0 0x11ef2192f0c9aa092d69b9acf82085f384f172188cc321da94566dc9d33a3b18 Verifying merkle-proof for transaction: 0x785102ca9881b284588452cd90685d2c713cf61f6e4f3fcc8451bb6f2a571130 @@ -304,7 +304,7 @@ Verifying merkle-proof for transaction: 0x785102ca9881b284588452cd90685d2c713cf6 Now that you have verified that the provided transaction is indeed part of a state transition (a block), you can verify that it is valid by verifying the block's zk-proof: - + ``` $ topos-zkevm-demo verify zk-proof ``` @@ -312,7 +312,7 @@ $ topos-zkevm-demo verify zk-proof For example: - + ``` $ topos-zkevm-demo verify zk-proof DEMO_ROOT/topos-zkevm-demo/zero-bin/proofs/b00004.zkproof Verifying zk-proof: DEMO_ROOT/topos-zkevm-demo/zero-bin/proofs/b00004.zkproof