> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xkey.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Tron support on 0xkey

<Note>
  Tron address derivation, in-enclave transaction parsing, `tron.tx.*` policy contexts, secp256k1 signing via `SIGN_TRANSACTION_V2`, and custodial `tronSendTransaction` (server-side build, broadcast, and status monitoring — TRX and TRC-20) are all available today. There is no fee sponsorship product for Tron yet — see [Gasless Tron transactions](/reference/tron-gasless-transactions) for the DIY resource-delegation path.
</Note>

## Address derivation

0xkey supports Tron address derivation with `ADDRESS_FORMAT_TRON`. Tron addresses are derived from the same SECP256k1 curve used for Ethereum addresses, but with a different address encoding (base58check, `T...`).

<Note>
  0xkey's SDK helper derives Tron accounts at the shortened path `m/44'/195'/i'` (matching [SLIP-44](https://github.com/satoshilabs/slips/blob/master/slip-0044.md) coin type 195), not the fully-qualified `m/44'/195'/0'/0/0`. If you create a Tron wallet account through the Dashboard instead of the SDK, it uses the full path and will derive a **different** address for the same seed. Pick one convention per organization and keep it consistent.
</Note>

## Custodial send

For server-side build → policy-checked sign → broadcast → status monitoring in a single call, use `tronSendTransaction`. It supports native TRX transfers and TRC-20 transfers (0xkey ABI-encodes `transfer(address,uint256)` and estimates `fee_limit` for you via `triggerconstantcontract`):

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { ZeroXKey } from "@0xkey-io/sdk-server";

const zeroXKeyClient = new ZeroXKey({
  apiBaseUrl: "https://api.0xkey.com",
  apiPrivateKey: process.env.API_PRIVATE_KEY!,
  apiPublicKey: process.env.API_PUBLIC_KEY!,
  defaultOrganizationId: process.env.ORGANIZATION_ID!,
});

// Native TRX transfer
const trxStatusId = await zeroXKeyClient.tronSendTransaction({
  transaction: {
    from: process.env.TRON_ADDRESS!,
    to: "TY1jfzP3s94oSzYECC89EFn17iA8S4imVZ",
    caip2: "tron:0x2b6653dc", // mainnet; use "tron:0xcd8690dc" for Nile
    value: "1000000", // 1 TRX, denominated in sun
  },
});

// TRC-20 transfer (e.g. USDT) — pass the contract address and token amount instead of `value`
const trc20StatusId = await zeroXKeyClient.tronSendTransaction({
  transaction: {
    from: process.env.TRON_ADDRESS!,
    to: "TY1jfzP3s94oSzYECC89EFn17iA8S4imVZ",
    caip2: "tron:0x2b6653dc",
    contractAddress: "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", // USDT (mainnet)
    tokenAmount: "1000000", // in the token's atomic unit (USDT has 6 decimals)
  },
});
```

Both calls run the transaction through the in-enclave parser and `tron.tx.*` policy engine before signing, then broadcast via TronGrid and track confirmation. Poll status with [Get Send Transaction Status](/api-reference/queries/get-send-transaction-status). `tronSendTransaction` is also available as a React hook in `@0xkey-io/react-wallet-kit` and `@0xkey-io/react-native-wallet-kit`.

<Note>
  Duplicate broadcasts of an already-known transaction are treated as an idempotent success. `TAPOS_ERROR` / `TRANSACTION_EXPIRATION_ERROR` are safely retried by rebuilding against a fresh reference block — Tron has no nonce, so there is no replacement/cancellation semantics to reason about.
</Note>

There is no fee-sponsorship (`sponsor: true`) product for Tron custodial send yet — see [Gasless Tron transactions](/reference/tron-gasless-transactions) for the current DIY resource-delegation path.

## Client-side construction and signing

If you'd rather build and broadcast the transaction yourself (e.g. for contract calls `tronSendTransaction` doesn't model yet), use [TronWeb](https://github.com/tronprotocol/tronweb) (or any other Tron transaction builder) against a TronGrid-compatible RPC. You serialize the unsigned transaction client-side, then hand it to 0xkey for policy-checked signing.

```typescript theme={"theme":{"light":"github-light","dark":"github-dark"}}
import { ZeroXKey } from "@0xkey-io/sdk-server";
import { TronWeb } from "tronweb";

const zeroXKeyClient = new ZeroXKey({
  apiBaseUrl: "https://api.0xkey.com",
  apiPrivateKey: process.env.API_PRIVATE_KEY!,
  apiPublicKey: process.env.API_PUBLIC_KEY!,
  defaultOrganizationId: process.env.ORGANIZATION_ID!,
});

const tronWeb = new TronWeb({ fullHost: "https://nile.trongrid.io/" }); // Nile testnet

const zeroXKeyAddress = process.env.TRON_ADDRESS!; // Your Tron address in 0xkey
const recipientAddress = "TY1jfzP3s94oSzYECC89EFn17iA8S4imVZ";
const amount = 100; // Amount in SUN (1 TRX = 1,000,000 SUN)

// 1. Build the unsigned transaction client-side
const unsignedTx = await tronWeb.transactionBuilder.sendTrx(
  recipientAddress,
  amount,
  zeroXKeyAddress,
);

// 2. Sign with 0xkey — runs through the in-enclave parser + policy engine
const signedTx = await zeroXKeyClient.apiClient().signTransaction({
  signWith: zeroXKeyAddress,
  unsignedTransaction: unsignedTx.raw_data_hex,
  type: "TRANSACTION_TYPE_TRON",
});

// 3. Broadcast yourself
const result = await tronWeb.trx.sendHexTransaction(signedTx.signedTransaction);
console.log("Transaction sent! ID:", result.txid);
```

`signTransaction` (`ACTIVITY_TYPE_SIGN_TRANSACTION_V2`) runs the raw `raw_data_hex` through 0xkey's in-enclave Tron parser before signing, so `tron.tx.*` policy conditions can inspect the transaction's contract fields. If you only need a bare signature over an arbitrary hash (no parsing, no `tron.tx.*` policy visibility), you can instead use `signRawPayload` with `hashFunction: "HASH_FUNCTION_SHA256"` over `raw_data_hex` — but policies that reference `tron.tx.*` will evaluate those conditions as not applicable for raw-payload signs.

## Transaction parsing, policies, and signing

0xkey runs a Tron transaction parser inside the secure enclave to decode the unsigned `raw_data` protobuf and expose its fields to the policy engine under `tron.tx.*`. See the `TronTransaction` / `TronContract` structs in the [policy language](/concepts/policies/language#tron) page for the full field list.

The parser currently decodes the following Tron contract types with full field fidelity:

* `TransferContract` (TRX transfers)
* `TransferAssetContract` (TRC-10 transfers)
* `TriggerSmartContract` (smart contract calls, including TRC-20)
* `FreezeBalanceV2Contract` / `UnfreezeBalanceV2Contract` (Stake 2.0)
* `WithdrawExpireUnfreezeContract`
* `DelegateResourceContract` / `UnDelegateResourceContract` (resource delegation, used for gasless UX — see [Gasless Tron transactions](/reference/tron-gasless-transactions))
* `AccountPermissionUpdateContract` (multisig permission updates)

Other contract types still parse (so signing does not fail), but only `contract_type` is populated — field-level policy conditions for those types are not yet available.

As with EVM and Solana, 0xkey binds the digest the policy engine evaluated to the exact bytes the enclave signer signs (`signing_hash`), so a ruling can never be replayed against a different transaction.

See the [Tron policy examples](/concepts/policies/examples/tron) for sample policies.

## Import and export formats

0xkey offers wallet or private key imports and export functionality. Tron accounts use the same SECP256k1 key material as Ethereum, so imports/exports follow the same formats — see the [import](/embedded-wallets/code-examples/import) and [export](/embedded-wallets/code-examples/export) guides.

## Networks

The Tron parser and policy engine are chain-agnostic across Tron networks — they operate on the transaction bytes, not on network configuration. Point your transaction builder's RPC at the network you want:

* Tron mainnet
* Tron Nile testnet
* Tron Shasta testnet

## Examples and demos

You can find a full walkthrough — wallet creation, raw payload signing, and `tron.tx.*` policy examples for TRX and TRC-20 transfers — in [`examples/with-tron`](https://github.com/0xkey-io/sdk-js/tree/main/examples/with-tron).

## Roadmap

Fee sponsorship for custodial Tron sends (a Tron-native `sponsor: true`, backed by resource delegation rather than a fee-payer signer) is not yet productized — see [Gasless Tron transactions](/reference/tron-gasless-transactions) for the DIY path today. Track status on the [Roadmap](/0xkey/roadmap).
