Skip to main content
To initiate a withdrawal on the Ethereum network using the Staking API, follow these steps:
  1. Prepare the withdrawal transaction.
  2. Sign and broadcast the transaction.
Request examples are provided using cURL. Before initiating the withdrawal flow, please note that only the address set as the or withdrawal address can initiate a validator exit via our smart contract. If the transaction sender doesn’t match the eligible address, the validator exit will not be initiated.
Please noteOn May 7, 2025, the major Ethereum network upgrade was carried out that brought many benefits for clients who use ETH or SSV validators. In particular, for clients with 0x02 withdrawal credentials, partial withdrawals are available.For more details, see Pectra Upgrade overview.
1

Prepare withdrawal transaction

Create a serialized transaction to initiate the withdrawal process utilizing the functionalities of P2P smart contract and send it as a POST request to /api/v1/eth/staking/direct/tx/withdrawal.Example request:
  • pubkeys — list of validators public keys.
Example response:
  • serializeTx — serialized unsigned transaction.
  • to — recipient address for this transaction.
  • gasLimit — maximum gas limit for this block.
  • data — transaction data.
  • value — amount this transaction is sending in Wei.
  • chainId — chain ID this transaction is authorized on, as specified by EIP-155.
  • typeEIP-2718 type of this transaction envelope.
  • maxFeePerGas — maximum price per unit of gas this transaction will pay for the combined EIP-1559 block’s base fee and this transaction’s priority fee in Wei.
  • maxPriorityFeePerGas — price per unit of gas in Wei, which is added to the EIP-1559 block’s base fee. This added fee is used to incentivize miners to prioritize this transaction.

P2P smart contracts

Mainnet 0x4E1224f513048e18e7a1883985B45dc0Fe1D917eHoodi 0x158f2bbEf21CF9F92Cf4A294999BA422948c8242SourceAudit
2

Sign and broadcast transaction

Use the following example of the code to sign and broadcast the withdrawal transaction.