Remy and Ladislaus demonstrate how to perform a voluntary exit
EthStaker Workshops and Technical Guides · January 2021 · 42:37
A hands-on EthStaker demonstration in which Remy and Ladislaus walk through how to perform a voluntary exit from Ethereum staking. A voluntary exit is the process by which a validator formally stops participating in proof-of-stake consensus duties and begins the withdrawal process for its staked ETH.
Topics
From EthStaker Workshops and Technical Guides, hosted by Eth Staker.
Transcript
Intro
hello everyone my name is Remy I come from the East taker community and I'm joined today uh by Lady slaus hello how you doing everyone Hi Remy thanks for having me hey uh so today we'll see and we will demo how to do a voluntary exit for a validator on uh ethereum so uh we've got this guide that we'll be following and we'll show you um how to do this but first um lady slaus what's your um take on ethereum like what are you doing in this community I know you've been a long time collaborator with East taker what else are you doing in here oh yeah as you mentioned I'm I'm happy to to collaborate on some educational
material with the East taker crew uh have been yeah a Community member for with the staking community at least for three years uh and yeah love love what you're doing um appreciate your efforts to promote homesteaking solo staking and and continuously try to keep the data to set decent as decentralized as possible awesome let's get started small question as to why would someone want to do a voluntary exit what's the cycle what's the process um how does this fit into this whole staking um thingy that we do on ethereum Yeah so basically what we'll talk about exiting
Why would you exit?
today is uh that this the fact that we've just recently uh enabled uh withdrawals technically uh with a network uptrick upgrade um which uh was called capella and so uh interestingly you you stakers could exit before all that technically but uh it was not like there was no real incentive to do so because um the the initial collateral the 32es validator would have had put up would not have been accessible until this recent upgrade so with withdrawals which we are also talking about a little bit today and the exit process like
generating exit messages and exiting a validator with the the initial collateral and um the accrued walls become accessible and that's basically what we are taking a closer look at today all right let's switch into the Meetup thing and let's go into the actual demo I'll be showing my screen here and so we'll be able to see all right so we are into this guide here which we will link into the description of this video on how to perform a voluntary exit um so there's very many different ways on how to do this right and so each client each of the consensus client have their own native way of doing this but the way we're gonna show here is more
Demo
generic and it can be performed and um without even having access to a consensus a consensus client right so that's one of the benefit of this way but like I said there's a lot of different um ways of doing this so let's get started the tools that we're going to be using will be using tree tools um if do uh the beacon chain broadcast tool and Tails um edu is a great comma line tool for managing a bunch of tasks in ethereum it'll actually do all the crypto stuff to sign our voluntary exit um begin chain is a very popular ethereum Explorer and it has a nice little
utility page called the broadcast sign message tool which can be used to broadcast a voluntary exit so it would be using that because it's it's very easy that's not the only way to broadcast it and we might talk about in alternative to this and daily is simply a nice portable operating system that protects you against surveillance and malicious actors so let's get started with the required details in this demo here we'll be doing two exit on two different validators on girly um and so I went ahead and prepared those ahead of time we'll be exiting validator 473895 and
Required details
473896 in two different ways simply to demo these ways and and so we can see right now that these validators are online and performing their duties and that they also have a withdrawal address associated with them and so we can see the partial withdrawals right now on the beacon chain website so I'm using right now the girly version of The Beacon chain website but the mainnet version is very similar um so these are the two validators that we will be exiting this is the validator index which we might need for one of the ways of Performing this exit and we also have like the public keys that I just
noted here I think the important part uh to highlight here is that you've already uh broadcasted a different message the bls2 execution message which uh each day has done uh also a video on a video on how to to generate those metrics so that um validators that were initially activated or or deposited with a PLS credential now uh change this credential to a regular ethereum address so um we're not going to show here how to add a withdrawal address to your validator
um this is assuming you already have one if you don't have one um what will happen if you don't have a withdrawal address as you did with your validator and you exit from the network uh I I I I would assume I've not tested this but uh basically you you can exit uh anyways so it does not affect the exit message or the exit operation which we are demoing today but uh basically the final step of withdrawing uh the the funds or being uh withdrawable let's say technically this the state of being withdrawable and then sort of uh basically receiving assets on a regular ethereum test this would not be possible
if the credential has not been uh set in the correct way yeah so I believe that if you exit a validator that does not have a withdrawal address associated with it it will simply sit there until someone eventually adds it with rollers right and so these validator to be precise were created and deposited with a withdrawal address so I didn't have to perform this pls2 execution change um but it's very similar to um if you didn't have a withdrawal address previously and you added one with this via Exchange all right so let's go back to the guide here so we have the details that we need um and the tool that we will be using is
F2 version one that third uh 30 here um which can be downloaded here but um I have all the instructions here and I'm on the window so I'll go ahead and do the initial part which is preparing for offline generation and one of the reason why you uh might want to do this offline is for your own security um and and there's different ways of like leaking your privacy or security if you do this online but one of the major way you could get screwed um is if you leak your mnemonic and you want to avoid that as much as possible so maybe I could ask you this leading
Preparing for offline generation
question um here ladies last what happens if you if a malicious actor get access to either your mnemonic or your keystore file yeah so so basically so we're talking about the um the mnemonic to generate uh keystop files correct we're not talking about I mean we we could also talk about the private Keys generated by some amnemonic protecting uh your withdrawals and your collateral so this is the the Demonic or um could also be uh that's my contract whatever so controlling the uh regular ethereum address so to say but we're
talking about the the first one so uh basically the you want uh your uh signing key in the morning as I would call it you want to protect this because um basically the easiest form of attack would be if you leak if someone gets a hand on it they could get you slashed because they can with with this and mnemonic they can regenerate or generate the signing key and as we all know if two uh if the same signing key runs on two different instances at the same time um this is a slash bill or this this could lead to a slashable offense so keep your mnemonic safe um in any uh in any case
and I believe the other reason why you might want to keep your mnemonic safe is um if you don't already have a withdrawal address facility associated with your validator a malicious actor could potentially add his own address and potentially steal all your value balance right so that's a good reason um to safeguard your mnemonic and to perform this operation offline that's a little bit more of a sophisticated attack but but um yes keep keep your mnemonic safe all right so since that's why we do it offline yeah yeah since I'm on Windows um I'll be performing this this step for Windows here but there's different instructions for uh Mac OS or Linux so
let's get started with the um step for Windows so the first one is to start a Powershell so I'll just be I'll just go ahead and do that so Powershell is just this common line tools that you can use um to perform operation on the command line interface here on Windows the next step is to download um if do so I'll just be using these commands here so this one downloads the actual um archive which shouldn't be too long here and this other one downloads the um Shaw 256 um checksum which is the next step here
we'll just make sure that the shot is correct and so the First Command here that I pasted in my command line interface on Powershell um outputted the the actual file hash using this sha-256 algorithm and the the main thing here to to check is to make sure that these two values this one here and this one here match right so if you see that they match and they're the same you should be good to go this is just a simple precaution to make sure that what you download is actually what you're
expecting that it was not changed while it was downloaded so if you're on 1.30.0 it should be this value here but if you download a new version if there's a new release it might be different so let's go ahead and expand the archive and um start the um generation for the offline file right so so this command here will simply try to connect to your local Beacon node in my case I don't have one in this machine so it'll simply fall back on a public endpoint and it'll prepare a file that we will need to do
this voluntary exit signing offline so let's go ahead let's start it uh it should take a few a few seconds or a few minutes depending on your connection speed and if if you can find a local Beacon node in this case you can see that it was not able to find one so it's going to attempt to use the mainnet fallback this is assuming you want to do all of this on mainnet right so I'm I'm doing this on girly because um this is much easier for for us to demo um but um if you want to do this on girly you will need to find a beacon node which is running on girly
unfortunately there's no current Beacon node there's no public Beacon node for girly uh not that I'm aware of um so you might need to run your own node to to prepare this file if you want to do this on girly eventually it'd be it'd be great to to have a public girl you know as well and this might be possible in the future and if and if so I'll try to update these instructions but you can see that it was able to generate a file called offline preparation.json which we'll need right so the next step is to open a Explorer window I'll just type start a DOT and this will show me the file that I just
created um I believe I believe I missed I missed some step here sorry I need to download the um Linux version of f do because we will be running this on tail which is a Linux distro so let's just go ahead and download these files as well I just copy and pasted the instruction again so that's why you don't see me typing here um but now that I have the Linux version of evdu I should be able to go back to my Explorer and see that they were downloaded here so those are the main instructions for Windows I'll skip the one for Mac OS and
Linux and I'll go back to the section called finalizing your document the the actual element that we need on a USB stick are these three files so the Linux version of evdu the shot 256 um checksum and the offline preparation so I'm just going to copy them on a on a stick here that I already plugged in I'm gonna paste it um there's already a offline preparation file that I prepared in advance um I'll just keep the one that I already have that one is good for girly the one I just generated was for mainnet so let me just go ahead and skip that and we will have all the files that we need so
I want to demo this for um um the two validators as I initially showed uh one of them I'm gonna use a key store and the other one I'm going to use the mnemonic in this demo I added a mnemonic file that includes my mnemonic but in a real life scenario you should really avoid um inputting your mnemonic on any electronic file or devices just to make sure that you don't leave any lingering um private data that could be potentially used against you right we already talked about this um especially for the mnemonic it should be offline as much as possible or safe and secure so
that people cannot easily access it so let's keep going here so signing and generating your voluntary exit file in this sections you'll be asked to create a USB stick with tails on it and and boot from it um I don't wanna keep uh you waiting I already have a machine ready for this and it's it's it's simply a virtual machine here so and just go ahead and switch that machine and so we have it here so when you launch uh Tails um from your PC or your laptop it'll look a bit like this you'll be prompted
Signing and generating your voluntary exit file
to select your language keyboard layout in a different format but you can just go ahead and click start till and I might just change the resolution here um just to make sure that it's easier to to see let me see if I can put this slightly bigger um I should try this one maybe there you go so it's going to be slightly bigger for you guys to see so let me try to just quickly Remy yeah
so you're damning this with with taylor2s with the which is a privacy uh or a particularly privacy oriented um Linux distribution I think we've had a couple of discussions on on Discord and it's I believe consensus is it's totally fine to also to do this with a Linux with a with a different Linux life distribution such as Ubuntu uh the the key ID here is really to do this on an so-called agap machine so let's say on a different in a different computer which is not connected uh to the web or to to any uh to any other device that says absolutely the the part to highlight
here yeah and one other thing I liked about um tails is I believe it does not connect on your network by default and so that's an added protection um just to make sure you don't get uh screwed with any malicious software that will use your files right and so um now I will simulate connecting my um USB stick here so I'll just connect it from um my host and eventually it should show up in the file somewhere let me see there you go my stick here is is just over there and I can see all the files that I
um obtained and put on my and my USB sticks right so I will need to copy all of these documents into my home folder so let me just go ahead and do that so let me copy those into my home folder so it's just going to be easier um to access here now I need to start a terminal and um get starting so if you want to start a terminal there's like different ways of doing it but it should be somewhere in this menu there you go it's in utility terminal and let me just make it this slightly bigger for you guys to see now I can just make sure that the signature the checksum for f do is fine
so I'm just going to call um sha 256 sum on the file and I'm gonna output the content of the checksum here and as usual you should try to compare these two values if there's if they're the same you should be good to go this is um as I mentioned previously a sample protection to make sure that the file was not tempered while you were downloaded it so let's extract F do and let's get started on creating our signatures here all right so we have from this point we have two different ways of um generating the voluntary exit the first one is using your keystore file and the
associated password right so in my case um I'll do this one for the key store that I have here so this key store here so let me try to use this template command here and just replace oh that's not gonna work here I'll have to I'll have to manually type this command um because I cannot copy and paste on this machine here so let me just type it so F do validator exit um Dash validator and from that point equal
I will have to input the keystore file so key store Dash M underscore 12. 381. I might just copy and paste it instead of typing it here it's going to be much faster for me there you go next I have to use the passphrase which is simply the [Music] the password for your key store file so if you don't know your password you might be able to generate it again but in my case it's just testing one two three
um well there's a typo in passphrase you're correct thanks and what else do I need so I need to Output the result as a Json value and have to tell um F2 that I want to do this offline and now I can choose to Output the result um in a file that I'll be able to give the name of like I can choose the name for this for this file and in my case this should be uh validator three four seven three
eight nine six so I'll just name this four seven three eight nine six dash exit dot Json let's try this let's see if it works I'll just cross my finger here because I haven't tried this ahead of time so it seems to seems to work uh let's just see what's inside this file so you can see the the content of the file here it's just a regular Json file with the epoch where this Val this voluntary exit will be valid from the index of the validator and the signature for the
the voluntary exit so this is the content that will need to be broadcasted eventually right so that's one way to do it let's try the other way with the mnemonic oh man one one point here because I remember discussion we had uh discussions discussions we had on Discord so there's um important note here Remy has all the documents in the same folder so the program is to the same folder as the key star uh yeah that's the key start so basically uh depending on if you use different USB sticks or whatever you can change for example uh the the Keystone location and
and if it's different from where he starts E2 is located so just make sure to in this case to add the correct subfolder than in the dash dash validator parameter here good point yeah let's go ahead and try this with the mnemonic right so now if you don't have your key store or you you just want to use your mnemonic because it's easier for you there's a there's a similar way to do it um all you have to do is call the this command with uh simply different parameters so let's go ahead and try this for the other validator I want to exit so it's going to be Dash Dash validator and at this point here I have to input
either the validator index or the public key of the validator that I want to exit here so I know that I want to exit this other validator here which is 473-895 so let's just input that four seven three eight nine five um still want to add these other flags for Json and offline and oh yeah by the way go ahead I forgot to mention the offline preparation Json also has to be in the same folder right absolutely yeah um and that's why that's why I simply um mentioned in my instructions on this
guide just to copy everything in the home folder um it's it's just an easy way to make sure that all of these files are are in there now I have to input the mnemonics so let me just go ahead and and do that um so um I'm not gonna actually input the mnemonic manually I'm just gonna create a new a new tab here and I'm just gonna expose the mnemonic uh this is just a mnemonic I'm I'm using for this demo so it's not tied to any real value um it's it's just much easier for me to do it this way and I believe that's all right
yeah um if I want to Output this in a file I have to use um the graded and sign and then the name of the file um just for my own sanity I'm gonna name this one 473 uh eight nine five Dash exit dot Json so I can know um this is the actual voluntary exit for this validator the 473895 so if I did everything by the way this is go ahead oh yeah sorry this is a this is some the last bit where we added is is optional right so if you don't provide this parameter the so that the naming of the file is to will call it I believe just
exit operation.json and we'll start it in the same folder um which we will see in a second right so we expect now that that we have we want to create two messages two different Json files and name them differently which we have done here by by specifying this final parameter and those files we will now see in uh in the same folder right yeah so if I go back to my um file browser here I can see these two file and all I have to do now is copy them back onto my USB stick so I'm just going to copy them back here and now I can eject the USB stick um disconnect it from
um this machine and I should have everything I need now to broadcast the exit on the network all right and we're back and we found um the missing stick um there was some issue with like the stick connecting I don't know what it was but now we have it and we have the two files that we created the 473895 exit then the four seven three eight nine six exit now if I want to broadcast these exit there's like very different ways but like one of the very easy way to do it is using the beacon chain uh broadcasting tool
Broadcasting your voluntary exit
um this is the one from mainnet I'm gonna use the one for girly they're very similar um they're almost the same but this one is is gonna be the one that works for my demo here so all I have to do is drag and drop um these two file I'll start with the first one and when you drag it it'll simply show its content and then you have to go download a little and click on this Summit broadcast and you will see this um next screen here which um will will show like a request job with whatever you were doing it'll and in this case this is a
voluntary exit and it'll show what are the affected validator um so there's like different steps um and delays from there but if I click on this now it should show up eventually as exited or as like pending an exit when you go on Beacon chain there's some delays and like it's not always showing up right away but eventually it will start its exit process and that's pretty much it and I mean the cool part here really is
the the the beacon chain Explorer provides users stickers um or years of stakers for example with a web interface because basically what we've done till now is preparing the message that the the voluntary excellent measures and now we've also submitted it via a very easy accessible drag and drop and submit button click web interface but for example what's takers think about is just preparing the message and then storing them somewhere safely just in case something happens to you as a node operator and you want your your ears to as easy
as possible access your your the exit message and sort of drag and drop it into the windows as we've shown and then exit for you in case you're not able to do so anymore for whatever reason um but I think it's better practice to um to prepare that message and not necessarily immediately exit but that's what we are doing today yep um that that could be an alternative to providing the actual mnemonic right so if you already have like a withdrawal address um you could provide your errors with um voluntary exit message and they could perform it themselves if they wanted to yeah no no need for command line here right just the USB stick with the with
the Json file in it and maybe quick text text file and then okay here's beaconchain.com and the uh I'll be contain sorry uh and then just drag and drop and submit there you go let me just refresh this page here to see if the exit was picked up by pick and change it doesn't seem so but let me just go ahead and broadcast the second one here so if you want to go back to the broadcast tool you just click broadcast sign message here and I will broadcast the exit for the second validator right nothing special I'm just doing the same process dragging dropping the file and clicking on um submit message here and it'll show something very similar with your
voluntary exit and the affected validator if I click on this link here um it doesn't see that it was exited yet and I'm not sure if there's a queue right now which is going to lead to the next discussions about these various delays that can happen when you're trying to exit a validator but let me go back on the beacon chain home page here you can see here there's only two validators or that are waiting to exit the network I'm guessing those are the two that I just exited um but um latest loss has created a nice post that explains a lot of these details here which I will link to also in the
Exit stages diagram
description of this video um but one of the most interesting part that I really like is it's his diagram here on this whole process of exiting and withdrawing and and I don't know if you can just quickly go over this I believe we've already talked about this previously in in another video but like this is very valuable to um anyone who's willing to do a voluntary exit yeah absolutely so basically what uh Remy has done up until this point is uh or starts in the upper left corner right so we've just broadcasted the voluntary exit message to the network but explicit explicitly we can change the beacon
chain nodes have sort of once we have clicked submit um have submitted this message message and basically this diagram just shows what happens from from here on uh from in terms of stages what the validator then uh the stages they will uh the validity will go through so just briefly the the to highlight here we have initiated the exit um we're waiting for it to be cute um then we will see at some point it being exited withdrawal though and withdrawn um yeah basically uh right now uh I believe it's still in the the message is still being processed so to say until
it's picked up um and included in a block then it's reached the e as it states it's the queued phase and usually um or right now we've seen the execute with at least the main ad it's empty so when then starts it's it's about a minimum of a four Epoch DeLay So half an hour we wait to for the validator to to go through the queue and particularly important here is um you're still or your validator still needs to show up for consensus students so keep on running your note um and yeah no do not turn it turn it off um prematurely and then you can check on an Explorer or on your local node for
for example when your screen locks uh has it reached the um its exit Epoch which we also see in Beacon chain for example and once it has reached the exit Epoch it is officially Exempted from consensus duties and officially exited so if the queue is empty this might take just half an hour if the queue is rather crowded it could take days opportunity weeks but once it's exited there comes another delay phase which is like a fixed uh for security purposes fixed phase uh called withdrawal delay takes about 27 hours and then finally when uh as we mentioned
earlier when you've set your withdrawals withdrawal credentials to a 0x01 so regular ethereum address which is limited out of scope of this video but we've talked about in other videos the this famous round robin cycle withdrawal uh processing which is an automatic process happens and once sort of the beacon chain has reached your exited validate as index um all of the collateral like the 32 East and the accrued rewards will be magically uh swept to your withdrawal address which is your regular theme regress once again and there you are you or the validator has finished
finished its Journey and this is all conditional on um you having a withdrawal address right so if you don't have a withdrawal address associated with your validator um and you exit you like uh the withdrawal phase and withdrawal processing will not work uh it'll just be idle until someone or you add a withdrawal address eventually yeah the fans are just uh are not gone right they're still stuck on the beacon chain so to say there's something on the validator's balance right so I believe that's that's all that we um that we had here um so I believe we managed to exit
Exited validator review
um our validator um and uh we're simply waiting for the exit message to be picked up by um Beacon chain let me just double check if it if it wasn't so you can see this one here the 473895 now has changed to these exiting status I'm not sure what that exactly correspond to in your diagram here maybe this is just the initial um exit message process it's been picked up in a block oh there you go as far as I understand it's been predictive in a block and once the button is sort of green it's exited so that's basically after epochs um a minimum for epochs and the queue
um it's exited awesome so right now you add you I mean don't don't shut down your notes uh right now because you your stage have to show up for duties absolutely that's a that's a good point is there anything I'm missing here or is is that it I believe we should uh or I'm not sure whether we highlighted that you can broadcast your message not necessarily uh with a drag and drop Beacon chain interface but also with different methods that's a good point right so in my guide I also have this alternative to using uh the beacon chain website Beacon chain is very easy to use um even my grandma uh would be able to use it uh probably
Alternative broadcast methods
um there's different ways uh that could be used like uh think for instance if Beacon chain was down or if there was an issue somewhere with with internet or anything you could use your own Beacon node to do this broadcast step here this might be harder if you don't have access to a beacon node but it's still possible so on Linux you could simply post this um API on the beacon node um um public endpoint and you could simply broadcast the exit file and it would be very similar to just to what we just did right so
um your validator would enter these exit phases and eventually if you have a withdrawal address you would be able to obtain all the validators balance and then this maybe to enter that there's there's also like your your consensus client of choice uh which is which can also pick up the message and broadcast it so there's if you follow your official clients documentations um there's uh there's a way to um well there are ways to uh exit validators is um yeah all of these docs here so if you're
using one of these uh prism Nimbus load star take you Lighthouse uh simply click on on these link here and it'll take you to um the part where it says how you can do this whole process with your client for instance and East to itself also has the functional includes the functionality to to broadcast the message and it's maybe once one thing we didn't highlight why do we use E2 uh anyways uh because it's a it's an incredible powerful tool for Big Chain operations as we've seen and then also maybe if you're wondering like why why aren't they using like the um the ethereum foundations
uh deposit uh deposit CLI right which is likely the tool you used uh to create or generate your your validator keys uh earlier and this is the simply because the functionality for generating the voluntary exit messages are not yet supported uh at least the last time I checked it so that's why we that's why we're not using as of now the the official sort of official deposit CLI from the EF but rely on on these two uh um by a highly renowned community members are testing so I think it has already been audited the last uh versions of it so
um it's uh it's a super powerful and reliable tool and eventually you might have this feature in in the sticking deposit CLI tool as well um I'm working with um someone else to to get it there but we'll see how it progress right so that's that's pretty much it um if you need support if you have any issues with all of this um you can always come um to the ace sticker community and we'll try to guide you or help you with any of the um issue that you might be and seeing while trying to do these so that that's pretty much it um thanks for joining uh lady slaus um it was a pleasure to have you again we should do
Support and outro
more of these videos with you um you're a very good reference and it's always a great time thanks very much it's been fun all right thanks everyone um we'll see you in the next one