# How to sign data with AppKit (https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/sign-data/content.md)



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

## How it works [#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 [#before-you-begin]

You need a connected wallet and the React provider mounted. See [Connect to a wallet](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/connect-to-a-wallet/content.md).

## Pick the right call [#pick-the-right-call]

| Payload type    | Hook            | Core action  |
| --------------- | --------------- | ------------ |
| Plain text      | `useSignText`   | `signText`   |
| Binary (base64) | `useSignBinary` | `signBinary` |
| TON cell (BoC)  | `useSignCell`   | `signCell`   |

All three hooks are mutation hooks. They return `{ mutate, mutateAsync, isPending, error, data }`.

## Sign text [#sign-text]

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

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

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

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

## Sign binary [#sign-binary]

```tsx
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 [#sign-a-cell]

For application protocols that exchange typed payloads, send a TON cell.

```tsx
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 [#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.

## Related pages [#related-pages]

* [AppKit reference](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/reference/reference/content.md)
* [Connect to a wallet](https://docs-rbcpr9qys-ton-core-docs.vercel.app/llms/applications/appkit/howto/connect-to-a-wallet/content.md)
