--- tags: merge --- # Quick Merge Demo: Prysm x Catalyst interop *Last Updated: Mar 30, 2021* [TOC] ## Background This provides instructions on running beacon chain and eth1 chain using Prysm's interop mode. Beacon chain node (Prysm) inserts application payload into the eth1 chain node (Catalyst). Beacon chain validator produces application payload by requesting from eth1 node and signs over it. In this interop mode, participation is 100% and the chain should finalize at the start of epoch 4. ## Setup * Install Bazel * The cmake package * The git package installed * libssl-dev installed * libgmp-dev installed * libtinfo5 installed * Then, install [Bazel](https://docs.bazel.build/versions/master/install.html) * Prysm * Link: https://github.com/prysmaticlabs/prysm/tree/quick-merge-demo * Branch: `quick-merge-demo` * Commit: `91334408302e09097a143fc3032e1df8bfbc0166` * Catalyst * Link: https://github.com/prysmaticlabs/bazel-go-ethereum/tree/catalyst * Branch: `catalyst` * Commit: `a7522982fb2a9f60ddb08f28d42029c3d23267a2` ## Commands to start 1.) Check out `catalyst` branch and start the Catalyst eth1 instance :::info ./run-catalyst.sh ::: **Notes**: If you plan to send transaction later, edit `run-catalyst.sh`'s `"alloc\": \{\}` with the address and eth amount. ![](https://i.imgur.com/C4R5xHY.png) 2.) Check out `quick-merge-demo` branch and generate the beacon chain genesis state :::info bazel run //tools/genesis-state-gen -- --num-validators=64 --output-ssz=/tmp/genesis.ssz --mainnet-config ::: **Note**: There's no limit to the number of validators you can use. But make sure it's consistent with the validator command below 3.) In the same `quick-merge-demo` branch, start the beacon node in interop mode :::info bazel run //beacon-chain -- --datadir /tmp/mergechaindata --clear-db --interop-genesis-state /tmp/genesis.ssz --interop-eth1data-votes --min-sync-peers=0 --http-web3provider=http://localhost:8545 --deposit-contract 0x8A04d14125D0FDCDc742F4A05C051De07232EDa4 --pyrmont --bootstrap-node= ::: 4.) In the same `quick-merge-demo` branch, start the validator client in interop mode :::info bazel run //validator -- --beacon-rpc-provider localhost:4000 --interop-num-validators=64 --interop-start-index=0 --clear-db ::: ## What you should see #### Catalyst Receives from beacon node and imports new application payload to the eth1 chain ![](https://i.imgur.com/57BIQ67.gif) #### Beacon node Produces new application payload using Catalyst and package payload into beacon block Inserts beacon block application payload to Catalyst ![](https://i.imgur.com/VdD111Z.gif) #### Validator client Receives from beacon node and signs beacon block which contains application payload ![](https://i.imgur.com/7X7Ugb4.gif) ## Next steps * Further alignment with the [merge spec](https://github.com/ethereum/eth2.0-specs/tree/dev/specs/merge) * Brainstorm how we can leverage this experience for a more public testnet so the community can test drive it. Please do reach out to us if you have any cool ideas :rocket: ## How to send transaction #### Metamask 1. Connect to `Localhost 8545` and change the chain ID to the one specified in genesis.json (i.e. `220720`). Balance with your address should be reflected ![](https://i.imgur.com/DNf6kqz.png) 2. Now send a transaction ![](https://i.imgur.com/u5Zj6gC.png) 3. To verify, you should see transaction picked up by the eth1 node ![](https://i.imgur.com/A2jLiVb.png) #### Beacon node Beacon node requests eth1 application data and produces it for validator. It then inserts it back to the eth1 node. (See `numTransactions=1`) ![](https://i.imgur.com/TkiPCS4.png) #### Validator Validator signs over the block with eth1 application payload ![](https://i.imgur.com/YvvEAS4.png) Back in Metamask, you should see original transaction has been confirmed :rocket: ![](https://i.imgur.com/HuMJKhz.png) ## Reference [Spec](https://github.com/ethereum/eth2.0-specs/tree/dev/specs/merge) [Research: executable beacon chain](https://ethresear.ch/t/executable-beacon-chain/8271) [Research: eth1+eth2 client relationship research](https://ethresear.ch/t/eth1-eth2-client-relationship/7248) [Original quick merge proposal](https://notes.ethereum.org/m9IX3OkkTveXCCOSzGkUiw) [[DRAFT] Eth1-Eth2 communication protocol](https://hackmd.io/@n0ble/eth1-eth2-communication-protocol-draft)