Skip to content

Latest commit

 

History

History
45 lines (38 loc) · 12.2 KB

Exit_Validator_with_Validator_Mnemonic.md

File metadata and controls

45 lines (38 loc) · 12.2 KB

Exit your Validator (full withdrawal)
— using the command line interface Ethdo
— with only your validator's mnemonic seed words

To exit your mainnet validator and have your ETH stake returned to you, you must sign a specific message and publish it to the network. If you have not updated your withdrawal credentials to the new 0x01 format, you will need to do so first before your validator is eligible for exiting (see the Section 1 tutorials). I've only tested the Ethdo tool on mainnet validators, so this tutorial may not be accurate for signing for testnet validators. This tool is a command line interface, not a GUI. At present, I don't know of a good GUI for exiting validators, that I can trust and recommend.

Before you start, you should collect the following info somewhere handy, so you can do this process offline for best security:

Worksheet Data:
A The 24-word mnemonic for your validator.
B Choose either one of the following info (if you don't know these already, you can browse to your validator's public dashboard on beaconcha.in to locate this info). You only need one:
-- The validator index number (1-7 digit unique identifier for every validator). Recommended because it's a shorter peice of data.
or
-- The validator public key (long string under the validator index number).
example image

  1. Browse to https://github.com and find the “wealdtech/ethdo” program, and click on “releases” on the right side of the page. Or navigate to https://github.com/wealdtech/ethdo/releases. The most recent release is at the top. Verisons older than 1.35.0 will not work after the Dencun hardfork ETH network upgrade is official in mid-March 2024. If you would like to read more technical details on the various commands you can use Ethdo with, the source documents specifically related to exiting validators, are here: https://github.com/wealdtech/ethdo/blob/master/docs/exitingvalidators.md.
  2. Scroll down to “Assets” and download the version appropriate to your system. This tutorial is written only for Windows systems, so choose the file that ends with “.zip”.
  3. In Explorer, locate the compressed zip file you just downloaded, and extract the contents. To easily extract compressed files in Windows, right click on the file and select Extract All....
  4. Within the new folder you just extracted the files to, navigate in until you find the “ethdo.exe” file, and move that file to any folder of your choice that has a short path that has no spaces in it. You will need to type this path a couple times later, so if it's shorter, your task will be easier.
  5. For the next step, you need to be online briefly so the program can download an offline version of a public validator data list, for it to use later. You can skip them if you have already completed steps 5-9.
  6. From your start menu, run your Command Prompt app. (Windows PowerShell app works just as well, and has color-coding to make commands easier to read)
  7. Type or copy/paste the following command, changing the [FolderPath] to wherever you put that ethdo.exe file, and then press enter:
    [FolderPath]\ethdo.exe validator credentials set --prepare-offline
    For example:
    example image
  8. You will see the following message response: No connection supplied with --connection parameter and no local beacon node found, attempting to use mainnet fallback. It is first attempting to contact your local node, and since you likely are not running a node on your computer, it will automatically switch to accessing the data it needs from the internet using the “mainnet fallback” option. Be patient and wait until it completes and displays this message: offline-preparation.json generated. This may be up to a couple minutes long depending on your internet download speed. It has now downloaded and saved to your harddrive a ~320MB+ JSON database file that contains public data on every validator on the network. It will use this data next, to get certain details of your validator so it can sign the appropriate exit message for you.
    • Do NOT move this file from its current location, or else the following steps will not work as the program won't be able to find it. If you need to move this file between online/offline computers, just make sure this file is placed in whatever folder is the normal Windows Users folder of that computer and the user logged into it. For example, C:\Users\KentA\. (Note: If in doubt, you can identify the Windows Users folder for your machine, by opening a File Explorer window and typing %userprofile% in the box)
    • If Ethdo fails to download this database file for some reason, you can find links to backup copies of the database available for downloading at https://github.com/eth-educators/ethstaker-guides/blob/main/voluntary-exit.md#prepared-alternative. These files are refreshed once per day. If you download the file this way, extract the contents of the zip file to the location described earlier in step 8 above.
  9. You are now going to be doing sensitive tasks, so for good security practices, you should now disconnect your computer from the internet or turn off your WiFi. Even better, move the program (a single executable file) to an air-gapped computer for the sensitive operations with your mnemonic seed words. If switching computers, you will need to also move the database JSON file created in step 8, and ensure it is located in the correct folder, as described in step 8.
  10. If you wish to sign an exit message for all validators under your mnemonic, you can cut out the --validator flag of the command in the next step (and it's data), and Ethdo will find all the validators under this mnemonic and sign one combined exit message for the whole set. At this time, I do not recommend this, as I have heard reports that Beaconcha.in isn't accepting uploaded "batched" exit messages as valid for some unknown reason. I will remove this warning if this is corrected in the future.
  11. If you wish to sign exit messages in a batch for multiple validators under the same menmonic, skip to step 12. If you wish to sign an exit message for a single specific validator, type or copy/paste the command highlighted below, using the following changes: (Tip: you might find it helpful to prepare this command in a text editor, make the needed changes to customize it, and then copy the final result to the command prompt app)
    • Change [FolderPath] to wherever you put the ethdo.exe file.
    • Change [MnemonicWords] to the mnemonic seed words for your validator. (Worksheet Data #A)
    • Change [ValidatorIndex] to the public validator index or public key. (Worksheet Data #B)
      [FolderPath]\ethdo.exe validator exit --offline --mnemonic="[MnemonicWords]" --validator=[ValidatorIndex]
      For example:
      example image When it completes (<5 seconds usually), you will find a new “exit-operation.json” file created in your personal Windows Users folder (see note in step 8 above). Here's a tip: If you have more than one validator you want to sign exit messages for, rename or move the "exit-operation.json" file so it doesn't get replaced. You can keep the command prompt open and use the "up arrow" key to automatically re-type the last command you ran. Then just backspace out just the data in the [ValidatorIndex] part in the command string (and the [MnemonicWords] part, if applicable), and replace them with the data appropriate for the next validator you're signing for, and press Enter to run the new command. A new "exit-operation.json" file will be created in the same folder and you can move/rename that file too. Keep doing this sequence of actions until you've finished all the validators.
  12. Skip to step 13 if you did step 11 above. If you wish to use one command to sign exit messages in a batch for all validators under the same menmonic, type or copy/paste the command highlighted below, using the following changes: (Tip: you might find it helpful to prepare this command in a text editor, make the needed changes to customize it, and then copy the final result to the command prompt app)
    • Change [FolderPath] to wherever you put the ethdo.exe file.
    • Change [MnemonicWords] to the mnemonic seed words for your validator. (Worksheet Data #A)
      [FolderPath]\ethdo.exe validator exit --offline --mnemonic="[MnemonicWords]"
      For example:
      example image When it completes (<5 seconds usually), you will find a new “exit-operation.json” file created in your personal Windows Users folder (see note in step 8 above). Any Ethereum validator node can publish this message for you, but the publish tool on Beaconcha.in doesn't accept batch exit messages, so the individual messages in this one file have to be separated out and published individually. Open the file in a text editor (such as Notepad), and delete the [ character at the beginning of the file and the ] character at the end of the file. As shown in the two pictures below, the exit message is in the format:
      {"message":{"epoch":"######","validator_index":"#######"},"signature":"0x####################"}
      A batch exit file contains a series of these message blocks strung together separated only by a , character. You can copy/paste each of these blocks of text and save them in newly created separate text files, if you plan to save these exit message files for the future. Or you can publish the blocks of texts one at a time now by copying/pasting them individually as directed in step 14.
    • Example exit message file with three signed message blocks (this file cannot be uploaded as it is):
      example image
    • Example exit message file with just one signed message block (this file can be uploaded as it is):
      example image
  13. Go back online (or move the newly-created “exit-operation.json” file or your own created files to your online computer) and navigate to https://mainnet.beaconcha.in/tools/broadcast. (mainnet validators only)
  14. Upload the “exit-operation.json” file that you just had created (or paste a single message block of text you got from step 12), verify that the data in the message corresponds to the validator you wish to exit, and click Submit & Broadcast. Leave that page up and available for now, as refreshing it will give you update status on that specific broadcast job even before your validator dashboard show any changes.
  15. The signed exit instruction will now be sent out to a network node. The update should be finalized on the network within 10 minutes.
  16. When broadcasted and accepted by a node, you will see your validator move into “Exited” status on your beaconcha.in validator dashboard page, along with dates and times on the right side of the page showing when your validator is estimated to be next in the exit queue. Exit queues can often be a few days long, so keep your validator running and validating and earning rewards, until your dashboard shows your validator has had its turn to fully exit. Once exited, the validator enters a pause period of about a day, and after that, it gets marked as withdrawable. Your entire stake and any earned rewards not swept out before, will be swept into your wallet when the sweeper is scheduled to come around to this validator next after the withdrawable date.
  17. Remember that large database file the program made? If you're done signing validator exit messages, you can delete it now, since you're done with it, and it uses a lot of disk space. It's located in the same folder you found the “exit-operation.json” file, and is called “offline-preparation.json”.

Back to Home