This is a DIY orchestration guide, not a managed sponsorship product. 0xkey provides the secure keys, in-enclave Tron transaction parsing, and
tron.tx.* policy control you need to build this yourself — it does not (yet) auto-insert resource delegation into a user’s signing path. See 0xkey and Tron for baseline Tron support.Why Tron gasless is different from EVM Gas Station
Tron has no EIP-7702-style paymaster and no nativesponsor: true fee-payer switch like Solana sponsorship. Tron’s fee model runs on Bandwidth and Energy, which accounts obtain by staking (freezing) TRX. Gasless UX on Tron is achieved by:
Sponsor account stakes TRX for Bandwidth/Energy → delegates that resource to the end-user’s address → the end-user signs and broadcasts their own transaction, which consumes the delegated resource first.
Because the mechanisms are fundamentally different, 0xkey does not (and will not) extend EIP-7702 Gas Station to Tron.
Setup guide
1. Stake TRX for resources (sponsor wallet)
Fund a 0xkey-managed wallet (your organization’s own address, or a dedicated sponsor sub-wallet) with TRX, then freeze it for Bandwidth or Energy viaFreezeBalanceV2:
signTransaction({ type: "TRANSACTION_TYPE_TRON" }) — see Client-side construction and signing.
TRC-20 transfers consume both Bandwidth and Energy. If your users interact with smart contracts, freeze for both resource types — freezing only Bandwidth still leaves users burning TRX for Energy.
2. Delegate the resource to end-user wallets
Once the sponsor wallet has a resource pool, delegate it to a specific user address withDelegateResource:
owner_address: the sponsor wallet that staked TRX (step 1)receiver_address: the end user’s walletbalance: sun-denominated stake backing the delegated resourcelock/lock_period: setlock: truewith alock_period(in blocks, ~3s/block) if you want the delegation to be non-revocable for a period — otherwise you canUnDelegateResourceat any time
wallet/getaccountresource for the user before their first send, and only delegate if their available resource is insufficient). See the trade-offs table below.
3. End-user transaction flow
After delegation, the end user’s experience is unchanged from a normal 0xkey Tron signing flow — they sign and broadcast their own business transaction (see Client-side construction and signing). The Tron protocol automatically consumes their available resource (own stake + delegated-in resource + daily free Bandwidth) before falling back to burning TRX; this consumption order cannot be customized by 0xkey, Turnkey, or any application.4. Reclaiming resources
The sponsor wallet can reclaim delegated resources at any time withUnDelegateResource — the end user does not need to sign or approve this:
lock: true delegations cannot be reclaimed until lock_period elapses. Resources the user has already consumed (or that are inside Tron’s 24h usage-recovery window) may not be reclaimable in full immediately — query wallet/getdelegatedresourcev2 and wallet/getaccountresource and reconcile before assuming a full recall.
Policy: separate sponsor and user permissions
Split policies across the sponsor wallet and end-user wallets so a compromised user credential cannot touch the resource pool, and the sponsor role cannot sign arbitrary user business transactions: Sponsor wallet policy — allow only delegation/staking operations, capped and allowlisted:TronContract field list (resource, receiver_address, balance, lock, lock_period, frozen_balance, unfreeze_balance).
Operational notes
fee_limitstill matters. Even with Energy sponsored, set a sanefee_limiton smart-contract calls — it bounds how much TRX a transaction is allowed to burn if delegated Energy runs out mid-execution. Estimate it withtriggerconstantcontractbefore building the real transaction.- Security blast radius. A leaked end-user key lets an attacker drain the user’s delegated resource (or force TRX burn) — it cannot touch the sponsor wallet’s staked principal. Mitigate with per-user delegation caps, anomaly alerting on resource burn, and auto-
UnDelegateResourcefor dormant accounts. - Consumption order is fixed. You cannot configure “spend the sponsor’s delegation before the user’s own stake” — Tron’s protocol always resolves available resource as one pool.
- This is orthogonal to custodial send. This guide is entirely client-side resource orchestration (freeze/delegate/undelegate) — it works whether the business transaction itself is broadcast client-side or through 0xkey’s custodial
tronSendTransaction. Custodial send does not yet auto-check or auto-delegate resources before broadcasting; you’re still responsible for keeping the end-user’s delegated balance sufficient.