TRON Developer Documentation

website·Indexed 40 days ago

https://developers.tron.network/docs/getting-start

Developer resources for the TRON network, featuring guides on DApp development, smart contracts, and wallet integration. Includes technical details on the DPoS consensus mechanism, the TRX resource model (Bandwidth and Energy), account management, and infrastructure setup for Super Representatives and RPC providers. Provides walkthroughs for using TronWeb, TronBox, and TronLink across Mainnet, Shasta, and Nile networks.

Tokens
162.9K
Snippets
480
Records
1K
Agent score
73%

What's inside TRON

  1. Overview of the TRON DApp Developer Learning Path

    Track 3 is designed for developers to learn how smart contracts and browser frontends interact on the TRON network. The curriculum uses a 'decentralized library' project as a practical example where users can list books and rent them using test TRX. The development flow covers:

    1. Environment preparation (TronBox, Shasta testnet).
    2. Smart contract development and automated testing.
    3. Deployment and source verification on Shasta.
    4. Frontend integration via TronLink for user authorization.
    5. Synchronizing UI state using transaction receipts and contract events.
  2. Overview of Resource Delegation in TRON Stake 2.0

    In TRON Stake 2.0, staking and delegation are independent. You can lend your staked Bandwidth or Energy to another account without unstaking your TRX. The original TRX remains staked under the owner's name, but the recipient account gains the ability to use the delegated resources.

    Delegatable Resources:

    • Bandwidth: Yes
    • Energy: Yes
    • TRON Power (TP): No (voting rights remain with the staking account)

    Key Constraints:

    • Available Balance: You can only delegate the balance remaining after your current usage in the 24-hour recovery window.
    • Minimum Amount: Minimum delegation is 1 TRX (1,000,000 sun).
    • Recipient Restrictions: You cannot delegate to yourself or to a contract address; the recipient must be an externally-owned account.
    • Stake Version: Only Stake 2.0 resources are delegatable. Stake 1.0 TRX must be unstaked and re-staked via Stake 2.0 to be delegated.
  3. Overview of Super Representative (SR) operational preparation track

    The SR preparation track is designed for teams applying for SR candidacy or managing SR nodes. It focuses on transitioning from a non-producing Fullnode to a production-ready SR environment without requiring immediate Mainnet registration or real block production. The track is divided into six stages:

    1. Understand SR operational responsibilities: Focus on block production, solidification, rewards, voting, and governance.
    2. Plan node and signing environments: Plan CPU architecture, JDK, storage, network, node topology, and environment isolation.
    3. Prepare and inspect a non-producing node: Review configuration, synchronization, peers, logs, and basic monitoring.
    4. Plan permissions and keys: Separate Owner, Active, and Witness permissions; plan key custody and rotation.
    5. Establish operational assurance: Design monitoring, alerting, backups, upgrade paths, and on-call procedures.
    6. Complete incident drills and launch check: Simulate failures (process exit, node lag) and verify recovery procedures.
  4. Overview of BTFS for NFT Metadata Hosting

    BitTorrent File System (BTFS) is a decentralized file-sharing protocol built on the TRON network and BitTorrent ecosystem. It is used to host NFT metadata (JSON files describing token names, images, and attributes) off-chain. The resulting URIs are then used as the tokenURI in TRC-721 contracts, ensuring that metadata does not depend on a single centralized web host.
  5. Overview of Ethereum (EVM) vs TRON (TVM) differences

    When migrating from Ethereum to TRON, several core infrastructure components change. The TRON Virtual Machine (TVM) is largely EVM-compatible but differs in fee models, address formats, and native token precision.
    FeatureEthereum (EVM)TRON (TVM)
    Virtual machineEVMTVM
    Transaction feeGas (ETH)Bandwidth + Energy (Staked TRX)
    Native tokenETH (18 decimals)TRX (6 decimals)
    Address formatHex (0x..., 20 bytes)Base58Check (T..., 21 bytes)
    Compilerupstream solcTRON solc
    JS SDKethers.js / web3.jsTronWeb
    Java SDKWeb3jTrident
    Python SDKweb3.pyTronPy
    Project frameworkTruffle / Hardhat / FoundryTronBox
    Browser IDERemixTronIDE
  6. Overview of the TRC-1155 Multi-Token Standard

    TRC-1155 is the multi-token standard on TRON. Unlike TRC-20 (fungible) or TRC-721 (non-fungible), a single TRC-1155 contract can manage multiple token types simultaneously, identified by a unique id.

    • Fungible Tokens: Tokens with a supply greater than 1.
    • Non-Fungible Tokens (NFTs): Tokens where the supply of a specific id is exactly 1.
    • Semi-Fungible Tokens: Tokens that combine properties of both.

    This standard reduces on-chain redundancy by allowing one contract to handle various token types, each with its own metadata and supply.

  7. Overview of TRC-10 Token Standard

    TRC-10 is a native token standard implemented directly at the TRON blockchain protocol level, meaning it does not rely on the TRON Virtual Machine (TVM). Key constraints include: each account is limited to issuing only one TRC-10 token, and there is a creation fee of 1,024 TRX. For new projects, TRC-20 is recommended due to better DeFi integration and cross-chain compatibility.
  8. Overview of TRON Exchange and Custodial Wallet Integration Track

    This integration track is designed for teams managing deposit addresses, withdrawal signing, and internal ledgers. The goal is to build a minimal prototype on the Shasta testnet for TRX and a test TRC-20 token. The workflow consists of six stages:

    1. Define Account and Asset Model: Establish networks, addresses, asset identity, and responsibility boundaries.
    2. Select Data Sources: Map interfaces to semantics for deposit discovery, verification, and reconciliation.
    3. Detect Deposits: Identify TRX transfers and TRC-20 Transfer events in solidified data.
    4. Implement Idempotent Crediting: Create unique keys from transaction/block positions to prevent double-crediting during rescans.
    5. Implement Withdrawals: Handle approval, resource checks, signing, broadcasting, and state tracking.
    6. Reconcile and Recover: Test cursor rollbacks, query timeouts, and ledger-to-chain reconciliation.
  9. Overview of TRON Virtual Machine (TVM) and EVM Compatibility

    TRON smart contracts execute on the TRON Virtual Machine (TVM), which is a deterministic, sandboxed runtime. The TVM is compatible with the Ethereum Virtual Machine (EVM) at the bytecode level, meaning most Solidity contracts written for Ethereum can be compiled and run on TRON with minimal changes. Key TRON-specific differences include extensions for Bandwidth, Energy, staking, and TRC-10 tokens.
  10. Overview of TronGrid V1 API

    The TronGrid V1 API is a set of high-performance extension APIs built on top of standard TRON node HTTP APIs. It pre-indexes on-chain data to allow for efficient queries of account history, Token transfers, contract events, internal transactions, and block statistics. It is specifically designed for high-frequency queries and business integrations where scanning blocks directly would be inefficient.
  11. Overview of TRON core objects and network layers

    To interact with the TRON network, developers must understand the relationship between these core objects:

    • Account: An entity on the network identified by an address and controlled by a private key.
    • Address: The public identifier for an account used to receive assets.
    • TRX: The native token of the TRON network.
    • Transaction: An on-chain instruction issued by an account (e.g., a transfer).
    • Block: A record containing transactions that the network has included and solidified.
    • Networks: TRON operates on different networks. Mainnet contains assets with real financial value, while Shasta is a testnet used for development and learning. Account states and transaction histories are separate across these networks.
  12. Overview of the TRC-721 NFT Standard

    TRC-721 is the TRON standard for non-fungible tokens (NFTs). It is fully compatible with the Ethereum ERC-721 standard at the interface level, meaning ERC-721 contracts can be ported to TRON by recompiling them with the TRON toolchain (TVM instead of EVM). It provides a common interface for balance queries, ownership lookups, transfers, and approval management, allowing wallets and marketplaces to interact with any compliant contract.