- Set up nodes for staking using P2P infrastructure.
- Check the status of the node set-up operation.
- Construct a serialized transaction to deposit the stake amount with a smart contract.
1
Create setting-up node request
-
Prepare
idthat is an arbitrary UUID. Generate it in one of the following ways: -
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 theREGULARoperation type for this flow.RESTAKING— value that is used to initiate a restaking operation with the EigenPod address.MANAGED_SSV— value that is used to initiate a managed SSV cluster.
validatorsCount— number of validators. One validator is equal to 32 ETH.amountPerValidator— amount of tokens to stake in Gwei per validator. Note that if the amount is more than 32 ETH (1 ETH = 10⁹ Gwei), thewithdrawalCredentialsTypeparameter defaults to0x02.withdrawalCredentialsType— withdrawal credentials preferred format:0x01or0x02.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, onlyanyis supported.relaysSet— Miner Extractable Value () relay selection.
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.
-
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.
-
amountPerValidator— amount of tokens to stake in Gwei per validator. -
withdrawalCredentialsType— withdrawal credentials preferred format:0x01or0x02. -
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-encodeddepositDataobject. 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.
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:P2P Proxy deposit
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. 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.
serializeTx from the previous step to sign and send the signed transaction to the Ethereum network.By broadcasting this transaction, you are depositing the required stake amount in the Ethereum deposit smart contract by using the P2P smart contract as a proxy.Ethereum direct deposit
Use this if you prefer to interact with the official Ethereum contract without a proxy.- Take the pubkey, signature, and depositDataRoot from the deposit-data response.
- Go to the Official Ethereum Deposit Contract
- Manually execute the
depositfunction with your 32 ETH and the provided data.
Smart contracts
Current addresses
Returned by the API endpoint; forwards to Beacon DepositContract.
Previous addresses
Direct on-chain deposits (v1), still accepted.Github Audit