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 bridge service and how to set it up
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
The TON Connect bridge serves as a transport mechanism for delivering messages between applications (dApps) and wallets. It enables end-to-end encrypted communication where neither party needs to be online simultaneously.Setup options
Option 1: On-premise solution
Custodians can run the TON Connect Bridge themselves. This approach provides full control over the infrastructure and data. For this option, you can deploy the official TON Connect Bridge implementation. You will need to:- Set up a dedicated bridge instance following the repository documentation
- Create a DNS entry pointing to your bridge
- Configure your infrastructure (load balancers, SSL certificates, etc.)
- Maintain the bridge and provide updates
Option 2: SaaS solution
TON Foundation can provide a Software-as-a-Service (SaaS) solution for custodians who prefer not to maintain on-premise infrastructure. To request access to the SaaS solution, contact the TON Foundation business development team. This managed service includes:- Hosted bridge infrastructure
- Maintenance and updates
- Technical support
- Service level agreements
Bridge endpoints and protocol
The TON Connect Bridge protocol uses these main endpoints:-
SSE Events Channel — For receiving messages:
-
Message Sending — For sending messages:
client_id
and sender_id
are the public keys of the wallet’s session in hex.
To read more about the bridge protocol, please refer to the TON Connect Bridge documentation.
TON Connect protocol
TON Connect enables communication between wallets and dApps. For custodian wallets, the integration has these core components:- Establishing secure sessions with dApps
- Handling universal links in the browser
- 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.
Session management and encryption
The foundation of TON Connect is secure communication using the SessionCrypto class:Bridge communication
TON Connect uses a bridge service as a relay for messages between dApps and wallets:Handling TON Connect links for new connections
When a user opens a connection link in your browser wallet, this flow begins:ConnectRequest
documentation for more details.
Listening for messages from connected dApps
After establishing connections, you need to listen for messages from connected dApps:Disconnecting from dApps
Allow users to disconnect from dApps when needed, this action is initiated by the user on the custodian’s side: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:
This library provides examples and utilities for TON blockchain operations, but custodians will need to adapt these patterns to work with their specific signing infrastructure and APIs.
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 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: