TON Connect Authentication Development

We design and develop full-cycle blockchain solutions: from smart contract architecture to launching DeFi protocols, NFT marketplaces and crypto exchanges. Security audits, tokenomics, integration with existing infrastructure.
Showing 1 of 1 servicesAll 1306 services
TON Connect Authentication Development
Medium
~2-3 business days
FAQ
Blockchain Development Services
Blockchain Development Stages
Latest works
  • image_website-b2b-advance_0.png
    B2B ADVANCE company website development
    1214
  • image_web-applications_feedme_466_0.webp
    Development of a web application for FEEDME
    1161
  • image_websites_belfingroup_462_0.webp
    Website development for BELFINGROUP
    852
  • image_ecommerce_furnoro_435_0.webp
    Development of an online store for the company FURNORO
    1041
  • image_logo-advance_0.png
    B2B Advance company logo design
    561
  • image_crm_enviok_479_0.webp
    Development of a web application for Enviok
    823

Development of TON Connect Authorization

TON Connect — wallet connection protocol for dApps in TON ecosystem. Analogous to SIWE/WalletConnect, but developed natively for TON. Supported by all major TON wallets: Tonkeeper, MyTonWallet, Tonhub. Particularly powerful in Telegram Mini Apps context — native integration.

TON Connect Architecture

Bridge: TON Connect uses bridge service to relay messages between dApp and wallet. User doesn't need to be on same device as dApp (deep links + QR codes work cross-device).

Session: after connection — persistent session stored in wallet. Repeated connection doesn't require new QR code.

Transaction signing: TON Connect not just for auth — can request transaction signing.

Frontend Implementation

import TonConnectUI from '@tonconnect/ui-react';
import { TonConnectButton, useTonConnectUI, useTonAddress } from '@tonconnect/ui-react';

// Initialization (at app root)
const App = () => (
    <TonConnectUIProvider manifestUrl="https://your-app.com/tonconnect-manifest.json">
        <YourApp />
    </TonConnectUIProvider>
);

// Connect button component
function ConnectButton() {
    return <TonConnectButton />; // Ready UI component
}

// Get connected wallet address
function WalletInfo() {
    const address = useTonAddress(); // raw or user-friendly format
    return <div>Connected: {address}</div>;
}

tonconnect-manifest.json

Required file at known URL:

{
    "url": "https://your-app.com",
    "name": "Your App Name",
    "iconUrl": "https://your-app.com/icon.png",
    "termsOfUseUrl": "https://your-app.com/terms",
    "privacyPolicyUrl": "https://your-app.com/privacy"
}

This file is shown to user on connection — verification this is legitimate application.

Backend Verification

import { TonProofItemReplySuccess } from '@tonconnect/protocol';
import TonWeb from 'tonweb';

async function verifyTonProof(
    proof: TonProofItemReplySuccess['proof'],
    publicKey: string,
    walletAddress: string
): Promise<boolean> {
    const tonweb = new TonWeb();
    
    // Proof verification via TON Connect SDK
    const result = await tonweb.utils.verifyTonConnectProof(
        proof,
        publicKey,
        walletAddress
    );
    
    return result;
}

// Express endpoint
app.post('/api/ton-auth', async (req, res) => {
    const { walletInfo } = req.body;
    
    if (walletInfo.connectItems?.tonProof?.type === 'ton_proof') {
        const isValid = await verifyTonProof(
            walletInfo.connectItems.tonProof.proof,
            walletInfo.account.publicKey,
            walletInfo.account.address
        );
        
        if (isValid) {
            req.session.user = { address: walletInfo.account.address };
            res.json({ success: true });
        }
    }
});

Telegram Mini App Specifics

In Telegram Mini App TON Connect works without QR codes — wallet opens inline in Telegram:

import { useTonConnectUI } from '@tonconnect/ui-react';

function TelegramMiniAppConnect() {
    const [tonConnectUI] = useTonConnectUI();
    
    // In Telegram Mini App — opens wallet inside Telegram
    const handleConnect = async () => {
        if (window.Telegram?.WebApp) {
            // Special behavior for Telegram
            await tonConnectUI.openModal();
        }
    };
}

TON Connect auth — 2-5 days for integration. Telegram Mini Apps make this even faster thanks to ready UI components.