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

# TON

> Network-specific features, signature kinds, supported assets, and integration requirements for TON (The Open Network) wallets on the Dfns platform.

TON (The Open Network) is the blockchain behind Telegram. This guide covers TON-specific features when using Dfns wallets.

## Wallet architecture

On TON, wallets are **smart contracts**. Dfns uses wallet contract version 4 (v4), which provides a good balance of features and gas efficiency.

### Wallet lifecycle

1. **Address generation**: When you create a TON wallet in Dfns, an address is derived from the public key
2. **Receiving funds**: You can receive native TON immediately at this address
3. **First outbound transfer**: The wallet contract is deployed on-chain when you make your first outbound transfer

```mermaid theme={null}
flowchart LR
    A[Create wallet] --> B[Address derived]
    B --> C[Receive TON]
    C --> D[First outbound tx]
    D --> E[Contract deployed]
```

<Note>
  You don't need to manually deploy the wallet - Dfns handles this automatically on your first outbound transaction.
</Note>

<Warning>
  If you use the [Broadcast Transaction](/api-reference/wallets/sign-and-broadcast-transaction) endpoint directly, you must include the wallet deployment message in the payload for the first transaction. The automatic deployment only applies to the Transfer API.
</Warning>

## Jetton tokens (TEP-74)

TON uses **Jettons** for fungible tokens, following the [TEP-74 standard](https://github.com/ton-blockchain/TEPs/blob/master/text/0074-jettons-standard.md).

Each token you hold is stored in a separate **Jetton Wallet** - a dedicated contract derived from your main wallet address. You cannot interact with Jetton Wallets directly; transfers go through your main wallet.

### Transferring Jettons

Use the [Transfer Asset](/api-reference/wallets/transfer-asset) endpoint with `kind: Tep74` and the token's `master` contract address.

### How Jetton transfers work

1. You send an "external IN" message to your wallet contract
2. Your wallet sends a transfer request to your Jetton Wallet
3. Your Jetton Wallet transfers tokens to the recipient's Jetton Wallet
4. The recipient's Jetton Wallet sends a notification to the recipient's main wallet
5. Excess TON (from fees) is returned to you

```mermaid theme={null}
sequenceDiagram
    participant You as Your Wallet
    participant JW as Your Jetton Wallet
    participant RJW as Recipient's Jetton Wallet
    participant R as Recipient's Wallet

    You->>JW: 1. Transfer request
    JW->>RJW: 2. Transfer tokens
    RJW->>R: 3. Notification
    RJW-->>You: 4. Return excess TON
```

<Tip>
  Dfns includes 0.1 TON with all Jetton transfers to cover fees along the message chain. Any excess is returned to your wallet.
</Tip>

<Note>
  If you see a `skipped_all_actions` error, it means the transaction didn't have enough TON to pay fees for all messages in the chain. The compute phase succeeded, but the action phase couldn't execute because funds ran out. Ensure your wallet has sufficient TON balance.
</Note>

### Indexing behavior

Dfns relies on notification messages to index inbound Jetton transfers. If a sender omits the notification (to save fees), the transfer may not appear in your transaction history until a subsequent transaction triggers a balance update.

Similarly, Dfns does not index all bounce messages. If a transaction fails and bounces, the balance will be updated on your next successful transaction.

## Transfers

Use the [Transfer Asset](/api-reference/wallets/transfer-asset) endpoint for TON transfers:

* **Native TON**: Use `kind: Native` with amount in nanoTON (1 TON = 1,000,000,000 nanoTON)
* **Jettons**: Use `kind: Tep74` with the token's `master` contract address

Both transfer types support an optional `memo` field.

## Address formats

TON addresses come in two formats:

| Format         | Prefix  | Description                                           |
| -------------- | ------- | ----------------------------------------------------- |
| Bounceable     | `EQ...` | For smart contracts; failed transactions bounce back  |
| Non-bounceable | `UQ...` | For regular wallets; failed transactions don't bounce |

Dfns wallet addresses are **non-bounceable** by default.

<Warning>
  When sending to a bounceable address, ensure the recipient exists and can process the message. Otherwise, consider using the non-bounceable version.
</Warning>

## Fee structure

TON has a complex fee model where you pay fees when:

* Sending messages
* Receiving messages (deducted from the message value)
* Storing data on-chain

Some fees can even be negative (you receive a refund). Dfns abstracts this complexity - you only need to ensure your wallet has enough TON for gas.

## Fee sponsorship

TON wallet v5 supports fee payers (gasless transactions), but Dfns currently uses wallet v4. The Dfns [Fee Sponsor](/features/fee-sponsors) feature is not available for TON at this time.

## SDK integration

For full transaction control, use the Dfns SDK with [@ton/ton](https://ton.org/docs/develop/dapps/apis/sdk). See the [TON integration example](https://github.com/dfns/dfns-sdk-ts/blob/m/examples/libs/ton/basic-tx/main.ts).

## Related resources

* [TON signing examples](/api-reference/sign/ton)
* [Supported networks](/networks)
* [TON documentation](https://docs.ton.org/)
