Skip to content

Staking & Resources

TRON accounts stake (freeze) TRX to obtain bandwidth and energy, and to gain voting power. There are two staking mechanisms:

  • Stake 1.0freeze-balance / unfreeze-balance. Staked TRX is locked for a fixed duration.
  • Stake 2.0freeze-balance-v2 / unfreeze-balance-v2 and resource delegation. This is the current mechanism; unstaking goes through a withdrawable waiting period.

Resource codes used throughout:

Code Resource
0 BANDWIDTH
1 ENERGY
2 TRON_POWER (voting power; freeze/unfreeze only, network-gated)

Code 2 (TRON_POWER) is network-gated for freeze/unfreeze commands: FreezeBalance/UnfreezeBalance (Stake 1.0), FreezeBalanceV2/UnfreezeBalanceV2 (Stake 2.0), and their Standard CLI equivalents accept it only when the chain parameter getAllowNewResourceModel is enabled. If that chain parameter cannot be fetched, the 4.9.7 client fails open and lets the node validate the transaction at broadcast. Delegation commands (both modes) always accept only 0 or 1; TRON_POWER is not delegatable.

Amounts are in SUN (1 TRX = 1,000,000 SUN).

As elsewhere, the REPL uses an optional leading [OwnerAddress] for multi-sig; the Standard CLI uses --owner + --multi. All state-changing staking/delegation commands on this page require auth; the resource queries at the end of the page do not.

Stake 1.0

Freeze balance — freeze-balance / FreezeBalance

Deprecated

freeze-balance is deprecated — use freeze-balance-v2 (Stake 2.0) for new stakes. It is kept only for compatibility. (unfreeze-balance remains available to release existing Stake 1.0 positions.)

java -jar build/libs/wallet-cli.jar --network nile freeze-balance \
  --amount 1000000 --duration 3 --resource 1
  • --amount (required, SUN), --duration (required, days).
  • --resource (optional, 0/1/2, default 0). 2 is TRON_POWER and is allowed only when getAllowNewResourceModel is enabled. If --receiver is set, the operation is delegated and 2 is rejected.
  • --receiver (optional) — delegate the obtained resource to another address.
  • --owner, --multi (optional).
FreezeBalance [OwnerAddress] frozen_balance frozen_duration [ResourceCode] [receiverAddress]

ResourceCode: 0 BANDWIDTH, 1 ENERGY, 2 TRON_POWER.

Unfreeze balance — unfreeze-balance / UnfreezeBalance

java -jar build/libs/wallet-cli.jar --network nile unfreeze-balance --resource 1
  • --resource (optional, 0/1/2, default 0). 2 is TRON_POWER and is allowed only when getAllowNewResourceModel is enabled. If --receiver is set, the operation targets a delegated freeze and 2 is rejected.
  • --receiver (optional) — required if the resource was delegated.
  • --owner, --multi (optional).
UnfreezeBalance [OwnerAddress] ResourceCode [receiverAddress]

Stake 2.0

Freeze balance v2 — freeze-balance-v2 / FreezeBalanceV2

No duration: staked TRX stays staked until you explicitly unstake it.

java -jar build/libs/wallet-cli.jar --network nile freeze-balance-v2 \
  --amount 1000000 --resource 1
  • --amount (required, SUN), --resource (optional, 0/1/2, default 0). 2 is TRON_POWER and is allowed only when getAllowNewResourceModel is enabled; if that chain parameter cannot be fetched, the client lets the node validate at broadcast.
  • --owner, --permission-id, --multi (optional).
FreezeBalanceV2 [OwnerAddress] frozen_balance [ResourceCode]

Unfreeze balance v2 — unfreeze-balance-v2 / UnfreezeBalanceV2

Begins unstaking a specified amount. The TRX becomes withdrawable after the network's unfreeze waiting period (see withdraw-expire-unfreeze).

java -jar build/libs/wallet-cli.jar --network nile unfreeze-balance-v2 \
  --amount 1000000 --resource 1
  • --amount (required, SUN), --resource (optional, 0/1/2, default 0). 2 is TRON_POWER and is allowed only when getAllowNewResourceModel is enabled; if that chain parameter cannot be fetched, the client lets the node validate at broadcast.
  • --owner, --permission-id, --multi (optional).
UnfreezeBalanceV2 [OwnerAddress] unfreezeBalance ResourceCode

Withdraw expired unfreeze — withdraw-expire-unfreeze / WithdrawExpireUnfreeze

Withdraws TRX whose unfreeze waiting period has elapsed, returning it to the spendable balance.

java -jar build/libs/wallet-cli.jar --network nile withdraw-expire-unfreeze
  • --owner, --multi (optional).
WithdrawExpireUnfreeze [OwnerAddress]

Cancel all unfreezes — cancel-all-unfreeze-v2 / CancelAllUnfreezeV2

Cancels all pending v2 unstaking requests, returning that TRX to the staked state.

java -jar build/libs/wallet-cli.jar --network nile cancel-all-unfreeze-v2
  • --owner, --multi (optional).
CancelAllUnfreezeV2 [owner_address]

Resource delegation

Delegate resource — delegate-resource / DelegateResource

Lends staked bandwidth/energy to another account.

java -jar build/libs/wallet-cli.jar --network nile delegate-resource \
  --amount 1000000 --resource 1 --receiver TXyz... --lock --lock-period 86400
  • --amount (required, SUN), --resource (required, 0/1), --receiver (required).
  • --lock (optional flag) — lock the delegation; --lock-period (optional) sets the lock duration in blocks.
  • --owner, --multi (optional).
DelegateResource [OwnerAddress] balance ResourceCode ReceiverAddress [lock] [lockPeriod]

ResourceCode: 0 BANDWIDTH, 1 ENERGY. lock is true/false.

Undelegate resource — undelegate-resource / UnDelegateResource

Recalls previously delegated resources.

java -jar build/libs/wallet-cli.jar --network nile undelegate-resource \
  --amount 1000000 --resource 1 --receiver TXyz...
  • --amount (required), --resource (required), --receiver (required).
  • --owner, --multi (optional).
UnDelegateResource [OwnerAddress] balance ResourceCode ReceiverAddress

Resource queries (no auth required)

Account bandwidth — get-account-net / GetAccountNet

java -jar build/libs/wallet-cli.jar --network nile get-account-net --address TXyz...
  • --address (required).
GetAccountNet Address

Account resources — get-account-resource / GetAccountResource

java -jar build/libs/wallet-cli.jar --network nile get-account-resource --address TXyz...
  • --address (required).
GetAccountResource Address

Delegated resource — get-delegated-resource(-v2) / GetDelegatedResource(V2)

java -jar build/libs/wallet-cli.jar --network nile get-delegated-resource \
  --from TFrom... --to TTo...
java -jar build/libs/wallet-cli.jar --network nile get-delegated-resource-v2 \
  --from TFrom... --to TTo...
  • --from (required), --to (required).
GetDelegatedResource   FromAddress ToAddress
GetDelegatedResourceV2 FromAddress ToAddress

Delegated resource account index — get-delegated-resource-account-index(-v2)

java -jar build/libs/wallet-cli.jar --network nile \
  get-delegated-resource-account-index --address TXyz...
java -jar build/libs/wallet-cli.jar --network nile \
  get-delegated-resource-account-index-v2 --address TXyz...
  • --address (required).
GetDelegatedResourceAccountIndex   Address
GetDelegatedResourceAccountIndexV2 Address

Max delegatable size — get-can-delegated-max-size / GetCanDelegatedMaxSize

java -jar build/libs/wallet-cli.jar --network nile get-can-delegated-max-size \
  --owner TXyz... --type 1
  • --owner (required), --type (required, 0 BANDWIDTH / 1 ENERGY).
GetCanDelegatedMaxSize [OwnerAddress] type

type: 0 BANDWIDTH, 1 ENERGY. With only type, the logged-in address is used.

Available unfreeze count — get-available-unfreeze-count / GetAvailableUnfreezeCount

java -jar build/libs/wallet-cli.jar --network nile get-available-unfreeze-count --address TXyz...
  • --address (required).
GetAvailableUnfreezeCount [OwnerAddress]

Withdrawable unfreeze amount — get-can-withdraw-unfreeze-amount / GetCanWithdrawUnfreezeAmount

java -jar build/libs/wallet-cli.jar --network nile get-can-withdraw-unfreeze-amount \
  --address TXyz... --timestamp 1700000000000
  • --address (required), --timestamp (optional, ms; defaults to now).
GetCanWithdrawUnfreezeAmount [OwnerAddress] timestamp

timestamp (ms) is required. With only timestamp, the logged-in address is used.