EIP-7804 Withdrawal credentials change request (Withdrawal Credential Update Request)

No call decision · Consensus & staking · EIP status Draft · created 2024-10-31

Lets a validator create a new request type (0x03) at the execution layer to change the address and prefix (0x01 or 0x02) of its withdrawal credentials.

Why it is needed

Withdrawal credentials are the information that determines where a validator's staked ether is paid out. The Capella upgrade opened a path to convert an old BLS key into an execution-layer address, but there has been no way to change it again since. Even at that time there was significant demand to allow further changes, but it was deferred because building a communication channel between the execution layer and the consensus layer was complex. That complexity was later greatly reduced when Electra introduced the general execution request mechanism (EIP-7685). However, for an execution request to be made from a smart contract, the address sending the request must match the address in the validator's withdrawal credentials. A validator whose credentials are bound to an externally owned account (EOA) cannot change its credentials, so it can never use contract-based management. The only current alternative is to exit the validator and recreate it with new credentials. This proposal allows the credentials themselves to be changed, enabling security measures like key rotation and experimentation with new approaches to validator management.

What changes

Today

After EIP-7804

Who is affected

In depth

Request type and fields

Adds a new type, WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_TYPE (0x03), to the general execution request scheme from EIP-7685. The request has three fields. pubkey (Bytes48) is the target validator's BLS public key, old_address (Bytes20) is the address currently in the credentials, and new_address (Bytes20) is the address to be set. The request_data included in the block is the result of read_withdrawal_credential_update_requests(). old_address is not an arbitrary value supplied by the requester but is filled in by the contract as msg.caller, so only whoever actually controls the current credential address can create a valid request.

Predeploy contract

The request is received by a contract deployed at WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_PREDEPLOY_ADDRESS (0x09Fc772D0857550724b07B850a4323f39112aAaA). Its structure resembles the deposit, withdrawal, and consolidation request contracts, and has three code paths. First, adding a request requires a 68-byte input consisting of the validator's public key followed by the new address. Second, if the input length is zero, it returns the current excess request count. Third, when called by the system address, it pulls the requests to be included in that block off the queue. The detailed pseudocode, bytecode, and deployment method have not yet been written in the source material.

Queue and fee constants

Contract storage slots 0 through 3 are used respectively for the excess request count (EXCESS_WITHDRAWAL_CREDENTIALS_UPDATE_REQUESTS_STORAGE_SLOT), the request count (WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_COUNT_STORAGE_SLOT), and the queue's head and tail pointers. The queue body itself starts at slot 4 (WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_QUEUE_STORAGE_OFFSET). The maximum is 4 requests per block (MAX_WITHDRAWAL_CREDENTIALS_UPDATE_REQUESTS_PER_BLOCK), the target is 1 per block (TARGET_WITHDRAWAL_CREDENTIALS_UPDATE_REQUESTS_PER_BLOCK), the minimum fee MIN_WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_FEE is 1, and the fee update fraction WITHDRAWAL_CREDENTIALS_UPDATE_REQUEST_FEE_UPDATE_FRACTION is 17. EXCESS_INHIBITOR (2**256-1) is used for fee calculation before the first system call.

Block processing and block validation

For blocks where block.timestamp is greater than or equal to FORK_TIMESTAMP, after all transaction processing and block body request validation are complete, the client must execute the system subroutine by calling the contract with empty input as SYSTEM_ADDRESS (0xfffffffffffffffffffffffffffffffffffffffe). The response is processed as a type 0x03 request per EIP-7685. During block validation, the execution layer must verify that the commitment hash in the block header matches the hash of the list of execution requests sent by the consensus layer (including the new type 0x03).

Consensus layer processing logic

A new container WithdrawalCredentialUpdateRequest(validator_pubkey, old_address, new_address) is added, along with the block processing method process_withdrawal_credential_update_request and the state change method update_withdrawal_credentials. During processing, it checks in order whether the request's public key is in the validator list, whether has_execution_withdrawal_credential is satisfied, whether the last 20 bytes of the current credential match old_address, and whether the new prefix is ETH1_ADDRESS_WITHDRAWAL_PREFIX (0x01) or COMPOUNDING_WITHDRAWAL_PREFIX (0x02), returning silently if any check fails. If all checks pass, the credential is replaced with a value formed by concatenating the new prefix, 11 zero bytes, and the new address. When changing from 0x01 to 0x02, switch_to_compounding_validator is called. How churn rules should be applied in this case is left as a TODO in the source.

Security considerations

The source holds that ownership is defined as control over the account holding the withdrawal credential. For an EOA, ownership means possession of the private key; for a contract, it means control over that contract. Since the request's old_address is filled with msg.caller, only the party controlling the current credential can trigger a change. The authors therefore judge that allowing the change does not by itself add a security problem. However, the source itself notes that further discussion is needed.

Incomplete specification at the Draft stage

This EIP is in Draft status, so its content may change. FORK_TIMESTAMP is TBD and which fork it will be included in has not been decided. The Rationale, Backwards Compatibility, and Test Cases sections are empty, and the consensus layer specification is marked as only a summary of changes, not yet complete. Bytecode and deployment details for the pre-deployed contract are also not yet available. No core developer call decision on forking this EIP in has been confirmed to date.

Original EIP · ← EIPs