EIP-4863 · Stagnant · Core · 2022-02-28
EIP-4863: Beacon chain push withdrawals
An early design for staking withdrawals that would have pushed ETH from the beacon chain into the EVM with a new gas-free withdrawal transaction type; later replaced by EIP-4895's withdrawal operations.
What problem does it solve?
After the Merge, validators' staked ETH and rewards lived on the beacon chain (consensus layer) with no way to move back to normal execution-layer accounts. Some mechanism had to bring that ETH into the EVM.
There are two broad options:
- Pull: expose beacon chain data to the EVM (e.g. with EIP-4788) and let users claim withdrawals from a contract, paying gas.
- Push: the protocol credits balances automatically when withdrawals are dequeued on the beacon chain.
EIP-4863 chose push. It is more involved in the core protocol but integrates a critical feature directly and gives validators automatic, gas-free withdrawals.
How it works
The EIP adds a new EIP-2718 transaction type, WITHDRAWAL_TX_TYPE = 0x3.
- Payload:
RLP([index, address, amount]).indexis a 64-bit ID that uniquely labels the withdrawal,addressis the execution-layer recipient, andamountis in wei. All values come from the consensus layer. - Processing: increase
address's balance byamount. That's it: no EVM code runs, the balance change is unconditional and must not fail, and there is no gas cost. - Block validity: withdrawal transactions must come after all other transactions in a block. Otherwise the block is invalid. This lets the beacon chain check them with a simple linear scan.
Why no gas? The consensus layer limits how many withdrawals reach each block, so the cost to the execution layer is negligible. Why only balance updates? Running general EVM code could fail, which would complicate beacon chain accounting.
Sample code
Illustrative encoding of a withdrawal transaction under this proposal (pseudocode):
import rlp
WITHDRAWAL_TX_TYPE = 0x03
def encode_withdrawal_tx(index: int, address: bytes, amount_wei: int) -> bytes:
assert 0 <= index < 2**64 and len(address) == 20
payload = rlp.encode([index, address, amount_wei])
return bytes([WITHDRAWAL_TX_TYPE]) + payload # EIP-2718 envelope
def apply_withdrawal(state, index, address, amount_wei):
state.balance[address] += amount_wei # no EVM call, no gas, cannot fail
Things to know
- Status: Stagnant. Its fork timestamp was left TBD and it was never deployed.
- It was superseded by EIP-4895, which keeps the push model but represents withdrawals as a separate list of system-level operations in the block body rather than as transactions. EIP-4895 is what went live in the Shanghai/Capella upgrade.
- Because withdrawals in either design do not run EVM code, a contract receiving them is credited without its
receivefunction being called. - The spec flagged this consensus-to-execution ETH transfer as needing very careful security review, since nothing like it existed in the EVM before.