TON IntegrationTON Connect

TON Connect

What TON Connect Is

TON Connect is the standard wallet connection protocol for TON blockchain applications. It provides a secure, standardized mechanism for TON wallets to authenticate with dApps without exposing private keys.

Repute AI uses TON Connect via the @tonconnect/ui-react library to integrate wallet connection into the Telegram Mini App interface.


Integration Overview

The Repute AI Mini App uses @tonconnect/ui-react to render the wallet connection button and manage the connection lifecycle.

import { TonConnectUIProvider, TonConnectButton } from '@tonconnect/ui-react'
 
// Wrap your app with the provider
function App() {
  return (
    <TonConnectUIProvider manifestUrl="https://repute.ai/tonconnect-manifest.json">
      <ReputeApp />
    </TonConnectUIProvider>
  )
}
 
// Use the button component anywhere in your UI
function WalletSection() {
  return (
    <div>
      <TonConnectButton />
    </div>
  )
}

The TonConnectButton component handles the entire connection flow — wallet detection, QR code display, mobile deep linking, and connection state management.


Connection Flow

  1. User taps Connect Wallet — The TON Connect UI opens, showing available wallet options detected on the device
  2. Wallet selection — User selects their preferred wallet (Tonkeeper, OpenMask, MyTonWallet, or other TON Connect–compatible wallet)
  3. Wallet authorization — The selected wallet app opens and presents the connection request. The user approves.
  4. Address returned — The wallet’s public address is returned to Repute AI via the TON Connect protocol
  5. Protocol binding — Repute AI associates the wallet address with the authenticated Telegram identity

What Permissions Are Requested

TON Connect requests and Repute AI uses only:

PermissionRequestedPurpose
Wallet address (public key)YesTo mint the REP soulbound token to your wallet
Transaction signing (minting fee)Yes, explicitly promptedOne-time REP token minting transaction
Arbitrary transaction signingNoNever requested
Private key accessNoNever possible via TON Connect
Account balance or historyNoNot requested

Every transaction submitted to your wallet (including the initial minting fee) requires explicit approval inside your wallet app. No transaction is submitted without your confirmation.


The TON Connect Manifest

The Repute AI TON Connect manifest describes the application to wallets:

{
  "url": "https://repute.ai",
  "name": "Repute AI",
  "iconUrl": "https://repute.ai/icon-192.png",
  "termsOfUseUrl": "https://repute.ai/terms",
  "privacyPolicyUrl": "https://repute.ai/privacy"
}

Wallets display this information to the user during the connection approval step so you can verify you are connecting to the legitimate Repute AI application.


Supported Wallets

WalletPlatformTON Connect Version
TonkeeperiOS, Android, Browser Extensionv2
OpenMaskBrowser Extension (Chrome, Firefox)v2
MyTonWalletiOS, Android, Webv2
TonhubiOS, Androidv2

Any wallet that implements the TON Connect v2 protocol is compatible. The wallet list in the UI is dynamically populated from the TON Connect registry.


Disconnecting

Disconnecting your wallet from Repute AI:

  • Removes the wallet connection from the Repute AI session
  • Does not revoke or transfer your REP soulbound token (it remains in your wallet)
  • Does not change your Telegram-to-wallet binding (permanent once minted)

If you disconnect and reconnect with a different wallet, Repute AI will detect the mismatch with your existing soulbound token binding and prompt you to reconnect with your original wallet.