Partial Withdrawals

For validators using the 0x02 type of credentials, partial withdrawals are now available. If the validator's effective balance is above 32 ETH, it is possible to withdraw excessive funds without exiting the validator.

To withdraw from a 0x02-enabled validator, follow the steps below:

  1. Create a withdrawal request.
  2. Sign and broadcast the transaction.

Request examples are provided using cURL.

👍

The flow is supported for both Ethereum and SSV validators via the same endpoint.

1. Create Withdrawal Request

The flow applies only to active validators using the 0x02 type of withdrawal credentials.

Send a POST request to /api/v1/eth/staking/direct/tx/withdrawal/partial.

Example request:

curl --request POST \
  --url https://api.p2p.org/api/v1/eth/staking/direct/tx/withdrawal/partial \
  --header 'Content-Type: application/json' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --data '{
    "pubkeys": ["0xffC08FcD7cFeF5c70fB2b0e1f2A8EaA690AaE2bDFfa5dBEc4dEef31DcC0B19eB1f9Cebe3E2fe9eefBD9a1BDF6FD89b39"],
    "amount": "10000000000000"
}'
  • pubkeys — list of validators' public keys.
  • amount — amount of tokens in ETH to withdraw from each validator. Note that remaining balance must be equal or more than 32 ETH. If specified as 0, the validator will be fully withdrawn and exit the network.

Example response:

{
  "error": null,
  "result": {
    "serializeTx": "0x02f902d705808301674e8508530af16e830186a094681a1b3441c6bfb12f91651efd9f02c83c0702938901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aa5f27070a21d79455c4a9b73c0aa4a8b1a65a1fb530d7fd8e6cd23aa16660679ac43ee4861098f6d9166aed3a4d8abb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002001000000000000000000000028c84612d37de9209018ad96167f12169b653e9a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060978c565cd915f4e885b4201093d1501697610eb9ee99b9b60b70434dc330e98d5b42927725304ded48483a8b8f39506d09bcb22ee18d4f6b50257946ac5ee360385308d95c0e2bc963902d42e985c29ee489aa3c989ac1561c952a6424f107a800000000000000000000000000000000000000000000000000000000000000014cb452f6e3f10ba2175c86a0284f53fcb61404b458393391abc3d5622e3e55cdc0",
    "to": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
    "gasLimit": "100000",
    "value": "10000000000000",
    "data": "0xa49b131b0200000000000000000000008eb2277e54a2a7db9b7c0d9fa9b78dcb35f74866000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000003fcd8d9acac042095dfba53f4c40c74d19e2e9d9000000000000000000000000000000000000000000000000000000000000251c0000000000000000000000003202b5b0602274197ccb22b8c02cec9539990c7c00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000e86b78000ed3b7b820ac6a39b46602356daee0602180fefa69a94774c3209a9f5ad1df42aa2c426b1494a39afc4ee79a528dca95807f5a1b518c8fb0a4df1be92b8a8b6e5f4fccf35f3975f9cf64aa92f4896f2553a5ba9fb0b13cabb25f21a2881f027d9703bfa57f45a514fff7bcc1b8020c2a3ab0581cfbb748dfe612a14acef40bc61de068cf3117e8227ab1315e0302f97e17d5b8948aa8071645b27ad74f669783d363fbc7e9dd58c01e535aff418b2fdbff56a55212e25efbc6b963bb048d98ecc1d03020f890bbf7518fd2463afb82ffdf452863268bdae4eae18d6108dce9ef803669f466000000000000000000000000000000000000000000000000",
    "chainId": 560048,
    "type": 2,
    "maxFeePerGas": "2211533588",
    "maxPriorityFeePerGas": "69385672"
  }
}
  • 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.

2. Sign and Broadcast Transaction

Prepare serializeTx from the previous step to sign and broadcast the signed transaction to the Ethereum network.