TRON Streams
You can find the schema here.
TRON produces blocks approximately every 3 seconds, offering high throughput for transactions and smart contracts.
Structure of On-Chain Data​
The TRON Protobuf Streams provide three main message types for different use cases:
BlockMessage: Full blocks with detailed transaction informationTokenBlockMessage: Focused on token transfersDexBlockMessage: Specialized for DEX (Decentralized Exchange) trading activity
Block-Level Data​
Each block in the stream includes a BlockHeader with fields such as:
Number: Block height in the chainHash: The unique identifier of the blockTimestamp: When the block was producedParentHash: Hash of the previous blockTxTrieRoot: Merkle root of transactionsAccountStateRoot: State root hashTransactionsCount: Number of transactions in this block
The BlockMessage also includes:
Chain: Information about the blockchainWitness: Details about the block producer (Super Representative)Address: The witness account addressId: Witness identifierSignature: Block signature
Transaction-Level Data​
Transactions include:
-
TransactionHeader: Core transaction dataHash: Transaction hashFee: Transaction feeIndex: Position in the blockExpiration: When the transaction expiresFeeLimit: Maximum fee allowedSignatures: Transaction signaturesFeePayer: Account that pays the fee
-
Result: Execution outcomeStatus: Transaction statusSuccess: Whether transaction succeededMessage: Error message if failed
-
Receipt: Resource consumption detailsEnergyUsageTotal: Total energy consumedEnergyFee: Fee paid for energyNetUsage: Bandwidth usedNetFee: Fee paid for bandwidth
Contract Data​
The Contract section contains detailed information about smart contract interactions:
-
Address: Contract address -
Type: Contract type (e.g., "TransferContract", "TriggerSmartContract") -
TypeUrl: Protocol buffer type URL -
Arguments: Contract-specific arguments -
InternalTransactions: Sub-transactions created during executionCallerAddress: Initiator addressTransferToAddress: Recipient addressCallValues: Assets transferredNote: Additional information
-
Logs: Event logs emitted by the contract -
Trace: Detailed execution trace (similar to EVM) -
RewardWithdraw: Information about reward distribution
Token Data​
The TokenBlockMessage stream provides information about token transfers:
TokenTransfer: Records token movements with:Sender: Address sending tokensReceiver: Address receiving tokensAmount: Amount of tokens transferredCurrency: Detailed token informationSuccess: Whether the transfer succeeded
TRON supports multiple token standards:
- TRC10: Native TRON tokens identified by TokenId
- TRC20: Similar to ERC20 on Ethereum
- TRC721/TRC1155: Non-fungible tokens
DEX (Decentralized Exchange) Data​
The DexBlockMessage stream is specialized for DEX trading activity:
DexTrade: Records of trades executed on DEXsBuy/Sell: Both sides of the tradeDex: Information about the exchangeSuccess: Whether the trade succeededFees: Trading fees paid
TRON-Specific Features​
TRON has several unique features compared to other blockchain protocols:
- Energy and Bandwidth Model: Instead of a simple gas model, TRON uses Energy for smart contract execution and Bandwidth (Net) for transaction size
- Witness System: Block producers are called Witnesses or Super Representatives
- Contract Types: TRON has predefined contract types for common operations
- TRC10 Tokens: Native token support without smart contracts, referenced by TokenId
- Resource Delegation: Users can delegate resources to each other
Using This Stream in Python, JavaScript, and Go​
Python, JavaScript, and Go code samples can be used with these streams by changing the topic to one of:
tron.raw.proto(for raw block data)tron.transactions.prototron.tokens.prototron.dextrades.prototron.broadcasted.raw.proto(for raw broadcasted block data)tron.broadcasted.transactions.proto(for broadcasted transactions)tron.broadcasted.tokens.proto(for broadcasted token transfers)tron.broadcasted.dextrades.proto(for broadcasted DEX trades)
The Python package bitquery-pb2-kafka-package includes all schema and is up to date so you don't have to manually install schema files.