### Unified API - Getting Started and Overviews Source: https://docs.p2p.org/llms Provides introductory information and overviews for the P2P.ORG Unified API, including general getting started guides and network-specific overviews. ```APIDOC Unified API Getting Started: Description: Comprehensive guide to begin using the P2P.ORG Unified API. URL: https://docs.p2p.org/docs/unified-api-getting-started.md Unified API Overview: Description: General overview of the P2P.ORG Unified API capabilities and features. URL: https://docs.p2p.org/docs/unified-api-overview.md Networks Supported: Description: Lists all blockchain networks currently supported by the Unified API. URL: https://docs.p2p.org/docs/unified-api-networks.md Overview for AI Tools: Description: Specific guidance on using P2P.ORG API documentation with AI tools. URL: https://docs.p2p.org/docs/overview-ai.md Sei Overview: Description: Overview of operations and integration on the Sei network. URL: https://docs.p2p.org/docs/overview-sei.md Solana Overview: Description: Overview of operations and integration on the Solana network. URL: https://docs.p2p.org/docs/overview-solana.md Sui Overview: Description: Overview of operations and integration on the Sui network. URL: https://docs.p2p.org/docs/overview-sui.md TON Overview: Description: Overview of operations and integration on the TON network. URL: https://docs.p2p.org/docs/overview-ton.md TRON Overview: Description: Overview of operations and integration on the TRON network. URL: https://docs.p2p.org/docs/overview-tron.md Polygon Overview: Description: Overview of operations and integration on the Polygon network. URL: https://docs.p2p.org/docs/overview-polygon.md Staking Overview: Description: General overview of staking functionalities. URL: https://docs.p2p.org/docs/overview-staking.md ``` -------------------------------- ### SSV On-Chain Documentation Source: https://docs.p2p.org/docs/restaking-overview Guides for SSV On-Chain staking, covering overview, getting started, and withdrawal procedures. ```APIDOC SSV On-Chain: - Overview: /docs/ssv-on-chain-overview - Getting started: /docs/getting-started-ssv-on-chain - Withdrawal: /docs/withdrawal-ssv-on-chain ``` -------------------------------- ### SSV On-Chain Documentation Source: https://docs.p2p.org/docs/restaking-api Guides for SSV On-Chain staking, covering overview, getting started, and withdrawal procedures. ```APIDOC SSV On-Chain: - Overview: /docs/ssv-on-chain-overview - Getting started: /docs/getting-started-ssv-on-chain - Withdrawal: /docs/withdrawal-ssv-on-chain ``` -------------------------------- ### TON Staking Documentation Source: https://docs.p2p.org/docs/restaking-overview Guides for staking on the TON network, covering overview, getting started, withdrawal processes, and transaction signing. ```APIDOC TON Staking: - Overview: /docs/overview-ton - Getting Started: /docs/staking-ton - Withdrawal: /docs/withdrawal-ton - Sign and Broadcast Transaction: /docs/signing-transaction-ton ``` -------------------------------- ### SSV Node Setup and Status API Source: https://docs.p2p.org/docs/getting-started-ssv Provides endpoints for setting up SSV nodes for Ethereum staking and checking their operational status. Includes request/response details and parameter explanations for creating staking requests and querying their status. ```APIDOC POST /api/v1/eth/staking/ssv/request/create Base URL: https://api-test.p2p.org or https://api.p2p.org Description: Sets up SSV nodes through P2P infrastructure. Requires authentication via Bearer token. Request Body: { "id": "string (UUID)", "validatorsCount": "string", "amountPerValidator": "string (Gwei)", "withdrawalCredentialsType": "string (0x01 or 0x02)", "withdrawalAddress": "string (Ethereum address)", "feeRecipientAddress": "string (Ethereum address)", "ssvOwnerAddress": "string (Ethereum address)", "type": "string (without-encrypt-key or with-encrypt-key)", "operationPeriodInDays": "integer", "ecdhPublicKey": "string (optional, required if type is with-encrypt-key)" } Parameters: - id: Arbitrary UUID to track the operation. Generate using online tools or npm package 'uuid'. - validatorsCount: Number of validators. One validator equals 32 ETH. - amountPerValidator: Amount of tokens to stake in Gwei per validator. If > 32 ETH, withdrawalCredentialsType defaults to 0x02. - withdrawalCredentialsType: Preferred format for withdrawal credentials: '0x01' or '0x02'. - withdrawalAddress: Withdrawal address for the client. Also used as validator owner's address and must sign the SSV validator registration transaction. - feeRecipientAddress: Eth1 address that receives fee recipient rewards. - ssvOwnerAddress: Address acting as the owner of the SSV cluster. Can register validators, update fee recipient, top-up balance, and claim rewards. - type: Type of operation. 'without-encrypt-key' (validator private key returned encrypted to client) or 'with-encrypt-key' (validator private key maintained by P2P). - operationPeriodInDays: Duration of operation in days. - ecdhPublicKey: Your ECDH public key for obtaining an encrypted validator private key (required if type is 'with-encrypt-key'). Example Request (cURL): curl --request POST \ --url https://api.p2p.org/api/v1/eth/staking/ssv/request/create \ --header 'accept: application/json' \ --header 'authorization: Bearer ' \ --header 'content-type: application/json' \ --data '{ "id": "3fa85f64-5717-4562-b3fc-2c963f66afa5", "validatorsCount": "1", "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "withdrawalAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "feeRecipientAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "ssvOwnerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "type": "without-encrypt-key", "operationPeriodInDays": 30, "ecdhPublicKey": null }' Example Response (JSON): { "error": null, "result": true } --- GET /api/v1/eth/staking/ssv/request/status/{id} Base URL: https://api-test.p2p.org or https://api.p2p.org Description: Checks the status of the SSV node set-up operation. Parameters: - id: UUID that was specified in the SSV set-up request. Example Request (cURL): curl --request GET \ --url https://api.p2p.org/api/v1/eth/staking/ssv/request/status/3fa85f64-5717-4562-b3fc-2c963f66afa5 \ --header 'accept: application/json' \ --header 'authorization: Bearer ' Example Response (JSON): { "error": null, "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa5", "status": "ready", "type": "without-encrypt-key", "operationPeriodInDays": 30, "liquidationPeriodInDays": 30, "ecdhPublicKey": null, "encryptedShares": [ { "publicKey": "0xb4b5f251eac53f34eb1da2b6659d35db303e408c4c830156cf090441564474f356abd023a0e679aa97cefeed850abb27", "nonce": 1 } ] } } Possible Status Values: - 'pending': The request is being processed. - 'ready': The SSV node setup is complete and ready. - 'failed': The setup process encountered an error. ``` -------------------------------- ### SSV Network Setup Parameters Source: https://docs.p2p.org/docs/getting-started-ssv Defines the parameters required for setting up a validator on the SSV Network. These include details about the validator, staking amounts, withdrawal credentials, and network-specific addresses. ```APIDOC SSV Network Setup Parameters: - `id`: UUID that was specified in the SSV set-up request. - `status`: Current status of the SSV request. - `init`: Request is stored. - `processing`: Request in progress, please wait. - `ready`: Request is ready. - `validator-ready`: Validator is registered on the SSV network and contains the deposit data. - `validator-error`: Validator data is not valid. - `cancel`: Request canceled due to an error or timeout. When `ready`, the validator data is ready to be used in the validator registration step. - `validatorsCount`: Number of validators. One validator is equal to 32 ETH. - `amountPerValidator`: Amount of tokens to stake in Gwei per validator. - `withdrawalCredentialsType`: Withdrawal credentials preferred format: `0x01` or `0x02`. - `withdrawalAddress`: Withdrawal address of the cluster owner. - `feeRecipientAddress`: Eth1 address that receives the fee recipient rewards. - `ssvOwnerAddress`: Address that acts as the owner of the SSV cluster. The cluster owner can register the validator, update the fee recipient address, top-up the cluster balance, and claim SSV incentives rewards. - `type`: Type of operation. - `without-encrypt-key` (available): Validator's private key is returned encrypted to the client. - `with-encrypt-key` (not available): Validator private key is instead maintained by P2P to initiate withdrawals when requested by the client. - `operationPeriodInDays`: Operation period in days. - `liquidationPeriodInDays`: Liquidation threshold period in days. - `ecdhPublicKey`: Your ECDH public key for getting the encrypted validator private key. ``` -------------------------------- ### SSV Setup Request Parameters Source: https://docs.p2p.org/docs/getting-started-ssv Defines the parameters for setting up a validator on the SSV network. This includes identifiers, operational status, transaction types, and encryption-related public keys and nonces. ```APIDOC SSV Setup Request Parameters: - `id`: UUID specified in the SSV set-up request. - `status`: Current status of the SSV request. Possible values: - `init`: Request is stored. - `processing`: Request in progress. - `ready`: Request is ready for the next step. - `validator-ready`: Validator is registered on the SSV network. - `validator-error`: Validator data is invalid. - `cancel`: Request canceled due to error or timeout. - `type`: Type of operation. Available values: - `without-encrypt-key`: Validator's private key is returned encrypted to the client. - `with-encrypt-key`: Validator private key is maintained by P2P for withdrawals. - `operationPeriodInDays`: Duration for which the validator operation is configured, in days. - `liquidationPeriodInDays`: Threshold period for liquidation, in days. - `ecdhPublicKey`: Your ECDH public key, used for obtaining the encrypted validator private key. - `encryptedShares`: - `publicKey`: The validator's public key. - `nonce`: The validator key owner's nonce, used for signature in `sharesData`. ``` -------------------------------- ### Example SSV Deposit Response Source: https://docs.p2p.org/docs/getting-started-ssv Illustrates the structure of a typical JSON response received after an SSV set-up request, including request status and detailed deposit information. ```JSON { "error": null, "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa5", "status": "ready", "depositData": [ { "pubkey": "0xb632ad4ebec8594ec8f2fbacc6df53dec180f8bae6561d70bf74c19520a35beff99cd92513058da6a22a75b9570ab31d", "signature": "0x836e9eebeb29ed1d4b232fa38649e9902ea7d6f9d19e571c4e76cde4da2bcdbca822c8f29d21379325201735fa93925d1597f0c021a147910c165e60bf3308bc827d5fcd545f1c901e7b3102e28b8ea09d6c162c3ffd57e7398f73e5968e05db", "depositDataRoot": "0x16678e6d91a8c3a8f1cdabc037fa32f1d296e629d1665a57f493eda1e6a6964a", "withdrawalCredentials": "0100000000000000000000005cef11327af4104ba0f8a82fbb8628caee7cb1e3", "amount": "32000000000", "depositMessageRoot": "6a572503239cd1f11998af7901c0947fe36eb8efec080f22598d607d3938c1a8", "forkVersion": "00001020", "eth2NetworkName": "goerli", "depositCliVersion": "2.3.0" } ] } } ``` -------------------------------- ### Install Project Dependencies Source: https://docs.p2p.org/docs/implementation-example This command installs all necessary Node.js packages and libraries required for the Unified Staking API integration example to run. It uses npm, the default package manager for Node.js, to fetch and install dependencies. ```Shell npm install ``` -------------------------------- ### TRON Staking Documentation Source: https://docs.p2p.org/docs/restaking-overview Guides for staking on the TRON network, covering overview, getting started, withdrawal processes, and transaction signing. ```APIDOC TRON Staking: - Overview: /docs/overview-tron - Getting Started: /docs/staking-tron - Withdrawal: /docs/withdrawal-tron - Sign and Broadcast Transaction: /docs/signing-transaction-tron ``` -------------------------------- ### Create SSV Staking Request (POST /api/v1/eth/staking/ssv/request/create) Source: https://docs.p2p.org/docs/getting-started-ssv Initiates the setup of SSV nodes by sending a POST request to the P2P API. Requires parameters like validator count, amount, and addresses. The response indicates success or failure. ```cURL curl --request POST \ --url https://api.p2p.org/api/v1/eth/staking/ssv/request/create \ --header 'accept: application/json' \ --header 'authorization: Bearer ' \ --header 'content-type: application/json' \ --data ' { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa5", "validatorsCount": "1", "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "withdrawalAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "feeRecipientAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "ssvOwnerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "type": "without-encrypt-key", "operationPeriodInDays": 30, "ecdhPublicKey": null } ' ``` ```JSON { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa5", "validatorsCount": "1", "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "withdrawalAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "feeRecipientAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "ssvOwnerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "type": "without-encrypt-key", "operationPeriodInDays": 30, "ecdhPublicKey": null } ``` ```JSON { "error": null, "result": true } ``` -------------------------------- ### Configure and Run P2P.ORG Unified API Demo Source: https://docs.p2p.org/docs/staking-ui-showcase-with-unified-api Instructions for configuring environment variables by copying the example file and starting the development server. ```Bash cp .env.example .env # Edit .env with your specific configuration npm run dev # or yarn dev ``` -------------------------------- ### Example Transaction Payload Source: https://docs.p2p.org/docs/getting-started-ssv Illustrates a sample JSON payload representing an Ethereum transaction for SSV network operations, including gas parameters and data. ```APIDOC { "to": "0x3a9f01091C446bdE031E39ea8354647AFef091E7", "gasLimit": "0.0000000000001", "data": "0x095ea7b3000000000000000000000000c3cd9a0ae89fff83b71b58b6512d43f8a41f363dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "value": "0.0", "chainId": 5, "type": 2, "maxFeePerGas": "0.000000000000000016", "maxPriorityFeePerGas": "2" } ``` -------------------------------- ### Example API Response Source: https://docs.p2p.org/docs/staking-sui Example JSON response from the stake list API endpoint. ```JSON { "error": null, "result": { "validatorAddress": "0xab4fb3eeaa7b0ab4f91eedab33adf140c6750e60ca5e44b3df82491937d7bab4", "stakerAddress": "0x696f4402d7151fb49e52b629de3ce3098f3dda7721a7425c000b4f26653709e3", "stakes": [ { "stakeId": "0x5d920b8fca6a6043d898ab1a9a8ab167d8aa323fe2b9e76a27312f7f16e20a67", "amount": 1000000000, "status": "Pending" } ] } } ``` -------------------------------- ### Example cURL Request Source: https://docs.p2p.org/docs/staking-sui Example of how to call the stake list API endpoint using cURL. ```cURL curl --request GET \ --url 'https://api-test.p2p.org/api/v1/sui/testnet/transaction/stake-list/0x696f4402d7151fb49e52b629de3ce3098f3dda7721a7425c000b4f26653709e3' \ --header 'Authorization: Bearer ' ``` -------------------------------- ### Check SSV Staking Request Status (GET /api/v1/eth/staking/ssv/request/status/{id}) Source: https://docs.p2p.org/docs/getting-started-ssv Retrieves the status of an ongoing SSV node setup operation using a GET request to the P2P API. Requires the UUID provided during the initial request. The response includes detailed status and transaction data. ```cURL curl --request GET \ --url https://api.p2p.org/api/v1/eth/staking/ssv/request/status/3fa85f64-5717-4562-b3fc-2c963f66afa5 \ --header 'accept: application/json' \ --header 'authorization: Bearer ' ``` ```JSON { "result": { "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6", "status": "processing", "validatorsCount": 1, "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "withdrawalAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb", "feeRecipientAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb", "ssvOwnerAddress": "0x338EF19fA2eC0fc4d1277B1307a613fA1FBbc0cb", "type": "without-encrypt-key", "operationPeriodInDays": 31556952, "liquidationPeriodInDays": 2629746, "ecdhPublicKey": null, "validatorRegistrationTxs": null, "feeRecipientTx": { "serializeTx": "0x02f84405800210830186a094c3cd9a0ae89fff83b71b58b6512d43f8a41f363d80a4dbcdc2cc0000000000000000000000009c7d4b4595402ed44167c74f9f7c7720ab5528e0c0", "to": "0xC3CD9A0aE89Fff83b71b58b6512D43F8a41f363D", "gasLimit": "0.0000000000001", "data": "0xdbcdc2cc0000000000000000000000009c7d4b4595402ed44167c74f9f7c7720ab5528e0", "value": "0.0", "chainId": 5, "type": 2, "maxFeePerGas": "0.000000000000000016", "maxPriorityFeePerGas": "2" }, "approveTx": { "serializeTx": "0x02f86505800210830186a0943a9f01091c446bde031e39ea8354647afef091e780b844095ea7b3000000000000000000000000c3cd9a0ae89fff83b71b58b6512d43f8a41f363dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc0", "to": "0x3A9F01091c446bde031e39ea8354647aFef091e7", "gasLimit": "0.0000000000001", "data": "0x095ea7b3000000000000000000000000c3cd9a0ae89fff83b71b58b6512d43f8a41f363d", "value": "0.0", "chainId": 5, "type": 2, "maxFeePerGas": "0.000000000000000016", "maxPriorityFeePerGas": "2" } } } ``` -------------------------------- ### Polygon Staking API: Approve Token Management (cURL Example) Source: https://docs.p2p.org/docs/staking-polygon Example cURL request to approve token management for the Polygon Staking API. ```curl curl --request POST \ --url https://api.p2p.org/api/v1/polygon/staking/approve \ --head 'accept: application/json' \ --head 'Authorization: Bearer ' \ --head 'Content-Type: application/json' \ --data ' { "amount": "100000000000000000", "stakerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17" } ' ``` -------------------------------- ### TON Staking Documentation Source: https://docs.p2p.org/docs/restaking-api Guides for staking on the TON network, covering overview, getting started, withdrawal processes, and transaction signing. ```APIDOC TON Staking: - Overview: /docs/overview-ton - Getting Started: /docs/staking-ton - Withdrawal: /docs/withdrawal-ton - Sign and Broadcast Transaction: /docs/signing-transaction-ton ``` -------------------------------- ### Clone Unified Staking API Repository Source: https://docs.p2p.org/docs/implementation-example This command clones the public GitHub repository containing the Unified Staking API integration example. It sets up the project locally, allowing you to start integrating with staking functionalities across various blockchain networks. ```Shell git clone [email protected]:alessandromaci/unified-api.git unified-api-integration-example cd unified-api-integration-example ``` -------------------------------- ### Get Authentication Token Source: https://docs.p2p.org/docs/unified-api-aptos Example command to obtain an authentication token required to start using the Unified API. This is a prerequisite for making authenticated requests. ```bash # Example: Obtaining an authentication token (replace with actual endpoint and credentials) curl -X POST "https://api.example.com/auth/token" \ -H "Content-Type: application/json" \ -d '{"username": "your_username", "password": "your_password"}' ``` -------------------------------- ### Unified API Operations Source: https://docs.p2p.org/docs/unified-api-getting-started The Unified API supports three core operations for managing assets: initiating staking, starting the unstaking process, and completing the withdrawal of unstaked assets. Each operation returns an unsigned transaction. ```APIDOC Unified API Operations: - stake: Initiate a staking transaction to delegate assets. - unstake: Initiate an unstaking transaction to begin withdrawing assets. - withdraw: Complete the withdrawal process by moving unstaked assets to the wallet. Each operation returns a raw unsigned transaction that must be signed and broadcast. ``` -------------------------------- ### TRON Staking Documentation Source: https://docs.p2p.org/docs/restaking-api Guides for staking on the TRON network, covering overview, getting started, withdrawal processes, and transaction signing. ```APIDOC TRON Staking: - Overview: /docs/overview-tron - Getting Started: /docs/staking-tron - Withdrawal: /docs/withdrawal-tron - Sign and Broadcast Transaction: /docs/signing-transaction-tron ``` -------------------------------- ### cURL Request Example Placeholder Source: https://docs.p2p.org/docs/staking-tron Illustrative example of how a request might be made using cURL to interact with the TRON Staking API. Actual endpoints and payloads would be specific to the API implementation. ```cURL # Example: Obtaining an authentication token # curl -X POST https://api.tron.network/v1/user/auth \ # -H "Content-Type: application/json" \ # -d '{"username": "your_username", "password": "your_password"}' # Example: Delegating TRX (freeze) # curl -X POST https://api.tron.network/v1/staking/freeze \ # -H "Authorization: Bearer YOUR_AUTH_TOKEN" \ # -H "Content-Type: application/json" \ # -d '{"amount": 1000000000, "duration": 3}' # Amount in SUN, duration in days ``` -------------------------------- ### Getting Started with P2P Staking API Source: https://docs.p2p.org/docs/staking-babylon Guides users through the initial steps of staking on the Bitcoin network using the P2P Staking API. It outlines the process of retrieving public keys, creating stake transactions, and broadcasting them. ```APIDOC Staking API - Getting Started: 1. Retrieve staker public key address. 2. Create Stake Transaction. 3. Sign and Send the Transaction to the network. Obtain an authentication token to begin using the Staking API. Request examples are provided using cURL. Note: During the initial phase of the Babylon protocol mainnet, staking is limited to initiating the process via time-lock transactions on the Bitcoin blockchain. Direct rewards are not considered until a later phase. Early unbonding is supported. ``` -------------------------------- ### Make First API Call with Unified API (Bash) Source: https://docs.p2p.org/docs/get-started Demonstrates how to make a POST request to the P2P.org Unified API to create a stake transaction. This example uses `curl` and includes necessary headers for authentication and content type, along with a sample JSON payload. ```Bash curl --request POST \ --url https://api-test.p2p.org/api/v1/unified/staking/stake \ --header 'accept: application/json' \ --header 'authorization: Bearer 8aAEXXJsogPZzpAKk1uedM7TYxPvGrBi' \ --header 'content-type: application/json' \ --data ' { "chain": "polkadot", "network": "westend", "stakerAddress": "5FU44bZkd8iza8Sw8xS9QeRamsj9MpcBiwvLBReVDLBmd25q", "amount": 1 } ' ``` -------------------------------- ### P2P.org Documentation Navigation Source: https://docs.p2p.org/docs/overview Provides links to key sections of the P2P.org documentation, including overview, getting started, supported networks, authentication, planning, and AI tools. ```markdown ## Introduction * [Overview](/docs/platform-overview) * [Get Started](/docs/get-started) * [Networks Supported](/docs/networks-supported) * [Authentication](/docs/authentication) * [Integration Planning Guide](/docs/planning-considerations) ## Using AI Tools * [Overview for AI Tools ✨](/docs/overview-ai) * [Using MCP to Read API Docs](/docs/mcp) * [Aggregated Docs for LLMs](/docs/llms) ``` -------------------------------- ### Run Staking Example for Solana Source: https://docs.p2p.org/docs/implementation-example This command executes the main staking script, specifying Solana as the target network. It demonstrates how to initiate a staking operation using the integration example, processing transactions and network-specific logic. ```Shell node stake.js --network=solana ``` -------------------------------- ### SSV Staking API Source: https://docs.p2p.org/docs/restaking-overview API for SSV staking, including overview, getting started guides, and specific instructions for using Trezor. ```APIDOC SSV Staking API: - Overview: /docs/ssv-api-overview - Getting Started: /docs/getting-started-ssv - Getting Started with Trezor: /docs/getting-started-ssv-trezor - Withdrawal: /docs/withdrawal-ssv ``` -------------------------------- ### Unified API Unstaking Operations Source: https://docs.p2p.org/docs/unified-api-getting-started Outlines the API endpoints and steps for unstaking assets. This includes creating an unstaking transaction, creating a withdrawal transaction, and broadcasting the signed transactions. ```APIDOC POST /api/v1/unified/staking/unstake/ Description: Creates an unstaking transaction. Request Body: Requires network-specific parameters. Example: POST /api/v1/unified/staking/unstake/ { "network": "ethereum", "amount": "50", ... } Returns: Unsigned transaction data. POST /api/v1/unified/staking/withdraw Description: Creates a withdrawal transaction for unstaked assets. Request Body: Requires network-specific parameters. Example: POST /api/v1/unified/staking/withdraw { "network": "ethereum", "unstake_id": "...", ... } Returns: Unsigned transaction data. POST /api/v1/unified/transaction/broadcast Description: Broadcasts a signed transaction to the network. Request Body: Requires signed transaction data and network information. Example: POST /api/v1/unified/transaction/broadcast { "signed_tx": "0x...", "network": "ethereum" } Returns: Transaction hash or status. ``` -------------------------------- ### DVT Staking API Prerequisites and Pathways Source: https://docs.p2p.org/docs/getting-started-ssv Details the essential prerequisites for staking on the SSV network, including minimum ETH stake, SSV token requirements, and obtaining an API key. It also outlines the available staking pathways via P2P smart contracts or direct interaction with the Ethereum Deposit Smart Contract. ```APIDOC Prerequisites: - Minimum Stake Requirement: 32 ETH per validator. - SSV Tokens: Required for validator registration and network costs. Contact product team for strategies. Get test tokens from faucet.ssv.network. - API Key Request: Obtain an authentication token to use the DVT Staking API. Staking Pathways: - P2P Smart Contract: For simplified operation. - Ethereum Deposit Smart Contract: Direct interaction. Note on Pectra Upgrade (May 7, 2025): - Recommendation: Upgrade to `0x02` withdrawal credentials for enhanced functionality. - Upgrade Methods: - Consolidate existing validators into a single one. - Create a new `0x02`-enabled validator via simplified 3.1 smart contract flow. - Existing endpoints remain supported. - `0x01` creation flow: Use for fine-grained control over validator count, effective balance, or manual deposit transaction broadcasting. ``` -------------------------------- ### Check Node Setup Status Source: https://docs.p2p.org/docs/staking-ethereum Retrieves the current status of a node setup operation using its unique identifier. This API endpoint is crucial for monitoring the progress and outcome of staking requests. ```APIDOC GET /api/v1/eth/staking/direct/nodes-request/status/{id} Description: Checks the status of a node set-up operation. Parameters: - id (string, required): The UUID of the node set-up request. Headers: - accept: application/json - authorization: Bearer Example Request: curl --request GET \ --url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/status/3611b95c-e1b3-40c0-9086-3de0a4379943 \ --header 'accept: application/json' \ --header 'authorization: Bearer ' Example Response: { "error": null, "result": { "status": "ready", "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "depositData": [ { "pubkey": "0xac1e9969d7b87f3102549ab41558136674a7306b85b9f73cfbd7d9fdb7db85724569da3ebd4d7de9689f6ac058d7e2a3", "signature": "0xb656f9c771166c82a7891b930e6a920878d9736eb3f9f241753a15ea69d8e2f20a3740dfaf546c70e31bd323e14b341205d04e3227dd4cf2923644a375f6792875ac02c5f256f7a17c96b09bafcbce7e4443e1862356b1e90d78875d78e9a742", "withdrawalCredentials": "0100000000000000000000005cef11327af4104ba0f8a82fbb8628caee7cb1e3", "amount": 32000000000, "depositDataRoot": "0xba013b4950b9aff0c3c19017ec5b6e0ed5b957b36f6ff03a545e5cc5605baff8", "depositMessageRoot": "6a572503239cd1f11998af7901c0947fe36eb8efec080f22598d607d3938c1a8", "forkVersion": "10000910", "eth2NetworkName": "hoodi", "depositCliVersion": "2.7.0" } ] } } Response Fields: - error (any): Null if successful, otherwise contains error information. - result (object): - status (string): Current status of the nodes request. Possible values: 'init', 'processing', 'ready', 'cancel'. - amountPerValidator (string): Amount of tokens to stake in Gwei per validator. - withdrawalCredentialsType (string): Withdrawal credentials preferred format ('0x01' or '0x02'). - depositData (array): Array of deposit data objects for validators. - pubkey (string): Validator public key. - signature (string): Validator signature. - withdrawalCredentials (string): Withdrawal address credentials. - amount (number): Amount of ETH in Gwei being deposited. - depositDataRoot (string): SHA-256 hash of the SSZ-encoded depositData object. - depositMessageRoot (string): Cryptographic hash of the Merkle tree’s root. - forkVersion (string): Version of the network fork. - eth2NetworkName (string): Name of the Ethereum 2.0 network. - depositCliVersion (string): Version of the deposit CLI tool used. ``` ```curl curl --request GET \ --url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/status/3611b95c-e1b3-40c0-9086-3de0a4379943 \ --header 'accept: application/json' \ --header 'authorization: Bearer ' ``` ```json { "error": null, "result": { "status": "ready", "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "depositData": [ { "pubkey": "0xac1e9969d7b87f3102549ab41558136674a7306b85b9f73cfbd7d9fdb7db85724569da3ebd4d7de9689f6ac058d7e2a3", "signature": "0xb656f9c771166c82a7891b930e6a920878d9736eb3f9f241753a15ea69d8e2f20a3740dfaf546c70e31bd323e14b341205d04e3227dd4cf2923644a375f6792875ac02c5f256f7a17c96b09bafcbce7e4443e1862356b1e90d78875d78e9a742", "withdrawalCredentials": "0100000000000000000000005cef11327af4104ba0f8a82fbb8628caee7cb1e3", "amount": 32000000000, "depositDataRoot": "0xba013b4950b9aff0c3c19017ec5b6e0ed5b957b36f6ff03a545e5cc5605baff8", "depositMessageRoot": "6a572503239cd1f11998af7901c0947fe36eb8efec080f22598d607d3938c1a8", "forkVersion": "10000910", "eth2NetworkName": "hoodi", "depositCliVersion": "2.7.0" }, { "pubkey": "0xbe5E9c3Bb9eba1BF4C5eC1c1cbcF85ee2CE2fEC66Ce5460C23eF82332A044FDCabF7011F588CCbD77E73CCe6c4accDF0", "signature": "0x83D2E925AEAEdcB18db983Bd447db0BFc1Ee9a6Ead118E5BEfeBcb24BA8C0efd3BD19Cb1cE8e807Fc980a67bBbf8b11e039efe2DB71fcdF096fccac5B04dF80f6a1804cd8d492455D30abE27FcDbDA78AFE61856cad65ffF5cA48Ed4776edd88", "withdrawalCredentials": "010000000000000000000000515ea819fde1c0d36eb8e78e9a69dbf8e4a21", "amount": 32000000000, "depositDataRoot": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585", "depositMessageRoot": "0x2b1c6bbdeadb0b23ca8260a819fde1c0b0347b0fd42c33a9b2513b36d6521dc6", "forkVersion": "10000910", "eth2NetworkName": "hoodi", "depositCliVersion": "2.7.0" } ] } } ``` -------------------------------- ### Unified API Staking Operations Source: https://docs.p2p.org/docs/unified-api-getting-started Details the API endpoints and steps required to stake assets. This involves creating a staking transaction and then broadcasting the signed transaction to the network. ```APIDOC POST /api/v1/unified/staking/stake/ Description: Creates a staking transaction. Request Body: Requires network-specific parameters. Example: POST /api/v1/unified/staking/stake/ { "network": "ethereum", "amount": "100", ... } Returns: Unsigned transaction data. POST /api/v1/unified/transaction/broadcast Description: Broadcasts a signed transaction to the network. Request Body: Requires signed transaction data and network information. Example: POST /api/v1/unified/transaction/broadcast { "signed_tx": "0x...", "network": "ethereum" } Returns: Transaction hash or status. ``` -------------------------------- ### Create P2P Staking Node Request API Source: https://docs.p2p.org/docs/staking-ethereum Initiates the setup of staking nodes by sending a POST request to the P2P API. Requires authentication and a JSON payload detailing staking parameters. ```APIDOC POST /api/v1/eth/staking/direct/nodes-request/create Base URLs: - Testing: https://api-test.p2p.org - Production: https://api.p2p.org Headers: - Authorization: Bearer - Content-Type: application/json - Accept: application/json Request Body: { "id": "string (UUID)", "type": "string (REGULAR | RESTAKING)", "validatorsCount": "integer", "amountPerValidator": "string (Gwei)", "withdrawalCredentialsType": "string (0x01 | 0x02)", "withdrawalAddress": "string (ETH address)", "eigenPodOwnerAddress": "string (ETH address, optional)", "controllerAddress": "string (ETH address)", "feeRecipientAddress": "string (ETH address)", "nodesOptions": { "location": "string (e.g., 'any')", "relaysSet": "string (MEV relay selection, optional)" } } Parameters: - id: Arbitrary UUID to track the operation. - type: Staking operation type. 'REGULAR' for native staking, 'RESTAKING' for EigenPod. - validatorsCount: Number of validators. Each validator requires 32 ETH. - amountPerValidator: Amount of tokens in Gwei per validator. If > 32 ETH, withdrawalCredentialsType defaults to '0x02'. - withdrawalCredentialsType: Preferred format for withdrawal credentials ('0x01' or '0x02'). - withdrawalAddress: The withdrawal address for the validators. - eigenPodOwnerAddress: Owner of the EigenPod address (used in restaking flow). - controllerAddress: Controller address for the validators. - feeRecipientAddress: Address where fees will be sent. - nodesOptions.location: Node location. Currently, only 'any' is supported. - nodesOptions.relaysSet: Miner Extractable Value (MEV) relay selection. Response Body (Success): { "error": null, "result": true } Response Body (Error): (Details depend on the specific error) Related Operations: - Use the 'id' from the request to check the status of the set-up operation via a separate status endpoint (not detailed here). ``` ```cURL curl --request POST \ --url https://api.p2p.org/api/v1/eth/staking/direct/nodes-request/create \ --header 'accept: application/json' \ --header 'authorization: Bearer ' \ --header 'content-type: application/json' \ --data '{ "id": "3611b95c-e1b3-40c0-9086-3de0a4379943", "type": "REGULAR", "validatorsCount": 2, "amountPerValidator": "32000000000", "withdrawalCredentialsType": "0x01", "withdrawalAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "eigenPodOwnerAddress": "", "controllerAddress": "0x39D02C253dA1d9F85ddbEB3B6Dc30bc1EcBbFA17", "feeRecipientAddress": "0x53da3c92fCCEb0CFE1764f65DDfF1564A2b15585", "nodesOptions": { "location": "any", "relaysSet": "" } }' ``` ```JSON { "error": null, "result": true } ``` -------------------------------- ### SSV Staking API Source: https://docs.p2p.org/docs/restaking-api API for SSV staking, including overview, getting started guides, and specific instructions for using Trezor. ```APIDOC SSV Staking API: - Overview: /docs/ssv-api-overview - Getting Started: /docs/getting-started-ssv - Getting Started with Trezor: /docs/getting-started-ssv-trezor - Withdrawal: /docs/withdrawal-ssv ``` -------------------------------- ### Ethereum Transaction Parameters and Serialization Source: https://docs.p2p.org/docs/getting-started-ssv Details the parameters for EIP-1559 Ethereum transactions, including `maxFeePerGas` and `maxPriorityFeePerGas`, and the process of using `serializeTx` to sign and broadcast transactions for validator staking. ```APIDOC EthereumTransaction: type: EIP-2718 type of this transaction envelope. maxFeePerGas: Maximum price per unit of gas for the combined EIP-1559 base fee and transaction's priority fee in Wei. maxPriorityFeePerGas: Price per unit of gas in Wei, added to the EIP-1559 base fee to incentivize miners. serializeTx: description: Serializes and signs a transaction using the provided parameters. usage: Use `serializeTx` to sign and send the signed transaction to the Ethereum network. parameters: - type: The EIP-2718 type of the transaction envelope. - maxFeePerGas: The maximum fee per gas. - maxPriorityFeePerGas: The maximum priority fee per gas. returns: A signed transaction ready for broadcasting. notes: Broadcasting this transaction deposits the required stake amount in the Ethereum deposit smart contract via the P2P smart contract proxy. ``` -------------------------------- ### Transaction Signing and Broadcasting Source: https://docs.p2p.org/docs/getting-started-ssv Provides instructions on how to sign and broadcast Ethereum transactions for SSV network operations, utilizing either serialized or unserialized transaction data. ```APIDOC Transaction Signing and Broadcasting: Sign and broadcast the `approveTx` either by using the serialized signature in `serializeTx` or by constructing the signature using the unserialized data inside `approveTx`. Use `serializeTx` to sign and send the signed transaction to the Ethereum network. ``` -------------------------------- ### Ethereum Launchpad Source: https://docs.p2p.org/docs/ethereum-staking-a-comprehensive-guide Details the Ethereum Launchpad as the official starting point for individuals wishing to become validators. It guides users through the staking process, requirements, risks, and responsibilities. ```APIDOC Platform: Ethereum Launchpad URL: https://launchpad.ethereum.org/ Purpose: Official platform for individuals to start staking Ethereum and become validators. Features: - User-friendly guidance through the staking process. - Education on risks and responsibilities. - Streamlined path from interest to active participation. - Instructions for setting up validator software. Goal: Contribute to network decentralization and security. ``` -------------------------------- ### P2P.org Documentation Navigation Source: https://docs.p2p.org/docs/data-api Provides links to key sections of the P2P.org documentation, including overview, getting started, supported networks, authentication, planning, and AI tools. ```markdown ## Introduction * [Overview](/docs/platform-overview) * [Get Started](/docs/get-started) * [Networks Supported](/docs/networks-supported) * [Authentication](/docs/authentication) * [Integration Planning Guide](/docs/planning-considerations) ## Using AI Tools * [Overview for AI Tools ✨](/docs/overview-ai) * [Using MCP to Read API Docs](/docs/mcp) * [Aggregated Docs for LLMs](/docs/llms) ``` -------------------------------- ### Unified API Transaction Flow Source: https://docs.p2p.org/docs/unified-api-getting-started The common workflow for using the Unified API involves preparing an unsigned transaction, having the user sign it using their preferred method, and then broadcasting the signed transaction to the network. This ensures a secure and standardized transaction lifecycle. ```APIDOC Transaction Flow: 1. Transaction Preparation: The API generates a raw unsigned transaction for stake, unstake, or withdraw operations. 2. Transaction Signing: The user signs the transaction using their preferred signing method. 3. Transaction Broadcasting: The user submits the signed transaction to the network using the Unified API’s dedicated `broadcast` method. ``` -------------------------------- ### Staking API - Direct Staking Example Source: https://docs.p2p.org/docs/staking-polkadot Demonstrates how to stake directly on the Polkadot network using the Staking API. This involves specifying the amount to stake and the validator to nominate. ```cURL curl -X POST https://api.polkadot.network/staking/stake-directly \ -H "Authorization: Bearer your_auth_token" \ -H "Content-Type: application/json" \ -d '{ "validatorAddress": "0x123...", "amount": "10.5", "currency": "DOT" }' ``` -------------------------------- ### Cluster Configuration Source: https://docs.p2p.org/docs/getting-started-ssv Details the configuration for SSV network clusters, specifically the number of operators associated with a cluster. ```APIDOC Cluster Configuration: - `operators`: Number of operators in the cluster. ```