Skip to main content
This document provides instructions for integrating TON Connect into wallets and other custodian services in browser extensions and in-wallet browsers. 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 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 the window.[custodian].tonconnect property. This bridge must implement a defined interface, allowing dApps to call its methods and receive appropriate responses from the wallet.
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. Managing wallet connections
  2. Listening for messages from connected dApps
  3. 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.

Interacting with the dApp

To interact with the dApp wallet, implement the TonConnectBridge 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: 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