Internal transactions

Records of calls, asset transfers, and other operations during smart contract execution — queryable through node APIs, but not separate on-chain transactions.

Internal transactions record calls, asset transfers, staking, resource delegation, and other operations during smart contract execution. They are not separate on-chain transactions. When the node has saved these records, they can be retrieved from the internal_transactions field returned by the transaction information API.

This page covers what produces internal transactions, what their data fields look like, and how to query them.

📘

Prerequisites


What produces an internal transaction

Common asset-transfer scenarios that produce internal transactions during smart contract execution include:

  • Contract-to-account TRX transfers (e.g., address.transfer(amount))
  • Contract-to-contract TRX transfers (e.g., calling another contract with a value)
  • TRC-10 transfers triggered by the contract
  • Activation transfers (a transfer to an unactivated address triggers account creation)

A single outer transaction can produce zero, one, or many internal transactions, depending on the contract logic.

📘

TRC-20 transfers and internal transactions

TRC-20 token transfers are not internal transactions in this sense. TRC-20 is implemented entirely in contract storage — there is no native asset move. To track TRC-20 movement, parse the Transfer event log emitted by the TRC-20 contract.


Structure

Each internal transaction has these fields:

Proto #FieldDescription
1hashUnique identifier derived from the parent transaction and execution path so each child call has its own ID
2caller_addressThe address that initiated the operation
3transferTo_addressThe recipient
4callValueInfo[]Amounts associated with the operation, each containing callValue and tokenId. For asset-transfer records, TRX has an empty tokenId and an amount in sun. For TRC-10 transfers, tokenId identifies the token and the amount is in raw token units; use its precision to calculate the display amount.
5noteAn operation tag, hex-encoded in node HTTP responses. Decoded values include call (call), create (contract creation), suicide (triggered by SELFDESTRUCT), freezeBalanceV2ForEnergy (staking for Energy), delegateResourceOfEnergy (delegating Energy), and voteWitness (voting), among others.
6rejectedtrue if the parent transaction reverted
7extraOptional free-form string with extra context (set by the VM in specific code paths; often empty)

If the parent transaction reverts, all its internal transactions have rejected = true, and the corresponding asset transfers do not take effect. If the node has saved these records, they remain available for investigating the failure.


Where to find internal transactions

Query the parent transaction's information by passing its transaction ID to wallet/gettransactioninfobyid:

BASE_URL=https://api.trongrid.io   # example — replace with any TRON node (TronGrid, third-party, or self-hosted)
POST ${BASE_URL}/wallet/gettransactioninfobyid
{ "value": "<txid>" }

If the node has saved internal transaction records for that transaction, the response includes an internal_transactions array. Its fields are described in the table above.

For end-user display, TronScan shows internal transactions as a sub-list inside the parent transaction page.

📘

Internal transactions are not recorded by default

By default, java-tron does not save internal transaction records. To retain ordinary call, create, and suicide records on a self-hosted FullNode, set vm.saveInternalTx = true in config.conf and restart the node. This setting applies only to transactions processed after the restart and does not backfill existing history. To retain extended records for Stake 2.0, voting, and similar operations, also enable vm.saveFeaturedInternalTx. Whether a hosted RPC returns internal transactions depends on the service provider's node configuration.


Comparison to Ethereum internal transactions

TRON's internal transactions are conceptually similar to Ethereum's internal transactions / traces: both can be used to inspect calls and asset transfers during contract execution, rather than representing independently signed on-chain transactions. The main differences are:

AspectTRONEthereum
Native asset transfersTRX and TRC-10ETH only
Where they appearinternal_transactions array in transaction information, if saved by the nodeReconstructed from debug_traceTransaction
Token transfers (TRC-20 / ERC-20)Track via event logsTrack via event logs

APIs

APIDescription
wallet/gettransactioninfobyidTransaction information, including internal_transactions if the node has saved these records
wallet/triggerconstantcontractSimulate a contract call without on-chain effects

Related resources