More about TON Connect
overview of the protocol and its role in the TON ecosystem
Wallet manifest
what is the manifest and how to prepare it
Bridge
what is the JavaScript bridge and how to use it
Protocol
what is the protocol and how to implement it
Signing
signing processes and reference implementations
Support
how to get help and schedule technical consultations
FAQ
frequently asked questions about TON Connect implementation
See also
additional links and references
TON Connect bridge
A TON Connect bridge acts as a communication layer between decentralized applications (dApps) and wallets. The wallet extension should expose the bridge using thewindow.[custodian].tonconnect property.
This bridge must implement a defined interface, allowing dApps to call its methods and receive appropriate responses from the wallet.
TON Connect protocol
TON Connect enables communication between wallets and dApps. For custodian wallets, the integration has these core components:- Managing wallet connections
- Listening for messages from connected dApps
- Disconnecting from dApps
Setting up the protocol
We recommend using the@tonconnect/protocol package to handle the TON Connect protocol. But you can also implement the protocol manually.
@tonconnect/protocol documentation for more details.
Interacting with the dApp
To interact with the dApp wallet, implement theTonConnectBridge interface and inject it into the window.[custodian].tonconnect property. Below is the sample implementation of the protocol:
TON Connect signing
The signing process is a critical component when integrating TON Connect with custodians. Two key cryptographic operations are required: Transaction Signing and TON Proof Signing.Transaction signing
For transaction signing implementation, you can refer to the@ton/ton library where wallet integrations are implemented. Please note that this serves as a reference implementation to understand how to achieve transaction signing:
@ton/crypto: https://github.com/ton-org/ton-crypto@ton/core: https://github.com/ton-org/ton-core@ton/ton: https://github.com/ton-org/ton
TON Proof implementation
For implementing the necessary functionality, two key resources are available:- This document provides the complete specification for address proof signatures
- Describes the required format and cryptographic requirements
- This example demonstrates verification of
ton_proof(not signing) - Useful for understanding the proof structure and validation logic
Reference implementations
For practical examples of TON Connect signing implementations, you can review these wallet integrations: These implementations demonstrate how different wallets handle TON Connect signing operations and can serve as reference points for custodian implementations.Support and assistance
For questions or clarifications during your integration process:- Add comments directly in this document for specific technical clarifications
- Engage with the TON Foundation team through our technical chat channels
- Contact the TON Foundation business development team to provide access to the technical team for consultations
- Request a meeting through our technical chat channels
- Contact the TON Foundation business development team to arrange technical discussions
- Providing technical documentation and specifications
- Sharing reference implementations and code examples
- Offering consulting and troubleshooting assistance
- Helping with testing and verification
FAQ
What are the correct network chain IDs for TON Connect?
The TON blockchain uses specific network chain identifiers in the TON Connect protocol:- Mainnet:
CHAIN.MAINNET(-239) - Testnet:
CHAIN.TESTNET(-3)
CHAIN enum. When handling TON Connect requests, you’ll encounter these network identifiers in transaction requests, address items, and connection payloads to specify which TON network the operation should target.
See also
- TON Connect specification:
- Reference implementations:
- Integration examples: