Deposits Locked, Withdrawals Minted

Offchain Labs
Offchain Labs
Published in
5 min readMar 30, 2023

--

tl; dr: This article presents a high-level technical overview of the upcoming validator withdrawal process in Ethereum Proof of Stake. The long-awaited Capella/Shanghai hard fork will introduce the ability to withdraw the validator balance into an Ethereum address. The article also addresses some of the misconceptions and implications of this change.

twitter: @jameshe_eth

Validator withdrawals will finally become available on Ethereum after the Capella/Shanghai hard fork. However, the method for withdrawals might surprise you. To understand how withdrawals work, let’s first review deposits.

In Ethereum Proof-of-Stake, you need to deposit (also known as “stake”) 32 ETH by interacting with the deposit smart contract¹ and providing your validator information as defined in the consensus specs². The validator information used in this process is generated by tools like the staking-deposit-cli³. It’s essential to keep in mind the information provided, particularly the validator public key, which is a unique identifier for participating in the Ethereum network to earn rewards. Additionally, there is an associated withdrawal credentials field which is usually a 0x00prefixed hash of your public withdrawal key but will change its value to initiate withdrawals. We will cover that later on.

Once you successfully use this contract, your 32 ETH will be locked in the contract, and the validator will wait to be activated. Some depositors mistakenly believe that the deposit smart contract operates like an escrow account, facilitating the rewards and penalties of each depositor’s balance until they are ready to withdraw. However, upon closer inspection of the deposit contract code¹, it appears that it only stores validator information and the initial ETH deposit. There are no associations between funds and Ethereum addresses, no capabilities to update funds in the form of rewards or penalties, and no way to upgrade the contract itself. The contract currently holds over 17 million ETH, as shown in this Etherscan screenshot. So, what does this contract actually do?

The deposit contract serves as a reference point for a metaphorical one-way bridge of funds from an Ethereum address in the execution chain (previously known as the Ethereum proof-of-work chain or Eth 1 chain) to a validator on the beacon chain. The beacon chain is a separate blockchain that was launched on December 1st, 2020 with a proof-of-stake consensus mechanism. The deposit contract provides validator information to the beacon chain, allowing it to generate initial validator balances and top off existing validator balances on its own chain. Rewards and penalties against these validator balances occur on the beacon chain, and the original deposits in the deposit contract on the execution chain are not affected. Since September 15th, 2022 (referred to as The Merge), the execution chain has relied on the beacon chain for consensus. However, Ethereum Proof-of-Stake continues to essentially run with two separate chains.

The illustration above shows how the chains run in parallel and illustrates some of the separated responsibilities. The beacon chain maintains the balances for the validators and handles Ethereum’s consensus, while the execution chain maintains Ethereum addresses, smart contracts, and processes transactions. Since Ethereum addresses cannot directly interact with validators or vice versa, some event needs to bridge balances from the beacon chain back to an Ethereum address that exists on the execution chain, to allow for withdrawals to happen.

The chosen technique to achieve this is by processing the withdrawal during block inclusion. This occurs during a period when both the beacon and the execution chain’s states are updated. By doing this, we can simultaneously reduce the balance of the validator on the beacon chain state and increase the balance on the specified address in the execution chain state.

Validators become eligible for withdrawals by updating their 0x00 prefixed withdrawal_credentials to a 0x01 prefix ending with the chosen execution address through the new submitPoolBLSToExecutionChange Beacon API⁴ endpoint. To use this endpoint, you must first generate a request message using the validator's withdrawal BLS keys with the staking-deposit-cli³. The generated request contains information and a signature necessary to update the withdrawal_credentials field. Note that this field can only be updated once!

There is a two-step waiting process for withdrawals: first, the validator waits for its withdrawal_credentials to be updated, then the validator waits for the partial or full withdrawal to be included in a block. Partial withdrawals are earnings over 32 ETH that are automatically withdrawn on validators with updated withdrawal_credentials included in the block. On the other hand, full withdrawals require an additional step of exiting your validator, either voluntarily or through other circumstances like being slashed, and adds an additional step for the waiting process. Full withdrawals will release the entire validator’s balance into the execution address.

To summarize, the withdrawal of validators with 0x01 prefixed withdrawal_credentials in block processing will bridge back the validator ETH balances from the beacon chain to the execution chain. The interesting aspect is this bridging event is not an Ethereum transaction but a new gasless state change that mints the bridged balance directly into the Ethereum address. This also means if you direct the withdrawal to a smart contract address, you won’t be able to trigger any smart contract code and will only be able to withdraw from your balance. This avoids the complexity of running smart contract code during withdrawals, which could lead to failure in the worst case.

Withdrawing funds using this method is more simple and more reliable, but it slightly complicates the accounting of the Ethereum Blockchain’s total ETH supply. During the withdrawal process, the ETH bridged from the beacon chain to the execution chain is all new, but the original ETH in the deposit contract remains locked. After this feature is released, it may appear that the ETH supply has significantly increased, but in reality, values may be double-counted because the locked ETH in the deposit contract is not burned when new ETH is minted for withdrawals.

Our team at Offchain Labs is ecstatic to have completed the validator lifecycle with this upgrade and finally release each staker’s earnings. For those interested in withdrawals, please refer to the Ethereum withdrawal FAQs or the Capella/Shanghai upgrade specifications. Prysm users can also consult our detailed guide for withdrawals when the feature becomes available after the upgrade.

--

--

Offchain Labs
Offchain Labs

We’re Building Arbitrum, a scaling solution for Ethereum. Learn more at https://offchainlabs.com/ and http://arbitrum.io/.