Transatron is a Tron RPC provider that delegates the energy and bandwidth required to process a transaction, so end users can transact on Tron without holding TRX. Apps integrate Transatron as a drop-in replacement for the Tron full node and select a fee-payment mode that fits their UX. This recipe combines Privy’s Tron wallet support with Transatron’s gas sponsorship to broadcast TRX-less transfers from a user’s embedded wallet.Documentation Index
Fetch the complete documentation index at: https://docs.privy.io/llms.txt
Use this file to discover all available pages before exploring further.
Resources
Transatron docs
Official Transatron integration documentation.
Tron raw signing
How Privy signs Tron transactions via
raw_sign.Prerequisites
- A Privy app with Tron support enabled.
- A funded Transatron account and a Spender API key issued from the dashboard. Coupon flows charge the app’s TFN balance and require a Spender key — Non-Spender keys are read-only and will reject coupon creation.
How fee payment works
Transatron supports two non-custodial fee-payment modes that pair well with Privy embedded wallets:| Mode | When to use | User holds TRX? |
|---|---|---|
| Instant payment | The user wallet already holds a small TRX or USDT balance to cover Transatron’s per-tx fee. | Yes (small) |
| Coupon | The app fully sponsors gas. The backend issues a coupon backed by its Transatron balance. | No |
1. Create a Tron wallet for the user
Privy supports Tron at the Tier 2 level. Create the wallet withchain_type: 'tron' and store the returned id, address, and public_key. The wallet’s address can immediately receive TRX, USDT, and other TRC-20 assets.
2. Configure TronWeb to use the Transatron RPC
Point TronWeb athttps://api.transatron.io and attach the API key as a header. All subsequent operations — fee estimation, simulation, and broadcasts — flow through Transatron.
3. Sign Tron transactions with Privy
Privy’sraw_sign returns a 64-byte ECDSA signature, but Tron expects 65 bytes — the trailing recovery byte is either 0x1b or 0x1c. Signing is the only step in the flow that can run on the client; coupon creation and broadcasting still happen on the server, since both require the Transatron API key.
4. Broadcast a sponsored transaction with a coupon
Coupons let the app fully sponsor a user’s transaction. The backend creates a coupon backed by the app’s Transatron balance, returns the coupon ID to the client, and the client attaches the ID to a Privy-signed transaction before broadcasting. The code below runs entirely on the server. If signing happens in a React client (per step 3), replace the inlinesignTronTransaction(...) call with a roundtrip — return the unsigned transaction’s txID to the client, receive the 64-byte signature back, and finalize via attachTronSignature(...) before broadcasting.
Compute the Tron fee limit
Tron rejects transactions whose
fee_limit is lower than the energy required to execute them. Use triggerConstantContract to estimate energy_used and multiply by the live energy_fee from chain parameters. This is the Tron-side fee limit that gets baked into the signed transaction.Get a Transatron fee quote
Simulate the same transfer through Transatron to receive a TFN quote. Transatron returns its quote inside a
transatron object alongside the standard Tron response. Pass the feeLimit from the previous step so the simulation reflects the actual transaction you’ll broadcast.tx_fee_rtrx_account is the fee Transatron will deduct from your account in TFN (1 TFN ≈ 1 SUN of TRX).Create the coupon
Create a coupon sized slightly above the Transatron quote. Transatron refunds any unspent TFN to the app’s account after the transaction is processed.
Build, sign, and broadcast the user transaction
Build the TRC-20 transfer locally, sign the The broadcast response contains a nested
txID with Privy, attach the coupon ID, and broadcast through the Transatron RPC.transatron object that confirms how much TFN was actually charged (tx_fee_rtrx_account) and how much was refunded to the coupon.If the coupon balance is insufficient or the coupon has expired, Transatron does not broadcast the
user transaction. Re-estimate the fee, issue a new coupon, and retry.

