🔴

# Tron Integration

Complete guide for integrating Tron networks into your Bicrypto Ecosystem

## 📖 Overview

This guide shows you how to integrate Tron networks (mainnet and testnets like Shasta and Nile) into your Bicrypto Ecosystem. Tron differs from EVM and UTXO chains but follows a similar configuration pattern in Bicrypto.

Tron Network Features

Tron mainnet, Shasta, and Nile testnets are supported. TRX is used for transaction fees. Support for TRC-20 tokens is available.

## 1️⃣ Configure Environment Variables

### Tron Environment Variables

Add the following Tron-specific variables to your `.env` file:

    # Tron Networks (mainnet, shasta, nile)
    TRON_API_KEY="YOUR_TRON_API_KEY"  # e.g., 7afcd010-b06b-449d-b882-902bc55f7e8e
    TRON_NETWORK="mainnet"
    TRON_MAINNET_RPC="https://YOUR_MAINNET_RPC_PLACEHOLDER"
    TRON_SHASTA_RPC="https://YOUR_SHASTA_RPC_PLACEHOLDER"
    TRON_NILE_RPC="https://YOUR_NILE_RPC_PLACEHOLDER"

• TRON_API_KEY: Your TronGrid (or similar) API key

• TRON_NETWORK: Active network (mainnet, shasta, or nile)

• RPC URLs: Corresponding endpoints for each Tron network

## 2️⃣ Acquire TronGrid Endpoints

TG

### TronGrid API

Create an account at TronGrid or use a self-hosted node. TronGrid provides API keys for authenticated requests.

#### Common Endpoints:

• Mainnet: `https://api.trongrid.io`

• Shasta: `https://api.shasta.trongrid.io`

• Nile: `https://api.nileex.io`

## 3️⃣ Apply Environment Updates

## 4️⃣ Configure Master Wallet

Tron Master Wallet

Tron uses TRX as its native coin for transaction fees. The Master Wallet will manage TRX fees and any TRC-20 tokens.

## 5️⃣ Enable Tokens and Configure Fees

Tron Token Types

Enable TRX (native) and TRC-20 tokens (e.g., USDT on Tron) that you plan to support.

## 🔍 Tron-Specific Considerations

### Low Transaction Fees

Tron fees are typically low, but peak network usage can increase resource consumption. Adjust minimum fees accordingly.

### Testnet Development

For testing, set `TRON_NETWORK="shasta"` or `"nile"`. Acquire test TRX from faucets.

## 🔒 Security & Best Practices