← All articles

Smart Contracts and the TVM

Key takeaways

  • A USDT payment is a contract call. It runs Tether's code in the TRON Virtual Machine (TVM), and no TRX moves from one address to another.
  • The TVM is a near-twin of Ethereum's EVM. It meters every opcode in Energy, and every node must produce the same result from the same inputs.
  • A direct TRC-20 transfer names the token contract as its contract_address, with the payee and amount ABI-encoded in its data field. It consumes Energy as well as Bandwidth, and it never activates the recipient.
  • Since TIP-54 took effect in February 2020, a contract can activate an account for 25,000 extra Energy. It does so only while executing a transaction that an account sent. Attribution names that account and the keys that signed for it, which an active permission can give to another party.

A USDT payment looks like value moving from one address to another. On the wire it is a function call on Tether’s contract, run by the TRON Virtual Machine. That difference decides which resources the transaction consumes, whether it can bring a new account into existence, and where the chain records the real counterparty.

The TVM is the component that runs that code. How it works explains why a TRC-20 transfer never activates its recipient and why a wallet’s Energy use is a record of its contract activity. It also explains why a direct USDT transfer names Tether’s contract as its contract_address, with the person being paid named in the call data and, when the call succeeds, in the token’s Transfer event.

What the TVM is

Every node keeps its own instance of the TVM, the runtime that executes TRON smart contracts, and runs the same code against the same inputs. That agreement is how the network settles on one result.

It is a state machine, not a ledger. TRON’s own documentation has put it this way: with smart contracts, “instead of a simple distributed ledger, TRON is actually a distributed state machine.” Given a valid state and a new set of valid transactions, the state transition function produces the next valid state.

The TVM is a stack machine. Its stack is 1024 items deep, and each item is a 256-bit word. That width was picked for easy work with 256-bit cryptography such as Keccak-256 hashes and secp256k1 signatures. Ethereum made the same choices.

[ ONE SIGNED CALL · ONE METERED RUN ] Wallet (EOA) SIGNS THE CALL [ EMITS ] TriggerSmartContract TYPE 31 · CALL DATA · FEE LIMIT [ RUNS IN ] TVM STACK · 1024 DEEP · 256-BIT WORDS EVM-COMPATIBLE OPCODES EACH OPCODE COSTS ENERGY KEY [ DETERMINISTIC ] Next state EVERY NODE · SAME CODE · SAME RESULT [ ENERGY SPENT IS A RECORD OF CONTRACT ACTIVITY ]
A signed call runs inside the TVM; each opcode it executes costs Energy.

A near-twin of the EVM

An archived revision of TRON’s TVM page says the TVM “exhibits fundamental compatibility with the Ethereum Virtual Machine.” The Developer Hub’s TVM vs EVM page says most ERC-style Solidity contracts compile and run on TRON without modification, although a small set of opcodes, precompiles, and protocol-level details differ. For an investigator, intuition built on Ethereum carries over, and the exceptions are where TRON-specific behavior hides.

The opcodes match the EVM’s apart from a small TRON-specific set. Three are worth knowing:

OpcodeWhat it doesWhy it exists
CALLTOKEN (0xD0)Call a contract while attaching a TRC-10 token valueTRON has a native TRC-10 token layer the EVM lacks
TOKENBALANCE (0xD1)Read an address’s balance of a TRC-10 tokenThe same native TRC-10 token layer
ISCONTRACT (0xD4)Test whether an address is a contractThe chain answers natively what an address string cannot reveal

A few EVM opcodes return fixed values on the TVM. DIFFICULTY always returns 0, because the TVM has no proof-of-work. TRON uses delegated proof-of-stake consensus. GASLIMIT also returns 0, and GASPRICE and BASEFEE both return energyPrice, the network’s Energy price. One more difference matters when tracing contracts deployed with CREATE2. TRON derives the new address with a 0x41 prefix where the EVM uses 0xff. That 0x41 is the same byte that leads every TRON address.

Triggering a contract is its own transaction type

The protocol gives each kind of transaction a numbered type. System contracts such as TransferContract run in built-in actuators and never enter the TVM. Only CreateSmartContract and TriggerSmartContract invoke it.

[ MOVE VALUE · BANDWIDTH ONLY ] TransferContract TYPE 1 Moves native TRX CAN ACTIVATE AN ACCOUNT TransferAssetContract TYPE 2 Moves a TRC-10 token CAN ACTIVATE AN ACCOUNT [ RUN CODE · ENERGY + BANDWIDTH ] CreateSmartContract TYPE 30 Deploys a contract TriggerSmartContract TYPE 31 Calls a deployed contract A DIRECT TRC-20 TRANSFER IS ONE KEY
Value-moving types versus code-running types, with their numeric ContractType IDs.

A TriggerSmartContract names the caller as its owner_address and the contract being called as its one contract_address. Its data field carries the function selector and the ABI-encoded arguments, and call_value carries any TRX sent into the contract. The fee limit, which caps the spend, is set on the transaction that carries the call. The message has no field for the payee of a token transfer.

Reading TRC-20 flow therefore takes a decode pass. A direct USDT transfer is a TriggerSmartContract that calls transfer(address,uint256) on Tether’s contract, so its contract_address is the USDT contract. The payee and the amount are ABI-encoded in the data field, after the four-byte selector a9059cbb. An investigator who reads only the top-level fields sees a wallet calling the USDT contract and misses the payee. The call data says whom the caller asked to pay. The Transfer event in the transaction’s receipt records what moved, and a call that reverts has call data and no event.

A transfer that another contract makes during its own execution sits one layer deeper, because the signed call names that other contract. On 17 November 2026 TronGrid showed 15 of the 144 USDT Transfer events in block 88085900 coming from calls to four other contracts.

[ ONE USDT TRANSFER · TWO READS ] WHAT THE SURFACE SHOWS type TriggerSmartContract contract_address TR7NHqjeKQxGTCi8q8ZY4... ↳ THE USDT CONTRACT, NOT THE PAYEE data 0xa9059cbb… (encoded) ↳ OPAQUE UNTIL DECODED [ DECODE ] WHAT DECODING REVEALS selector transfer(address,uint256) to (named payee) TJ8sRtyp56hF2KkpW9bWY... amount decoded from call data NEITHER APPEARS IN THE TOP-LEVEL FIELDS KEY [ THE CALL DATA ASKS · THE EVENT RECORDS ]
The surface shows the token contract. The call data names the payee the caller asked for, and the Transfer event records what moved.

Energy: the cost of computation

TRON’s Developer Hub has defined Energy as “the unit that measures the amount of computation required by the TRON virtual machine to perform specific operations on the TRON network.” Every instruction a contract runs “consumes a certain amount of Energy while running.” The TVM charges that Energy before each opcode executes.

Energy is the contract resource. Every on-chain transaction consumes Bandwidth, and a contract call consumes Energy as well. A system contract such as a plain TRX transfer never enters the TVM, so it consumes Bandwidth alone. Because only TVM execution spends Energy, a wallet’s Energy use is a record of its contract activity. A wallet that only ever sends TRX leaves no Energy footprint.

An account obtains Energy by staking TRX or by receiving a delegation from another account. When that Energy runs short, the account pays the shortfall by burning TRX at the network’s Energy price. On 17 November 2026 TronGrid showed that price at 100 sun per unit of Energy (0.0001 TRX). The price is a chain parameter, and GASPRICE returns it. Unlike Ethereum’s per-block base fee, it changes only when a committee proposal changes it.

Failed calls still cost Energy. A call that ends in REVERT pays only for the Energy it used up to the point of failure. A failed require or revert ends that way, and so, normally, does a failed assert in a contract compiled with Solidity 0.8 or later. Before Solidity 0.8.0 a failed assert could compile to an invalid opcode, which consumes the whole Energy allowance of the execution. Failed calls stay in the trace. On 17 November 2026 TronGrid showed a USDT transfer that ended in REVERT included in block 88085903 and charged 8,624 Energy.

When a contract can create an account

The rule changed once, and the date matters. Before TIP-54 was switched on, a contract could not activate an account. Proposal 29 took effect on 24 February 2020 and switched on the change that TIP-54 specified.

In TRON’s original design, a system transfer (TransferContract or TransferAssetContract) to an address that did not exist created and activated it. The sender paid for the creation with staked Bandwidth, or with a 0.1 TRX burn when that Bandwidth fell short. The separate 1 TRX account-creation fee did not exist yet, because that parameter was 0 until Proposal 67 took effect on 26 July 2021. A transfer made from inside a smart contract did not create the account. The java-tron documentation of 2019 said that “if the transfer to address does not exist it can not create an account by smart contract transfer.” TIP-54 records that such a transaction failed.

TIP-54, whose status is Final, removed that difference. Since the change, a contract activates an account when it transfers TRX or a TRC-10 token to an address that is not yet activated. The activation adds 25,000 Energy to the cost of the call. The Developer Hub describes that figure as a protocol implementation constant and says it is not a chain parameter. This path charges neither the account-creation fee, which TronGrid showed at 1 TRX on 17 November 2026, nor the 0.1 TRX charge.

The principle that attribution work relies on survives the change, but it needs stating with care. Although a contract has been able to activate an address since TIP-54, it still never starts a transaction. Only CreateSmartContract and TriggerSmartContract transactions invoke the TVM, and every transaction is a signed instruction from an account. An activation by a contract therefore happens inside a call that a wallet signed, however many contract layers sit in between. Account activation covers who counts as the first activator. That article also explains why a router or token contract is not the answer even when it is the address that moved the value.

What this means on-chain

Three practical consequences follow from how the TVM works.

A TRC-20 transfer is code execution. A direct transfer is a TriggerSmartContract, so it consumes Energy as well as Bandwidth, and its contract_address is the token contract. The call data names the counterparty the caller asked to pay, and the Transfer event records the transfer that happened. It does not activate the recipient. Activation comes from a TRX or TRC-10 transfer, sent directly or by a contract, or from an AccountCreateContract. An address that holds only USDT and has never received TRX may have been activated by someone else, or may not be an account on chain at all. One address received its first USDT at 16:08 UTC on 17 November 2026, and at 16:10 UTC TronGrid’s getaccount still returned nothing for it. A TRX transfer activated it at 16:16 UTC. A TRC-20 inflow is therefore no evidence of who activated the address.

An Energy history records contract activity, but the amounts need care. Only TVM execution spends Energy, so a wallet’s Energy history maps its contract use. The price of a unit of Energy changes only by proposal. The amount a call uses is less stable, because it depends on the storage the call touches and on the contract’s dynamic-energy factor. On 17 November 2026 TronGrid showed two USDT transfer calls in block 88085900 using 64,285 and 130,285 Energy. The cheaper call paid a recipient that already held USDT, and the dearer one paid a recipient receiving its first. The Developer Hub gives the reason. Writing a storage slot that was zero costs 20,000 Energy, and updating a slot that already holds a value costs 5,000.

The second cause is the Dynamic Energy Model of TIP-491. A contract that exceeds a usage threshold in one maintenance period has its consumption factor raised in the next. On 17 November 2026 TronGrid showed a six-hour maintenance period and USDT’s energy_factor at 34,000, the maximum the chain parameters allowed. An investigator comparing Energy figures should check the recipient’s token balance and the date before reading anything into a difference.

A contract executes instructions and has no intent of its own. A contract runs the call it is handed and does not decide to send funds. When a flow passes through a contract, the useful question is which account sent the call, which keys signed it, and what the call data told the contract to do. An active permission can give those keys to another party, so the sender and the signer can differ. Attribution starts from that instruction, the account that sent it, and the keys that signed it, and reading a TRON address picks up from there.

Sources