Getting Started
The EigenLayer restaking flow includes the following steps:
- Create EigenPod address: construct a serialized transaction to generate an EigenPod address, which your validator can use as a withdrawal address.
- Create Staking Request: set up nodes for staking using P2P infrastructure.
- Check Request Status: check the status of the node set-up operation.
- Prepare Staking Transaction: construct a serialized transaction to deposit the stake amount with a smart contract.
- Verify Withdrawal Credentials: construct a serialized transaction to verify the validator withdrawal credentials on-chain.
- Delegate Restake to Operator: construct a serialized transaction to delegate the restake amount to the EigenLayer node operator.
Get an authentication token to start using Restaking API.
Request examples are provided using cURL.
1. Create eigenPod address
-
Retrieve a serialized transaction to generate an EigenPod address by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/create-pod.
Example request:
curl --request POST \ --url https://api.p2p.org/api/v1/eth/staking/eigenlayer/tx/create-pod \ --header 'accept: application/json' \ --header 'authorization: Bearer <token>' --header 'content-type: application/json'Example response:
{ "result": { "serializeTx": "0x02f902d705808301674e8508530af16e830186a094681a1b3441c6bfb12f91651efd9f02c83c0702938901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aa5f27070a21d79455c4a9b73c0aa4a8b1a65a1fb530d7fd8e6cd23aa16660679ac43ee4861098f6d9166aed3a4d8abb0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000002001000000000000000000000028c84612d37de9209018ad96167f12169b653e9a000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060978c565cd915f4e885b4201093d1501697610eb9ee99b9b60b70434dc330e98d5b42927725304ded48483a8b8f39506d09bcb22ee18d4f6b50257946ac5ee360385308d95c0e2bc963902d42e985c29ee489aa3c989ac1561c952a6424f107a800000000000000000000000000000000000000000000000000000000000000014cb452f6e3f10ba2175c86a0284f53fcb61404b458393391abc3d5622e3e55cdc0", "to": "0x30770d7E3e71112d7A6b7259542D1f680a70e315", "gasLimit": "10000000", "data": "0x84d81062", "value": "0", "chainId": "17000", "type": "2", "maxFeePerGas": "1000040", "maxPriorityFeePerGas": "1000000" }, "error": {} }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.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
serializeTxto sign and send the signed transaction to the Ethereum network.By broadcasting this transaction, you are generating an EigenPod address. The Ethereum address used to sign this transaction will become the
eigenPodOwnerAddress.
2. Create staking 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 with the
RESTAKINGtype to /api/v1/eth/staking/direct/nodes-request/create.Example request:
curl --request POST \ --url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create \ --header 'accept: application/json' \ --header 'authorization: Bearer <token>' \ --header 'content-type: application/json' \ --data ' { "id":"6df58880-c4c9-484a-8fc4-7f7668fe9522", "type": "RESTAKING", "validatorsCount": 1, "eigenPodOwnerAddress": "0x27AABeE07E0dbC8b0de20f42b1a1980871314Ef5", "feeRecipientAddress":"0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "controllerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "nodesOptions":{ "location": "any", "relaysSet": null } } 'id— arbitrary UUID. You can later use that UUID to check the status of the set-up operation.type— staking operation type:RESTAKING— value for initiating a restaking operation.REGULAR— default value used for native staking transactions.
validatorsCount— number of validators. One validator is equal to 32 ETH.feeRecipientAddress— fee recipient address.eigenPodOwnerAddress— owner of the EigenPod address, created in the previous step.controllerAddress— controller address for the validators.nodesOptions:-
location— node location. Currently, onlyanyis supported.relaysSet— Miner Extractable Value (MEV) relay selection.
Example response:
{ "result": true }
3. Check request status
Check the status of the node set-up operation by sending a GET request to /api/v1/eth/staking/direct/nodes-request/status/\{id}.
Example request:
curl --request GET \
--url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/status/6df58880-c4c9-484a-8fc4-7f7668fe9522 \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'
--header 'content-type: application/json'id— UUID that was specified in the node set-up request.
Example response:
{
"result": {
"id": "6df58880-c4c9-484a-8fc4-7f7668fe9522",
"status": "ready",
"type": "RESTAKING",
"validatorsCount": 1,
"withdrawalAddress": null,
"eigenPodAddress": "0x1433F808a4867aDEeEb3AE0Df58691C252269A2C",
"eigenPodOwnerAddress": "0x27AABeE07E0dbC8b0de20f42b1a1980871314Ef5",
"controllerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17",
"feeRecipientAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17",
"depositData": [
{
"pubkey": "0xaed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13",
"signature": "0x91b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf5",
"depositDataRoot": "0xd0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89",
"withdrawalCredentials": "0100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c",
"amount": 32000000000,
"depositMessageRoot": "04f641c39de982aee68cc7c78bd23bcafffed91fd1c455282b651e0c8d6c4e20",
"forkVersion": "01017000",
"eth2NetworkName": "hoodi",
"depositCliVersion": "2.7.0"
}
],
"createdAt": "2025-01-29T15:07:08.399Z"
}
}-
id— UUID that was specified in the node set-up request. -
status— current status of the node request:init— node request is 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.
-
validatorsCount— number of validators. One validator is equal to 32 ETH. -
withdrawalAddress— withdrawal address for the validators that is set tonullby default; corresponds to the EigenPod address. -
eigenPodAddress— EigenPod address also used as the validator withdrawal address. -
eigenPodOwnerAddress— owner of the EigenPod address. -
controllerAddress— controller address for the validators. -
feeRecipientAddress— fee recipient address. -
depositData:pubkey— validator public key.signature— validator signature.depositDataRoot— SHA-256 hash of the SSZ-encoded DepositData object; used as a protection against malformed input.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.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.
-
createdAt— timestamp of the transaction in the ISO 8601 format.
4. Prepare staking transaction
There are two flow to make a deposit:
| Workflow | Best For | Logic |
|---|---|---|
| Simplified Smart Contract | Most Users | Uses P2P proxy contract to handle registration and deposit in one flow. |
| Direct Interaction | Power Users | Manually interacting with the Ethereum Deposit Contract for fine-grained control. |
Create a serialized transaction for depositing the stake amount and send it as a POST request to /api/v1/eth/staking/direct/tx/deposit.
curl --request POST \
--url https://api.p2p.org/api/v1/eth/staking/direct/tx/deposit \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '
{
"withdrawalAddress": "0x1433F808a4867aDEeEb3AE0Df58691C252269A2C",
"depositData": [
{
"pubkey": "0xaed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13",
"signature": "0x91b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf5",
"depositDataRoot": "0xd0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89"
}
]
}
'-
withdrawalAddress— withdrawal address for the validators. For theRESTAKINGoperation type, this corresponds to theeigenPodAddressin the step 3 Check Request Status. -
depositData:pubkey— validator public key.signature— validator signature.depositDataRoot— hash of the deposit data.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.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.
Example response:
{
"error": null,
"result": {
"serializeTx": "0x02f902d305808205508205c8830186a094681a1b3441c6bfb12f91651efd9f02c83c0702938901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89c0",
"to": "0xAD91441aB557b5eC5d9f29DB64522Eb918B4f32b",
"gasLimit": "100000",
"data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89",
"value": "32000000000000000000",
"chainId": 17000,
"type": 2,
"maxFeePerGas": "1000030",
"maxPriorityFeePerGas": "1000000"
}
}Example response is the same as in the Create EigenPod Address step.
Use serializeTx 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.
4.2 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.
5. Verify withdrawal credentials
Before starting, ensure your validator has reached the active_ongoing status. The API identifies your associated EigenPod and ownership via the EigenPod Owner and signer of your request.
Time taken for validator activation depends on the state of the chain. Verify status by sending a POST request to /api/v1/eth/staking/direct/validator/status. Proceed only once the status is
active_ongoing.
- Verify withdrawal credentials by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/verify-withdrawal-credentials. This links your validator's principal withdrawal path to your EigenPod.
curl --request POST \
--url https://api.p2p.org/api/v1/eth/staking/eigenlayer/tx/verify-withdrawal-credentials \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '
{
"eigenPodOwnerAddress": "0x27AABeE07E0dbC8b0de20f42b1a1980871314Ef5",
"pubkey": "0xffC08FcD7cFeF5c70fB2b0e1f2A8EaA690AaE2bDFfa5dBEc4dEef31DcC0B19eB1f9Cebe3E2fe9eefBD9a1BDF6FD89b39"
}
'eigenPodOwnerAddress— owner of the EigenPod address.pubkey— validator public key.
Example response:
{
"error": null,
"result": {
"list": [
{
"serializeTx": "0x02f902d305808205508205c8830186a094681a1b3441c6bfb12f91651efd9f02c83c0702938901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89c0",
"to": "0xAD91441aB557b5eC5d9f29DB64522Eb918B4f32b",
"gasLimit": "10000000",
"data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89",
"value": "0",
"chainId": 17000,
"type": 2,
"maxFeePerGas": "1000032",
"maxPriorityFeePerGas": "1000000"
}
],
}
}- Use
serializeTxto sign and send the signed transaction to the Ethereum network.
Time Sensitive TransactionYou must sign and broadcast this transaction within 8192 slots (approx. 27 hours) of generation. If this window expires, the transaction will be rejected by the network and you must generate a new one, contact us for support.
By broadcasting this transaction, you are verifying the validator withdrawal credentials on-chain. You can proceed to delegate your restake amount to an EigenLayer node operator.
6. Delegate restake to operator
Once withdrawal credentials are verified, you can delegate your ETH restaking power to a Node Operator.
6.1 Get list of operators
Retrieve the list of available EigenLayer node operators by sending a GET request to /api/v1/eth/staking/eigenlayer/operator.
curl --request GET \
--url https://api.p2p.org/api/v1/eth/staking/eigenlayer/operator \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>'Example response:
{
"error": null,
"result": {
"list": [
{
"id": "6df58880-c4c9-484a-8fc4-7f7668fe9522",
"name": "P2P",
"address": "0xdbed88d83176316fc46797b43adee927dc2ff2f5",
}
],
"limit": 10,
"offset": 0,
"totalCount": 1
}
}list:id— UUID that was specified in the node set-up request.name— name of provider.address— EigenLayer node operator address.
limit— number of resources that a single response page contains.offset— number of resources to exclude from a response.totalCount— total number of validators relevant to the current request, based on filters applied.
6.2 Prepare delegation transaction
Create a serialized transaction for delegating the restaked amount to the node operator by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/delegate-to. The Eigen Pod delegated is associated to the signer of the request.
curl --request POST \
--url https://api.p2p.org/api/v1/eth/staking/eigenlayer/tx/delegate-to \
--header 'accept: application/json' \
--header 'authorization: Bearer <token>' \
--header 'content-type: application/json' \
--data '
{
"operatorAddress": "0xdbed88d83176316fc46797b43adee927dc2ff2f5"
}
'operatorAddress— address of the EigenLayer node operator retrieved from the previous step, to delegate the restaked assets.
Example response:
{
"error": null,
"result": {
"serializeTx": "0x02f8ef8242688084030825768486442318830186a094a44151489861fe9e3055d95adc98fbd462b948e780b8c4eea9064b00000000000000000000000037d5077434723d0ec21d894a52567cbe6fb2c3d800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c0",
"to": "0xA44151489861Fe9e3055d95adC98FbD462B948e7",
"gasLimit": "0.0000000000001",
"data": "0xeea9064b00000000000000000000000037d5077434723d0ec21d894a52567cbe6fb2c3d800000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"value": "0.0",
"chainId": 17000,
"type": 2,
"maxFeePerGas": "0.0000000000034557",
"maxPriorityFeePerGas": "1000000"
}
}Use serializeTx from the previous step to sign and send the signed transaction to the Ethereum network.
By broadcasting this transaction, you are delegating your restake to the EigenLayer node operator.
What's next?
Updated 8 days ago