Skip to main content
This document provides instructions for integrating TON Connect into wallets and other custodian services for iOS, Android, macOS, Windows, Linux, and Web platforms. TON Connect is the standard wallet connection protocol for The Open Network (TON) blockchain, similar to WalletConnect on Ethereum. It enables secure communication between wallets and decentralized applications, allowing users to authorize transactions while maintaining control of their private keys.

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:
  1. Set up a dedicated bridge instance following the repository documentation
  2. Create a DNS entry pointing to your bridge
  3. Configure your infrastructure (load balancers, SSL certificates, etc.)
  4. 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:
  1. Hosted bridge infrastructure
  2. Maintenance and updates
  3. Technical support
  4. 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:
There, 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:
  1. Establishing secure sessions with dApps
  2. Handling universal links in the browser
  3. Managing wallet connections
  4. Listening for messages from connected dApps
  5. 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.
Refer to the @tonconnect/protocol documentation for more details.

Session management and encryption

The foundation of TON Connect is secure communication using the SessionCrypto class:
Refer to the SessionCrypto implementation and Session documentation for more details.

Bridge communication

TON Connect uses a bridge service as a relay for messages between dApps and wallets:
Refer to the bridge API documentation for more details. When a user opens a connection link in your browser wallet, this flow begins:
Refer to Universal link and ConnectRequest documentation for more details.

Listening for messages from connected dApps

After establishing connections, you need to listen for messages from connected dApps:
Refer to the SendTransactionRequest documentation for more details.

Disconnecting from dApps

Allow users to disconnect from dApps when needed. This action is initiated by the user on the custodian’s side:
Refer to the DisconnectEvent documentation for more details.

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:
  1. TON Proof specification
  • This document provides the complete specification for address proof signatures
  • Describes the required format and cryptographic requirements
  1. TON Proof verification example
  • 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
To schedule a consultation call with our technical team:
  • Request a meeting through our technical chat channels
  • Contact the TON Foundation business development team to arrange technical discussions
The TON Foundation is fully committed to supporting custodians throughout this integration process. This support includes:
  • Providing technical documentation and specifications
  • Sharing reference implementations and code examples
  • Offering consulting and troubleshooting assistance
  • Helping with testing and verification
The TON Foundation is committed to supporting custodians throughout their TON Connect integration journey. Our team is available to address technical implementation questions, provide guidance on best practices, and facilitate business discussions to ensure successful integration outcomes.

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)
These values are defined in the TON Connect protocol specification as the 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