make_withdrawal_credentials
Build 32-byte ETH1 withdrawal credentials from an address
Build 32-byte ETH1 withdrawal credentials from an Ethereum address. The returned value is passed as withdrawal_credentials when calling compute_deposit_data_root and the deposit contract's deposit() function.
Signature
def make_withdrawal_credentials(address: str) -> bytesParameters
address
str
Hex-encoded Ethereum address (with or without 0x prefix)
Returns
bytes — 32-byte withdrawal credentials.
Raises ValueError if the decoded address is not exactly 20 bytes.
Output Format
┌──────┬──────────────┬──────────────────────┐
│ 0x01 │ 11 zero bytes│ 20-byte address │
└──────┴──────────────┴──────────────────────┘
1 byte 11 bytes 20 bytes = 32 total0x01— ETH1-style withdrawal credential type byte11 zero bytes — reserved padding
20-byte address — the Ethereum address that can withdraw funds
Example
Notes
Accepts addresses with or without
0x/0XprefixCase-insensitive — both checksummed and lowercase addresses produce the same result
This function only creates ETH1 credentials (type
0x01), not BLS credentials (type0x00)
See Also
compute_deposit_data_root — Uses
withdrawal_credentialsas inputDeposit Contract — ABI, address, and deposit requirements
Last updated

