Withdrawal

To withdraw staked TRX on the TRON network via the Staking API:

  1. Create Undelegate Reuqest: remove your votes and unfreeze your TRX.
  2. Sign and Broadcast the Transaction.

No separate withdrawal step is needed.

1. Create Undelegate Request

To initiate the tokens withdrawal, send a POST request to /api/v1/tron/[network]/staking/undelegate.

Example request:

curl --request POST \
  --url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/staking/undelegate' \
  --header 'accept: application/json' \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
    "delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
    "amount": 1000000,
    "resource": "BANDWIDTH"
}'
  • delegatorAddress — delegator account address.
  • amount — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
  • resource — type of resources to be used for freezing TRX:
    • BANDWIDTH — for regular transactions on the TRON chain.
    • ENERGY — for using smart contracts or running DApps.

Example response:

{
  "error": null,
  "result": {
    "delegatorAddress": "TVscj8F6wPZ92d1smGYjH9heZR1MaEcE9u",
    "amount": 10000000,
    "resource": "BANDWIDTH",
    "unsignedTransaction": {
      "visible": false,
      "txID": "e8f2a91ab4ef8a26b1...",
      "raw_data_hex": "...",
      "raw_data": {
        "contract": [
          {
            "parameter": {
              "value": {
                "owner_address": "41da53d324a354aa5924c7117caff3ead97910a5e1",
                "unfreeze_balance": 1000000,
                "resource": "BANDWIDTH"
              },
              "type_url": "type.googleapis.com/protocol.UnfreezeBalanceV2Contract"
            },
            "type": "UnfreezeBalanceV2Contract"
          }
        ],
        "ref_block_bytes": "0e0c",
        "ref_block_hash": "7db974037137d39c",
        "expiration": 1750000200000,
        "timestamp": 1750000140000
      },
    "unsignedTransactionSerialized": "eyJ0eElEIjoidHJ4SWQifQ==",
    "createdAt": "2025-06-03T12:00:00.000Z",
    "voteAccount": "TH7Fe1W8CcLeqN4LGfqX1R9EpsnrJBQJji"
  }
}
  • delegatorAddress — delegator account address.
  • amount — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
  • resource — type of resources used for processing the freeze transaction: BANDWIDTH or ENERGY.
  • unsignedTransaction — original unsigned transaction object returned by tronWeb.
    • visible — internal SDK parameter; always set to false.
    • txID — hash of the transaction.
    • raw_data_hex — raw payload of the unsigned transaction in the hexadecimal format.
    • raw_data — full decoded transaction structure with all the fields and metadata:
      • contract — list of TRON contracts:
        • parameter.type_url — TRON protocol contract, e.g., type.googleapis.com/protocol.UnfreezeBalanceV2Contract.
        • parameter.value.owner_address — TRON account address in the hexadecimal format.
        • parameter.value.unfreeze_balance — amount of tokens to unfreeze in SUN (1 TRX = 10⁶ SUN).
        • parameter.value.resource — resource type: BANDWIDTH or ENERGY.
      • ref_block_bytes, ref_block_hash — hash and references of the block in which the transaction has been included.
      • expiration — timestamp of the transaction expiration in ms since last epoch.
      • timestamp — timestamp of the transaction in ms since last epoch.
  • createdAt — timestamp of the transaction in the ISO 8601 format.
  • unsignedTransactionSerialized — unsigned serialized transaction in Base64 encrypted format ready for signing.
  • voteAccount — Super Representative address for voting.

2. Sign and Send Transaction

Use unsignedTransactionSerialized to sign and send the signed transaction to the TRON network.

By broadcasting this transaction, you're resetting all votes.

Note that there is a protocol freeze period before the corresponding TRX tokens will be unlocked. You can verify withdrawal by several options:

What's Next?