BLS To Execution Change

Introduction

To enable your Beacon Chain validator(s) to automatically withdraw balances to your execution layer (Eth1) address, you can use the staking deposit CLI tool to generate the signed “BLS To Execution Change” (SignedBLSToExecutionChange) message JSON file. This message includes the request to change your old BLS withdrawal credentials to the new withdrawal credentials in execution address format.To include this message on Mainnet, you will need to upload this message to a beacon node’s message “Signed BLS To Execution Change” pool.

Installation

Option 1: binary files

You can find the binary files in Staking Deposit CLI releases

Option 2: source code + virtualenv

Download master branch:git clone https://github.com/earthwallet/staking-deposit-cli.gitInstall and set virtualenv:pip3 install virtualenv
virtualenv venv
source venv/bin/activate
Install dependencies:python3 setup.py install
pip3 install -r requirements.txt

Generate bls_to_execution_change-*.json file

Assume you have generated deposit in EIP-2334 format and have BLS withdrawal credentials. If not, you can generate it by following docs.

Execute with params

Option 1: binary files

Interactive mode./deposit generate-bls-to-execution-changeCommand line with flags./deposit --language=english generate-bls-to-execution-change \
--chain=mainnet \
--mnemonic="<Your mnemonic>" \
--bls_withdrawal_credentials_list="<Your old BLS withdrawal credentials>" \
--validator_start_index=<The key start index in EIP-2334> \
--validator_indices="<Your validator indices>" \
--execution_address="<The execution address for withdrawals>"
[Example]./deposit --language=english generate-bls-to-execution-change \
--chain=mainnet \
--mnemonic="sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry" \
--bls_withdrawal_credentials_list="0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de,0x00a75d83f169fa6923f3dd78386d9608fab710d8f7fcf71ba9985893675d5382" \
--validator_start_index=0 \
--validator_indices="50000, 50001" \
--execution_address="0x3434343434343434343434343434343434343434"

Option 2: source code + virtualenv

Interactive modepython ./staking_deposit/deposit.py generate-bls-to-execution-changeCommand line with flagspython ./staking_deposit/deposit.py --language=english generate-bls-to-execution-change \
--chain=mainnet \
--mnemonic="<Your mnemonic>" \
--bls_withdrawal_credentials_list="<Your old BLS withdrawal credentials>" \
--validator_start_index=<The key start index in EIP-2334> \
--validator_indices="<Your validator indices>" \
--execution_address="<The execution address for withdrawals>"
[Example]python ./staking_deposit/deposit.py --language=english generate-bls-to-execution-change \
--chain=mainnet \
--mnemonic="sister protect peanut hill ready work profit fit wish want small inflict flip member tail between sick setup bright duck morning sell paper worry" \
--bls_withdrawal_credentials_list="0x00bd0b5a34de5fb17df08410b5e615dda87caf4fb72d0aac91ce5e52fc6aa8de,0x00a75d83f169fa6923f3dd78386d9608fab710d8f7fcf71ba9985893675d5382" \
--validator_start_index=0 \
--validator_indices="50000, 50001" \
--execution_address="0x3434343434343434343434343434343434343434"
For devnet, you can add a param:--devnet_chain_setting='{ "network_name": "<Network name>", "genesis_fork_version": "<Genesis fork version>", "genesis_validator_root": "<Genesis validator root>" }'[Example: withdrawal-mainnet-shadowfork-1]--devnet_chain_setting='{ "network_name": "withdrawal-msf-1", "genesis_fork_version": "0x10000043", "genesis_validator_root": "0xe9ec351d158fd3b89b6afd2e6033bcae8d8adc2dd4c560c4bbf852d47ed0410e" }'

Expected outputs

**[Warning] you are setting an Eth1 address as your withdrawal address. Please ensure that you have control over this address.**

Verifying your BLSToExecutionChange file: [####################################] N/N

Success!
Your SignedBLSToExecutionChange JSON file can be found at: /.../staking-deposit-cli/bls_to_execution_changes

Press any key.
You can find the bls_to_execution_changes-*.json file in the ./bls_to_execution_changes folder by default.

Upload to Beacon Node BLSToExecutionChange pool

You can broadcast your signed message from the command line using the curl command:curl -X POST -H “Content-type: application/json” -d @<@Filename destination> \
http://<BEACON_NODE_HTTP_API_URL>/eth/v1/beacon/pool/bls_to_execution_changes
You can also use the Beaconcha.in broadcasting tool to upload your message using a web user interface:Beaconcha.in Broadcast Tool