Getting Started

The EigenLayer restaking flow includes the following steps:

  1. Create EigenPod address: construct a serialized transaction to generate an EigenPod address, which your validator can use as a withdrawal address.
  2. Create Staking Request: set up nodes for staking using P2P infrastructure.
  3. Check Request Status: check the status of the node set-up operation.
  4. Prepare Staking Transaction: construct a serialized transaction to deposit the stake amount with a smart contract.
  5. Verify Withdrawal Credentials: construct a serialized transaction to verify the validator withdrawal credentials on-chain.
  6. Prepare Delegate Restake Transaction: 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

  1. Retrieve a serialized transaction to generate an EigenPod address by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/create-pod. Use https://api-test-holesky.p2p.org for testing or https://api.p2p.org for production.

    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.
    • 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. Use serializeTx to 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 Stake 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 with the RESTAKING type 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.
    • controllerAddresscontroller address for the validators.
    • nodesOptions:
      • location — node location. Currently, only any is 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": "holesky",
        "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 to null by default; corresponds to the EigenPod address.

  • eigenPodAddress — EigenPod address also used as the validator withdrawal address.

  • eigenPodOwnerAddress — owner of the EigenPod address.

  • controllerAddresscontroller 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 ways to prepare a staking transaction using the Restaking API:

  • Interact directly with the Ethereum Deposit Smart Contract.
  • Utilize the P2P smart contract.

Ethereum Deposit Smart Contract

📘

This option may be preferrable if you have a lot of engineering resources available and do not want your infrastructure to have an extra dependency.

  1. Retrieve all the required data from the previous step within the depositData object and prepare the staking transaction.
  2. Construct a signature and send the deposit amount to the Ethereum deposit smart contract. Check an example of how to sign and send a transaction to the Ethereum network.

P2P Smart Contract

  1. Create a serialized transaction for depositing the stake amount and send it as a POST request to /api/v1/eth/staking/direct/tx/deposit.

    Example request:

    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 the RESTAKING operation type, this corresponds to the eigenPodAddress in 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.

  2. 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.

5. Verify Withdrawal Credentials

📘

The validator activation can take up from 16 to 24 hours. To check whether the validator is active, retrieve its status by sending a POST request to /api/v1/eth/staking/direct/validator/status.

Before proceeding further, wait until the validator gets the active_ongoing status and starts performing the validator duties.

  1. Initiate verifying the withdrawal credentials to the EigenPod address by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/verify-withdrawal-credentials. These credentials will be used to verify that the validator will withdraw its principal to this EigenPod in case it exits the Beacon chain.
    Example request:

    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 keys.

    Example response:

    {
      "error": null,
      "result": {
        "list": [
          {
            "serializeTx": "0x02f902d305808205508205c8830186a094681a1b3441c6bfb12f91651efd9f02c83c0702938901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89c0",
            "to": "0xAD91441aB557b5eC5d9f29DB64522Eb918B4f32b",
            "gasLimit": "10000000",
            "data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a00000000000000000000000000000000000000000000000000000000000000260000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000030aed7226d86d884dd44bc45c2b57f7634e72abf247713163388b1c34d89a1322d7228ca023dbaf2465b822e35ba00da13000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000200100000000000000000000001433f808a4867adeeeb3ae0df58691c252269a2c00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000006091b710f0e3affe704e76ada81b095afbedf4b760f3160760e8fa0298cc4858e0f325c2652dc698ec63c59db65562551114ab7fcafe1d675eaaf186fa7758800f0157bd0b51cd3a131fac562d6933658ddbf182aab8d20a9483b1392085e54cf50000000000000000000000000000000000000000000000000000000000000001d0d00dce54b4ec8a7803783fc786a859459ead1d35b856c525cb289aba4b0f89",
            "value": "0",
            "chainId": 17000,
            "type": 2,
            "maxFeePerGas": "1000032",
            "maxPriorityFeePerGas": "1000000"
          }
        ],
      }
    }
    

    Example response is the same as in the Create EigenPod Address step.

  2. Use serializeTx to sign and send the signed transaction to the Ethereum network.

    By broadcasting this transaction, you are verifying the validator withdrawal credentials on-chain. You can now delegate your restake amount to an EigenLayer node operator.

🚧

Note that the transaction signing is time sensitive

The transaction has to be signed in 8192 slots (approximately 27 hours).

If the time has expired and you have not signed the transaction yet, contact us for support.

6. Prepare Delegate Restake Transaction

  1. Retrieve a list of all EigenLayer node operators by sending a GET request to /api/v1/eth/staking/eigenlayer/operator.

    Example request:

    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 — validator name.
      • 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.
  2. Create a serialized transaction for delegating the restake amount to the node operator by sending a POST request to /api/v1/eth/staking/eigenlayer/tx/delegate-to.

    Example 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 to delegate the restaked assets.

    The EigenLayer node operator address for P2P.org is 0xdbed88d83176316fc46797b43adee927dc2ff2f5.

    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"
        }
    }
    

    Example response is the same as in the Create EigenPod Address step.

  3. 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?