Documentation Index
Fetch the complete documentation index at: https://companyname-a7d5b98e-docs-new-structure-publish.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
title: Custodian integration for in-wallet browsers and browser extensions sidebarTitle: Browser extensions and browsers noindex: “true”
This document provides manual 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 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: 1. Managing wallet connections 1. Listening for messages from connected dApps 1. Disconnecting from dAppsSetting 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 on GitHub
- @ton/core on GitHub
- @ton/ton on GitHub
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 2. TON Proof verification example - This example demonstrates verification ofton_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: - Tonkeeper - TonDevWallet 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
- TON Connect specification: - Bridge API - Requests and Responses - Session - TON Wallet Guidelines - Workflows - Reference implementations: -@tonconnect/protocol
- TON Connect Bridge
- Integration examples:
- Tonkeeper
- TonDevWallet