← All articles

Anatomy of a Signed Transaction

Key takeaways

  • A transaction has two parts: a raw_data envelope (the contract, a reference block, an expiration, a timestamp, a fee limit) and a signature array over it.
  • The transaction ID is the SHA-256 hash of the raw_data alone. It is fixed before anyone signs, and the signatures never change it.
  • The signature field is a list. Each entry is a 65-byte recoverable ECDSA signature. The Permission_id on the contract names the permission those signatures have to satisfy, and that permission sets the weight threshold.
  • A transaction names one of the last 65,536 blocks as its reference and carries an expiration. A node's API sets the expiration 60 seconds past its latest block's timestamp by default, and a node accepts no expiration more than 24 hours past its head block. Past its expiration, a transaction is no longer packed.

Every action an account starts on TRON, whether a transfer, a contract call, a vote, or a permission change, is sent as a transaction. TRX that moves inside a contract’s execution is an internal transaction. The network records it in the transaction’s execution record, outside the signed object this article covers. Most of what an on-chain reader wants to know is who authorized a transaction, under what authority, against which block, and how long it was allowed to live. All of that is in the signed object itself.

One half of the object is a structured envelope of intent, unsigned and complete on its own. The other is an array of signatures wrapped around it. The builder finishes the envelope before any signer signs it, and an investigator can learn a good deal from where the two meet.

This article works through the structure field by field, using the protocol’s own definition. It covers the envelope and its signatures. The catalog of contract types and the mechanics of account permissions each have their own article, linked below where they meet the structure.

The two parts: raw_data and the signature array

In the protocol definition, the top-level Transaction message carries raw_data in field 1 and signature in field 2. The signature field is a repeated bytes, which means a list.

TRANSACTION — ONE OBJECT, TWO HALVES raw_data FIELD 1 THE ENVELOPE OF INTENT contract — holds Permission_id ref_block_bytes · ref_block_hash expiration · timestamp fee_limit · data (memo) EVERY FIELD CHOSEN BY THE BUILDER signature[ ] FIELD 2 REPEATED signature[0] · 65 B signature[1] · 65 B ECDSA OVER THE txID ONE PER CO-SIGNER [ SHA-256 ] txID = SHA-256(raw_data) THE ID NAMES THE ENVELOPE ALONE — SIGNATURES NEVER CHANGE IT KEY
The signatures wrap the envelope, but the transaction ID is taken from the envelope alone.

A third field, ret, holds the execution result the network fills in after the fact. The sender does not build or sign it.

The raw_data envelope is where intent lives. Its fields:

FieldWhat it holds
contractThe action itself, as a typed contract (a transfer, a TriggerSmartContract, a vote). It is carried as a protocol Any, so one envelope shape can hold any of the roughly forty contract types.
ref_block_bytes, ref_block_hashA reference to a recent block, the anti-replay anchor (see TAPOS, below).
expirationThe deadline for inclusion. The archived Developer Hub page calls it the time beyond which the transaction “will no longer be packed.”
timestampThe creation time set by the builder.
fee_limitThe cap, set in sun, on the total Energy the caller can cover for a contract call, staked Energy and burned TRX together.
dataAn optional memo.

The contract field also holds the Permission_id, a small integer that names which of the account’s permissions the signatures must satisfy. It sits inside the contract, and the outer envelope has no such field. It defaults to 0, the owner permission. The signature section below covers how the network uses that integer.

Whoever builds the transaction chooses everything in raw_data, and none of it is a signature yet. Authorization comes from the second half.

Where the txID comes from

The transaction ID is the SHA-256 hash of the serialized raw_data, and of nothing else.

The protocol’s signing procedure gives the order of operations: “Convert the transaction’s raw data to byte[]. Hash the raw data using sha256. This gives you the Transaction ID.” The hash covers the envelope. Each signer computes a signature from that hash and attaches it afterward, and no signature is ever folded back into the hash.

The ID exists before any signature does. A builder can compute a transaction’s ID, hand the unsigned envelope to a co-signer, and know the final ID in advance.

And because the hash covers only raw_data, signatures cannot change the ID. Adding a second signature for multi-sig, or replacing one signature with another valid one, leaves the txID untouched. An envelope keeps one canonical identity no matter who ends up signing it.

The flip side is that any edit to intent produces a different transaction. Change the amount, the recipient, the fee limit, the expiration, or anything else inside raw_data, and the hash changes, which means the ID changes. There is no such thing as the same transaction with a different amount.

The txID is a fingerprint of intent, taken before the question of authority is ever asked.

The signature array and multi-signature

The signature field is a list because a transaction can require more than one signer.

Each signer produces an entry the same way, by running ECDSA on the secp256k1 curve over the txID. The signing procedure says the result “should be 65 byte in size”: 32 bytes for r, 32 for s, and 1 for v. The trailing v byte makes the signature recoverable. A verifier can take the txID and the 65 bytes, recover the public key that produced them, then derive that key’s address. If the recovered address is one the account’s permission authorizes, the signature counts.

So an investigator can read the array after the fact. No one has to say who signed, because the signatures themselves yield the signing addresses.

Whether one signature is enough depends on the permission named by Permission_id. Id 0 is the owner permission, the default, and it has full control of the account. Ids 2 and up are active permissions, and an account can have up to eight of them. Each one carries an operations field that restricts which contract types it may execute. The id of an active permission “is automatically assigned by the network in sequence starting at 2.” Id 1, the witness permission, is reserved for a Super Representative’s block production and cannot be used to sign an ordinary transaction.

Each key inside a permission carries a weight, and the permission sets a threshold. The rule is a sum. The network allows the operation only when the combined weight of the participating signatures meets or exceeds the threshold. A key whose weight meets the threshold signs alone. A permission that spreads weight across several keys needs several signatures, gathered one at a time. One signer signs the envelope and passes it on, and the next adds a signature, until the collected weight meets the threshold.

[ SIGNATURE ARRAY · WEIGHT vs THRESHOLD ] signature[0] 65 BYTES · r s v signature[1] 65 BYTES · r s v [ RECOVER ] [ RECOVER ] TJmuRk…9Yt3 RECOVERED KEY · WEIGHT 1 TKppXe…7Rn2 RECOVERED KEY · WEIGHT 1 [ Σ WEIGHT ] Σ weight 2 ≥ threshold 2 AUTHORIZED — PERMISSION SATISFIED KEY Permission_id names the permission the weights must satisfy OWNER 0 · ACTIVE 2+ · WITNESS 1 (BLOCK PRODUCTION ONLY)
The network checks the combined weight of the signatures against the threshold. One heavy key can meet it, and so can several light ones.

From the array and the Permission_id together, a reader can learn which account acted, under which of its permissions, and with how many keys. That is more than the “from” address alone can give. A transaction signed under an active permission looks different from one signed under the owner key, and that difference is on-chain. The account model article covers how those permissions are structured and changed. The narrower point here is that a signed transaction is a permission being exercised, and the signature array is the record of it.

The reference block (TAPOS) and the expiration

Two fields tie a transaction to a recent block, and a third sets its deadline. ref_block_bytes and ref_block_hash implement TAPOS (Transaction As Proof Of Stake), the rule that each transaction must reference a recent block. expiration is a separate check.

ref_block_bytes and ref_block_hash are a compact pointer to that block, made of a slice of its height and a slice of its hash. Their job is anti-replay. The archived Developer Hub page says the reference block “is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block.” A transaction built against a block that a given fork never saw is invalid on that fork, so no one can take it from one history and replay it into another. The reference must be one of the last 65,536 blocks. Within that window, the live Developer Hub page says an SDK may use the latest block or the latest solidified block, depending on the method and configuration.

expiration sets the transaction’s deadline. In the archived page’s words, past that time it “will no longer be packed”. When a transaction is built through a node’s API, the same page says, the node sets the expiration “to the value of adding 60 seconds to the timestamp of the node’s latest block.” That window is configurable, but “the maximum value cannot exceed 24 hours.” Both figures run from a block’s time. A node rejects a transaction whose expiration is not later than its head block’s time, or is more than 24 hours past it. It counts neither figure from the transaction’s own timestamp field.

[ REFERENCE BLOCK (TAPOS) + EXPIRATION ] PACKABLE WINDOW +60S DEFAULT · ≤ 24H MAX HEAD BLOCK EXPIRATION ref_block ONE OF LAST 65,536 BLOCKS Packed into a block LANDS ON-CHAIN Past expiration DROPPED · NEVER LANDS KEY EXPIRED = REBUILD: NEW EXPIRATION · NEW txID
A transaction can be packed only until its expiration. After that, nodes drop it.

The reference block binds a transaction to a fork, and the expiration binds it to a deadline. A transaction that is not packed before its expiration, for example because a required co-signer never signs, does not queue for later. The sender has to build a fresh one with a new expiration, which gives it a new txID. A rebuild normally names a newer reference block as well, because builders pick the latest or the latest solidified block.

timestamp is easy to misread. It is the creation time the builder sets, and the confirmation time comes from the block. The archived page notes that the field “does not need to be set, because the timestamp of the block which the transaction is included in is the actual on-chain timestamp”.

Reading the structure

A reader who takes the envelope and its signatures apart can answer questions that the summary view of a transfer leaves open.

Start with who authorized it. The signature array recovers to real addresses, so for a transaction from one account, an investigator can still identify the set of keys (one, or several) that satisfied a permission. The count and the recovered addresses are evidence about control, independent of the sender field.

When the Permission_id is other than 0, the signers acted under one of the account’s active permissions. That does not mean anyone else holds signing authority, because a new account starts with an active permission that holds only its own key. An investigator can check the permission’s key list and the addresses recovered from the signatures to see whether any key other than the account’s own is involved.

An investigator can place the transaction in time from the reference block and the timestamp field. The transaction was built no earlier than its reference block, and the timestamp field is the build time as the builder set it. Both help when the confirmation time and the creation time disagree, or when the timing of an action relative to a chain event matters.

On a contract call, fee_limit is how far the signer was willing to go. It is a ceiling the signer chose before broadcasting, and it stays visible even when the call reverts. An investigator can read it as intent, the amount of Energy value the author was prepared to spend on the attempt.

None of this requires trusting a label or a block explorer’s rendering. It is all recoverable from the transaction’s own bytes. By completing the envelope, the builder fixed the intent, a name for it, and the permission the signers must satisfy. Each signer then signed that name, and a verifier can recover from the array of signatures which keys signed under that permission.

Sources

  • TRON Developer Hub — Transactions — official reference for the raw_data fields, the TAPOS reference block, and the expiration (“Default expiration is +60 seconds; max is 24 hours”). Read on 17 November 2026, the live page says TAPOS “requires each transaction to reference a recent block”, gives the reference range as a “65,536-block lookup window”, and says “An SDK may use the latest block or the latest solidified block as the reference block, depending on the method and configuration.” It describes fee_limit as a cap in sun on “the caller’s total Energy usage (staked Energy plus the TRX-burn portion), not just the amount burned”, and says timestamp is not used to compute expiration. It also describes internal transactions as TRX moves triggered inside contract execution. TRON has rewritten this page in place, and it no longer carries the older wording quoted in the body, so the archived revision below is cited for that wording.
  • TRON Developer Hub — Transaction, archived 2025-06-20 — the revision, captured on 20 June 2025, that carries the older wording quoted in the body. The reference block “is used in the TRON TAPOS mechanism, which can prevent a replay of a transaction on forks that do not include the referenced block”. A transaction past its expiration “will no longer be packed”. A node sets that expiration “to the value of adding 60 seconds to the timestamp of the node’s latest block”, and “the maximum value cannot exceed 24 hours.” The timestamp field “does not need to be set, because the timestamp of the block which the transaction is included in is the actual on-chain timestamp”.
  • core/Tron.proto — tronprotocol/protocol — the protobuf definition of the Transaction message, read on 17 November 2026 at commit 8432bec: raw_data (field 1), signature (field 2, repeated bytes), and the Contract sub-message with its type, parameter, and Permission_id (field 5). The Contract sits inside raw_data, so the Permission_id is part of what the transaction ID hashes. Its ContractType enumeration has 41 values, the count behind “roughly forty” in the body. The same file defines TransactionInfo, the execution record whose field 17 holds internal transactions, and the Permission message with its operations field.
  • Procedures_of_transaction_signature_generation.md — tronprotocol/documentation, dd455db — the signing procedure: hash raw_data with SHA-256 to get the txID, sign with ECDSA/secp256k1, 65-byte (r, s, v) recoverable signature. The repository is archived and the file dates from 2018.
  • TRON Developer Hub — Account Permission Management — permission IDs (owner 0, witness 1, active 2+), the Permission_id field on a contract, and the weight-versus-threshold rule for validating a set of signatures. A new account’s default owner and active permissions each hold only the account’s own key. An active permission’s operations field restricts which contract types it may execute.
  • TransactionCapsule.java — tronprotocol/java-tron, b33eed8 — how the node ties the signatures to a permission, read on 20 November 2026 at commit b33eed8 of the develop branch. validateSignature reads the Permission_id from the contract in raw_data and loads that permission from the account. checkWeight recovers an address from each signature over the transaction ID, refuses a signer the permission does not list, and adds up the weights of the rest. The transaction passes only when that sum reaches the permission’s threshold. getTransactionId returns the hash of raw_data, so every signer signs a value that covers the Permission_id.
  • Manager.java — tronprotocol/java-tron, GreatVoyage-v4.8.2.4 — the node’s expiration rule, read raw at that tag on 17 November 2026. validateCommon rejects a transaction whose expiration is not later than the node’s head block time, or is more than MAXIMUM_TIME_UNTIL_EXPIRATION past it.
  • Constant.java — tronprotocol/java-tron, GreatVoyage-v4.8.2.4 — the value of MAXIMUM_TIME_UNTIL_EXPIRATION, one day in milliseconds, and the 60-second TRANSACTION_DEFAULT_EXPIRATION_TIME.
  • smart_contract.proto — tronprotocol/protocol — the protocol definition of TriggerSmartContract (owner_address, contract_address, call_value, data, call_token_value, token_id), the message type this chapter names. Read at commit 8432bec.