Skip to main content

Documentation Index

Fetch the complete documentation index at: https://companyname-a7d5b98e-feature-fumodocs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Ask the wallet to sign a payload. AppKit supports plain text, raw binary, and TON cells.

How it works

Signed data attests to application data without sending a transaction. It fits user-facing acknowledgments, off-chain receipts, and signatures that a backend or TON smart contract verifies later. The wallet returns an Ed25519 signature, signing address, wallet timestamp, observed dApp domain, and the original payload. The verifier owns freshness, domain, nonce, and signer checks. For wallet-ownership sign-in, use ton_proof during connection instead.

Before you begin

You need a connected wallet and the React provider mounted. See Connect to a wallet.

Pick the right call

Payload typeHookCore action
Plain textuseSignTextsignText
Binary (base64)useSignBinarysignBinary
TON cell (BoC)useSignCellsignCell
All three hooks are mutation hooks. They return { mutate, mutateAsync, isPending, error, data }.

Sign text

import { useSignText } from '@ton/appkit-react';

const { mutate: signText, data } = useSignText();

signText({
  text: 'Message to sign',
});

// data: { signature, address, timestamp, domain, payload }

Sign binary

import { useSignBinary } from '@ton/appkit-react';

const { mutate: signBinary, data } = useSignBinary();

signBinary({
  bytes: 'base64-encoded-payload',
});

// data: { signature, address, timestamp, domain, payload }

Sign a cell

For application protocols that exchange typed payloads, send a TON cell.
import { useSignCell } from '@ton/appkit-react';
import { beginCell } from '@ton/core';

const { mutate: signCell, data } = useSignCell();

const cell = beginCell().storeUint(42, 32).storeStringTail('hello').endCell();

signCell({
  cell: cell.toBoc().toString('base64'),
  schema: 'message#_ value:uint32 text:Text = Message;',
});

// data: { signature, address, timestamp, domain, payload }

Verify the signature

The wallet returns a signature response that includes signature, address, timestamp, domain, and the original payload. Verify the response server side against the payload and the wallet’s public key before trusting it. Treat the client-side response as a hint, not proof.