Skip to main content

Choose a staking flow

The Staking API creates validators in two ways:

Direct 1.0

To start staking on the Ethereum network using the Staking API:
  1. Set up nodes for staking using P2P infrastructure.
  2. Check the status of the node set-up operation.
  3. Construct a serialized transaction to deposit the stake amount with a smart contract.
Get an authentication token to start using Staking API. Request examples are provided using cURL.
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. P2P.ORG recommends upgrading to the 0x02 withdrawal credentials to enhance your functionality. It can be done in two ways:For more details, see Pectra Upgrade overview.However, upgrading to the new address format is not necessary, all existing endpoints remain supported. The flow below (Direct 1.0) creates both 0x01 and 0x02 validators. Use it when you need fine-grained control over validator count and effective balance, or want to broadcast the deposit transactions yourself.
1

Create setting-up node request

  1. Prepareid that is an arbitrary UUID. Generate it in one of the following ways:
  2. Set up staking nodes through the P2P infrastructure by sending a POST request to /api/v1/eth/staking/direct/nodes-request/create. Use https://api-test.p2p.org for testing or https://api.p2p.org for production. Example request:
    • id — arbitrary UUID. You can later use that UUID to check the status of the set-up operation.
    • type — staking operation type:
      • REGULAR— default value for native staking transactions. Set the REGULAR operation type for this flow.
      • RESTAKING— value that is used to initiate a restaking operation with the EigenPod address.
      • MANAGED_SSV— creates distributed validators that P2P runs on the SSV network. See SSV Managed. The deprecated SSV 1.0 type SSV is rejected.
    • validatorsCount — number of validators, from 1 to 3,125 per request. A 0x01 validator holds 32 ETH; a 0x02 validator holds 32–2,048 ETH.
    • amountPerValidator — amount to stake per validator in Gwei, from 32000000000 (32 ETH) to 2048000000000 (2,048 ETH). If you set it and omit withdrawalCredentialsType, the API uses 0x02. If you omit both, it uses 32 ETH and 0x01. A 0x01 request above 32 ETH is rejected. All validators in one request use the same amount.
    • withdrawalCredentialsType — withdrawal credentials preferred format: 0x01 or 0x02.
    • withdrawalAddress — withdrawal address for the validators.
    • eigenPodOwnerAddress — owner of the EigenPod address. Used in the restaking flow.
    • feeRecipientAddress — fee recipient address.
    • controllerAddress — for the validators.
    • nodesOptions:
      • location — node location. Currently, only any is supported.
      • relaysSet — Miner Extractable Value () relay selection.
    Example response:
2

Check request status

After setting up the node, check the status of the node set-up operation by sending a GET request to /api/v1/eth/staking/direct/nodes-request/status/{id} . You must poll this until status is ready.Example request:
  • id — UUID that was specified in the node set-up request.
This example response was obtained on Hoodi. On mainnet, forkVersion is 00000000 and eth2NetworkName names mainnet.
Example response:
  • status — current status of the nodes request:
    • init — node request was created.
    • processing — node request is in progress.
    • ready — backend has the deposit data for the node request.
    • cancel — something went wrong, and the deposit data was not created. This covers failed generation, exhausted retries, expired requests and cancellation by an administrator. A request does not stay in processing indefinitely, so handle cancel when polling.
  • amountPerValidator — amount of tokens to stake in Gwei per validator.
  • withdrawalCredentialsType — withdrawal credentials preferred format: 0x01 or 0x02.
  • depositData:
    • pubkey — validator public key.
    • signature — validator signature.
    • withdrawalCredentials— withdrawal address credentials, passed in the expected format by the Ethereum deposit smart contract.
    • amount — amount of ETH, denominated in Gwei, that is being deposited.
    • depositDataRoot — SHA-256 hash of the SSZ-encoded depositData object. Used as a protection against malformed input.
    • depositMessageRoot — cryptographic hash of the Merkle tree’s root, ensuring the integrity and authenticity of the deposit data.
    • forkVersion — version of the network fork that the deposit is intended for. It helps in aligning the deposit with a specific version of the protocol.
    • eth2NetworkName — name of the Ethereum 2.0 network where the deposit is made.
    • depositCliVersion — version of the deposit command-line interface (CLI) tool that was used to generate the deposit data.
    • nonce — returned only for MANAGED_SSV requests. SSV registration nonce of the validator; submit deposits in strictly ascending nonce order.
3

Prepare staking transaction

After setting up the nodes and successfully generating the depositData, retrieve it and proceed with make the deposit.There are two flows to make a deposit:The current P2pEth2Depositor (v3) supports 0x01 and 0x02 validators and a separate amount per validator.

Batch deposit (P2pEth2Depositor)

Create a serialized transaction for depositing the stake amount and send it as a POST request to /api/v1/eth/staking/direct/tx/deposit.
  • withdrawalAddress — withdrawal address for the validators.
  • depositData:
    • pubkey — validator public key.
    • signature — validator signature.
    • withdrawalCredentials— withdrawal address credentials, passed in the expected format by the Ethereum deposit smart contract.
    • depositDataRoot — hash of the deposit data.
This example response was obtained on Hoodi. On mainnet, chainId is 1 and to is the mainnet P2pEth2Depositor address.
Example response:
  • serializeTx — serialized unsigned transaction.
  • to — recipient address for this transaction.
  • gasLimit — maximum 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.
  • type — EIP-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.
Use serializeTx from the previous step to sign and send the signed transaction to the Ethereum network.Broadcasting this transaction deposits the stake for every validator in the request. The P2pEth2Depositor contract forwards the ETH to the beacon deposit contract in the same transaction and holds none of it.

Ethereum direct deposit

Use this if you prefer to interact with the official Ethereum contract without a proxy.
  1. Take pubkey, withdrawalCredentials, signature and depositDataRoot for each validator from the status response.
  2. Go to the Official Ethereum Deposit Contract
  3. Call deposit once per validator, sending that validator’s amount (converted from Gwei to wei). For MANAGED_SSV, submit in ascending nonce order.
After your deposit is successful, your validator will enter the activation queue and soon start performing the validator tasks.

Smart contracts

Current addresses

Returned by the API endpoint; forwards to Beacon DepositContract.
  • Mainnet 0xa6CF239220A8a9939d3207DFD8f26Cd5e4f36aE6
  • Hoodi 0xDA2934020Efd473Fac5cd73BDDE440A719bF4c59

Previous addresses

Legacy P2pEth2Depositor v1 and v2. Deprecated: they deposit a fixed 32 ETH per validator and cannot create 0x02 validators. Existing on-chain integrations keep working; the API now returns transactions for v3 only.

v2

  • Mainnet 0x8e76a33f1aFf7EB15DE832810506814aF4789536
  • Hoodi 0xE74b8401Bc0481c1485704eD4B49eE362831F844
Github Audit

v1

  • Mainnet 0x4CA21E4D3A86e7399698F88686f5596dBe74ADEb
  • Hoodi 0x375e183efA05fb2bb66Cd0e7C3a05D9942046612
Github Audit