[ETH] Shanghai Upgrade: The Hot Potato, Beacon Chain Withdrawal

BQ비큐
Hashed Team Blog
Published in
10 min readApr 4, 2023

-

Reviewed by: @HenryKey , @WoosterHan , @Subinium

Infographics by: @Subinium

Disclosure: Hashed has established, maintained, and enforced strict internal policies and procedures designed to identify and effectively manage conflicts of interest related to its investment activities. This content is provided for informational purposes only, and should not be relied upon as legal, business, investment, or tax advice. Furthermore, references to any securities or digital assets are for illustrative purposes only and do not constitute an investment recommendation or offer to provide investment advisory services.

The long-awaited ETH Shanghai upgrade is now on deck. Though the changes that will take place in the upcoming upgrade have rather been clearly outlined, rumors and misinformation have been spreading throughout the communities for the last few weeks.

In this article, we’ll delve into the Shanghai upgrade and clarify the details.

The Timeline

The Shanghai Upgrade’s Goerli testnet is currently implemented. With the testnet on-going, the mainnet launch is scheduled to happen on April 12th, at 194048 Beacon Chain Epoch.

What is exactly changing in the Shanghai Upgrade?

The timeline does matter and shows the upgrade is imminent, but the question of higher importance would be: So what’s exactly changing in this Shanghai Upgrade?

Shanghai upgrade currently includes 5 EIPs (Ethereum Improvement Proposal). These EIPs specifically outline the changes that will be implemented to the protocol after the upgrade. The EIPs are as follows:

EIP-3651: Warm Coinbase

EIP-3855: PUSH0 instruction

EIP-3860: Limit and meter initcode

EIP-4895: Beacon chain push withdrawals and operations

EIP-6049: Deprecate SELF-DESTRUCT

The hot potato: EIP-4895: Withdrawal of the Staked ETH

Before going through others, let us start off with EIP-4895, the hotly anticipated, and the most rumored Beacon chain Withdrawal function.

Background information

Currently, the Ethereum Beacon Chain is basically a one-way gate. The Beacon Chain only allows validators’ staking deposits and there is no way for validators to withdraw their staked funds back to the EVM (Ethereum Mainnet).

As a result, the beacon deposit contract’s ETH holding has basically increased indefinitely since last December when the deposit was enabled, reaching ~16m ETH (Currently valued at $25b) at the time of the writing. About 520k validators have their ETHs staked in the beacon chain.

<https://etherscan.io/address/0x00000000219ab540356cbb839cbe05303d7705fa>
ETH Staked & Number of Validators

The implementation of the EIP-4895 basically allows these staked ETH, and the rewards earned with them to be withdrawn back to the EVM.

Although the rumors around the potential sell pressure from the un-staked ETHs is a hot potato, it is important to note that the EIP-4895 was designed to enable the withdrawal function to be performed while the Ethereum’s security is maintained and that the withdrawals are processed through a strictly controlled timeline. We’ll get back to this after understanding the basics of the beacon chain withdrawal function.

How does the withdrawal work?

i) Push / Pull withdrawal? Gasless Withdrawal?

The withdrawal process of the staked ETHs in the Beacon Chain will be carried out through a ‘push’ withdrawal process.

<Pull-Type Withdrawal>

Most of the POS staking withdrawals happen through a ‘pull’ withdrawal process where users actually interact with the execution layer (mainnet) to submit a ‘withdrawal request’ and ‘pull’ their assets out of the contract.

This is not the case for ETH. Though the pull process has minimal client development effort and is easy to implement, processing the withdrawal through the ‘pull’ process requires gas, and takes up block space.

The EIP-4895 was proposed to instead take a ‘push withdrawal’ approach where most of the actions are performed by the beacon chain itself, not by each validating node’s requests.

<Push-Type Withdrawal-1>

To put it simply, the push withdrawal process happens as the consensus layer (Beacon Chain) makes a ‘queue of withdrawal’ to be processed rather than accepting the ‘user’s list of withdrawal requests’ from the execution layer.

Before any withdrawals are included in the queue, the consensus layer first starts checking if any of the validators are willing to withdraw their assets back to the EVM by checking their withdrawal credentials.

The validators who wish to perform any kind of withdrawals are first required to set their withdrawal credentials from 0x00 (BLS) to 0x01 (Execution Address) format. This is rather a simple process that could be done by the validators within a short period of time. This migration is a one time process that is irreversible, and it is important to note that validators can still perform validating tasks with a 0x01 withdrawal credential until it submits an exit request to the network.

The consensus layer scans the nodes in order and identifies the nodes that have set their withdrawal credentials to 0x01 format, and then further identifies the nodes that have their exit message included on-chain within this group.

The identified nodes and their withdrawals are then included in the queue in order. There are two types of withdrawals which are namely ‘partial withdrawal’ from nodes that have changed their withdrawal credentials to 0x01 and ‘full withdrawal’ from nodes that have changed their credentials AND have submitted an exit request to the network, but this will be explained later.

The consensus layer verifies if the withdrawal is ‘valid to go’ and ‘pushes’ the queue with a certain number of lists of nodes to the execution layer as a system-level operation.

When this queue is submitted in the execution layer, the EVM applies the ETH balance increase to the given withdrawal address in a system-level operation (image below).

<Push Type Withdrawal Architecture>

It is important to note that this process is done in a ‘system-level operation’. Imagine the way in which Coinbase payments of mining rewards or block rewards are awarded to the wallets in a blockchain for better understanding.

This basically means that on the user side, the balance is automatically updated, and you wouldn’t need to pay any transaction fees or interact with smart contracts when receiving the ETHs you have withdrawn.

In a nutshell, when you’re in the queue, there is nothing to do other than wait for the balance update in your withdrawal address.

The strong advantage of the push withdrawal process is that the execution layer (ETH Mainnet) does not need to track consumed withdrawals, and it does not have to allocate any block space for ‘withdrawal transactions’.

ii) Partial Withdrawal/ Full Withdrawal

There are two kinds of withdrawal that can be added to the queue mentioned above. Once validators have their withdrawal credentials set to 0x01 format after the EIP-4895 implementation, the validators can perform 1) Partial withdrawal and 2) Full withdrawal

a) Partial Withdrawal

Partial withdrawal is for validators who have excessive amounts of ETHs staked and wish to withdraw ONLY the excessive amount.

The minimum ETH requirement of being a validator is 32 ETHs, however, most of the validators possess a balance of over 32ETHs since the staking rewards accrued are added to their balance.

According to Glassnode, currently each validator holds an average of 34 ETHs. For validators, it can be said that it is reasonable for each validator to withdraw an average of 2 ETHs for capital efficiency. With current ~520k validators this equals to ~1m ETHs available for partial withdrawal

<Average Balnace of ETH Validators>

For the partial withdrawal, when the validators set their withdrawal credentials to 0x01, they are automatically inserted in the waiting queue in order. Once they are included in the queue, the queue is sent and processed in the EVM, and the excessive amount of ETH is accordingly added to their withdrawal address balance.

b) Full withdrawal

Full withdrawal will be enabled for validators who want to fully exit the beacon chain. This is not automatically done, hence the validator's approval is needed. Once the validator approves the withdrawal by sending an exit message (BLSToExecutionChange) on-chain, it is sent to the queue in order and the validator’s full balance will be added to the withdrawal address balance.

Selling pressure? How often does the withdrawal happen?

There are a lot of misconceptions regarding the withdrawal amount and the selling pressure the EIP-4859 will bring. Now we’ve covered the basic mechanisms of the withdrawal, let’s move on to discussing the anticipated withdrawal outcomes.

i) Partial Withdrawal

As mentioned above, there are currently about 1m ETHs that could be potentially withdrawn through the partial withdrawal process.

Though the amount seems large, all the withdrawals won’t happen at once.

According to the current EIP-4895 design, 16 partial withdrawals will be processed in each slot which is currently being created every 12 seconds.

Taking into note that there are currently ~520k validators on the beacon chain, if all the validators start withdrawing their excess amount of ETH, the first round-robin of partial withdrawal is anticipated to finish in around 4~6 days.

It is important to note that the amount of expected withdrawal and expected time measured can be shorter depending on the percentage of validators who have 0x01 withdrawal credentials.

ii) Full withdrawal

For full withdrawals, it is a different story. Since it is not automatically processed and requires the validators’ approval, the exact amount of the ETHs that will be withdrawn over a long time span is difficult to estimate.

However, like the partial withdrawal, all of the full withdrawal also does not happen all at once.

For every epoch (32 slots) a certain number of validators’ full withdrawals can be included.

Currently, the validator churn limit for the beacon chain is defined below:

<https://github.com/ethereum/consensus-specs/blob/dev/specs/phase0/beacon-chain.md#get_validator_churn_limit >

This is the limit on the number of validators onboarding to the beacon chain per epoch. The exit count for validators leaving the beacon chain is equally applied.

Putting it simply, the number of validators that can exit the beacon chain equals to ( # of active validators / 65536) rounded down to an integer number. (minimum 4)

At the time of the writing where ~520k validators are active, the maximum number of validators that could exit the network would be around 1,575 validators per day.

Noting that the validators currently hold an average of 34 ETHs in their balance, the maximum possible ETH staked withdrawal from the full withdrawal per day can be said to be around 53K of ETH. (~0.3% of the total staked supply)

<Maximum Exit of Validators Per Epoch>

iii) Sell Pressure vs Staking Demand

a) Sell Pressure

Referring to the data analyzed above, when the Shanghai upgrade is implemented, assuming that most of the validators have successfully migrated to a 0x01 credential, ~1m ETHs from the partial withdrawal are expected to be withdrawn for a time span of 4~6 days. For the full withdrawal, an estimate of ~210K to ~320K is expected to be withdrawn for the same time span.

This leads to the conclusion that theoretically, a total of 1.2m~1.3m ETHs withdrawal could happen for the first 4~6 days of the EIP-4859 implementation which can be argued as a notable selling pressure.

When the partial withdrawal has done its first round-robin, withdrawing all the excessive ETHs that have been accrued in the network since the merge, the amount of the withdrawable ETHs will be significantly lower since the partial withdrawal will then process less than 2~4K ETHs per day.

b) Staking Demand

On the opposite side, it could be argued that the expected amount of ETHs withdrawal has already been sold through assets such as stETH. Since the staked ETH is already tradable in the marketplace, it is reasonable to assume that the selling pressure of a notable amount of staked ETH withdrawal has already been absorbed through the market.

The EIP-4895 upgrade also can be regarded to bring flexibility for institutional investors in staking ETHs, and when successfully tested with uncertainties cleared, it could in fact also bring uprise in the actual staking demand.

Conclusion & Takeaway- EIP-4895

  1. While the EIP-4895 upgrade has been a hot potato of the season, it is important to note that the EIP-4895 was designed for the purpose of enabling beacon chain withdrawals with minimum impact on the Ethereum network’s security.
  2. The ‘push method’ the EIP-4895 embraced enables beacon chain staking withdrawals to be in a form of a gasless function. The balance of the wallets is updated through a system-level operation similar to the coinbase rewards.
  3. It is important to highlight that the current EIP-4895 design offers two kinds of withdrawals: partial and full withdrawals, that could be utilized by the validators according to their preference. Partial withdrawals happen automatically for the validators with 0x01 withdrawal credentials. Full withdrawals need validators to be sent on-chain.
  4. The withdrawals do not happen all at once. Partial withdrawals are estimated to finish its first round robin in a 4~6 days time span. The number of full withdrawals processed will depend on the number of active validators at the upgrade time. Currently, 1,575 validators’ full withdrawals are anticipated per day.
  5. The selling pressure is expected to be higher in the first 4~6 days when the partial withdrawals are doing their first round-robin. Theoretically, a total of 1.2m~ 1.3m ETHs can be withdrawn for the first 4~6 days (though it depends on the proportion of validators that has a 0x01 withdraw credential at the time of the upgrade). This can be argued as some level of sell pressure,
  6. On the opposite side, the widely used LSD protocols can be said to have already mitigated the selling pressure to a certain degree. When the EIP-4895 is successfully implemented, it can also be said that the staking demand will rise with new opportunities for ETH staking services and the resolution of an uncertainty ETH staking previously had.
  7. The EIP-4895 is an important update that will pave the path for the complete Proof of Stake Ethereum. It is crucial for the community to actively observe the update and to participate in the testnets for the upgrade to be successfully implemented in the Ethereum Network.

--

--