Getting Started

There are two ways to start staking on the TON network using the Staking API:

  • To nominate along with multiple nominators via a nominator pool.
  • To nominate via a single nominator pool as the only nominator.

In both cases, the staking flow consists of the following steps:

  1. Create a stake transaction.
  2. Sign and broadcast it to the network.

Get an authentication token to start using Staking API.

Request examples are provided using cURL.

Staking via a nominator pool

A nominator pool is a type of the TON smart contract allowing to lend Toncoins in a validator stake for multiple nominators.

To create a stake transaction:

Send a POST request to /api/v1/ton/{network}/staking/nominator/stake.

  1. Example request (for testnet network):

    curl --request POST \
         --url https://api.p2p.org/api/v1/ton/testnet/staking/nominator/stake \
         --header 'accept: application/json' \\
         --header 'authorization: Bearer <token>' \\
         --header 'content-type: application/json' \\
         --data '
    {
      "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
      "amount": "10001"
    }'
    
    • walletAddress — main account address which keeps tokens, located in the Basechain (with raw address 0:...).

    • amount — amount of tokens to stake in Toncoins. Note that the minimum amount is 10 001 TON as 1 TON upon the deposit is deducted as a fee for the transaction processing.

    Example response:

    {
      "result": {
        "unsignedTransaction": "0x2102040605100096b33e0a9647f13198ad16a2812c549a363646a3a7ddbdcc5590f5839c408c6200767f36484b1e2acf5c265c7a64bfb46e95259c66a8189bbcd216195def43685200c21ad1e5198cc0dc3b0f9f43a50f292678f63235ea321e59385d7ee45a7208360018164fa6f9ce28792fb781185e8de4e6eaae34c0f545e5864952fe23c183df0c",
        "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
        "amount": "10000",
        "createdAt": "2024-10-10T14:49:23.998Z"
      }
    }
    
    • unsignedTransactionunsigned transaction in the hexadecimal format. Sign the transaction and submit it to the blockchain to perform the called action.

    • walletAddress — main stash account address which keeps tokens for bonding.

    • amount — amount of tokens to stake in TON.

    • createdAt — timestamp of the transaction in the ISO 8601 format.

  2. Sign and broadcast the unsignedTransaction to the TON network.

You can subsequently send more TONs to increase the deposit.

Staking via a single nominator pool

The single nominator pool is an alternative type of the TON smart contract designed for validators that have enough self stake to validate by themselves without relying on third-party nominators stakes.

To create a stake transaction:

  1. Send a POST request to /api/v1/ton/{network}/staking/single-nominator/stake.

    Example request (for testnet network):

    curl --request POST \
         --url https://api.p2p.org/api/v1/ton/testnet/staking/single-nominator/stake \
         --header 'accept: application/json' \\
     		 --header 'authorization: Bearer <token>' \\
     		 --header 'content-type: application/json' \\
     		 --data '
    {
      "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
      "amount": "1000000"
    }'
    
    • walletAddress — main account address which keeps token, located in the Basechain (with raw address 0:...).

    • amount — amount of tokens to stake in TON. Note that the minimum staking amount is not limited, but there is a maximum cap of 2 000 000 TON for each pool.
      Example response:

    {
      "result": {
        "unsignedTransaction": "0x2102040605100096b33e0a9647f13198ad16a2812c549a363646a3a7ddbdcc5590f5839c408c6200767f36484b1e2acf5c265c7a64bfb46e95259c66a8189bbcd216195def43685200c21ad1e5198cc0dc3b0f9f43a50f292678f63235ea321e59385d7ee45a7208360018164fa6f9ce28792fb781185e8de4e6eaae34c0f545e5864952fe23c183df0c",
        "walletAddress": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
        "validatorAddress": "Ef8AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAADAU",
        "amount": "1000000",
        "rewardDestinationType": "account",
        "rewardDestination": "EQCJkysqW3iwTGXDsC7BaCMxsFN3cBt9S6X8TS3V6FB5l4nB",
        "createdAt": "2024-10-10T14:49:23.998Z"
      }
    }
    
    • unsignedTransactionunsigned transaction in the hexadecimal format. Sign the transaction and submit it to the blockchain to perform the called action.

    • walletAddress — main account address which keeps tokens, located in the Basechain (with raw address 0:...).

    • validatorAddress — validator's address.

    • amount — amount of tokens to stake in TON.

    • rewardDestinationType

    • rewardDestination

    • createdAt — timestamp of the transaction in the ISO 8601 format.

  2. Sign and broadcast the unsignedTransaction to the TON network.

What's Next?