Why TON funds came back: bounced messages
Last updated:
Endpoint and plans: TON RPC endpoint.
At a glance
| Property | Value |
|---|---|
| When a bounce is sent | The message is bounceable, processing failed, and enough value is left |
| Bounce message | Source and destination swapped; bounced = true; bounce = false |
| Bounce body | 0xffffffff followed by the start of the original body |
| Wallet addresses | Non-bounceable form, so undeployed wallets are credited |
What you see
You sent TON to an address and an incoming message came back to you. The sender's history shows the outgoing message and a returning one with the bounced flag.
Why this happens
TON's documentation on internal messages says a bounce message is sent to the sender when "there is enough Gram to send it left from handling the failed message", "the message is bounceable", and the contract throws an error during the compute phase (or an action fails with the +16 send-mode flag). In the bounce, the source and destination fields are swapped, the bounced flag becomes true, the bounce flag is set to false "to prevent infinite loop", and the body is replaced with 0xffffffff plus the start of the original body. The bounceable flag is also part of the user-friendly address: TON recommends bounceable addresses for smart contracts, so funds come back if a call fails, and non-bounceable addresses for wallets, so a transfer is credited even if the recipient is not initialized.
What to do
- Check the returning message: bounced true and a body starting with 0xffffffff identify a bounce.
- When paying a wallet that may not be deployed yet, send to its non-bounceable (UQ…) form.
- When calling a contract, keep the bounceable form so a failed call returns the value.
- Match a bounce to the original payment by account and logical time, and treat the payment as failed.
When this is not our problem
Bounce behavior is part of TON's message-processing rules and happens on-chain, the same whichever node or API submitted the message, Triport included.
FAQ
- Why did my TON transfer bounce?
- The message was bounceable and processing at the destination failed, so a bounce message was sent back to you.
- Should I use a bounceable or non-bounceable TON address?
- Non-bounceable for wallets that may not be deployed yet; bounceable for smart contracts, so failed calls refund.