# WalletTg: Telegram wallet contract (https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/overview/content.md)



WalletTg (`tg-wallet`, TgWallet, or Telegram Wallet) is the TON wallet contract used by [Telegram's native Gram wallet](https://ton-blockchain.github.io/docs/llms/onboarding/wallet-apps/telegram/content.md).

## Features [#features]

* Receive Gram, jettons, and non-fungible tokens (NFTs) at a stable address.
* Send a [single message](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/messages/content.md) or a [batch of up to 255 messages](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/messages/content.md).
* Connect to decentralized applications (dApps) through [TON Connect](https://ton-blockchain.github.io/docs/llms/applications/ton-connect/overview/content.md).
* Import [12-word phrases or 24-word rotation mnemonics](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/integrate/content.md) in compatible wallet apps.
* [Rotate the signing key](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/integrate/content.md) while keeping the same address.
* Submit signed internal requests through a [relayer](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/interact/content.md) that attaches Gram for processing.

## Shared implementation [#shared-implementation]

Each account stores immutable *trampoline* code. The trampoline loads the shared implementation from [configuration parameter `-123`](https://ton-blockchain.github.io/docs/llms/foundations/config/content.md), while each account keeps its own balance and storage.

<Image src="/images/wallets/telegram/architecture.svg" darkSrc="/images/wallets/telegram/architecture.svg" alt="WalletTg accounts keep trampoline code and local storage while executing shared implementation code from configuration parameter minus 123." width="900" height="390" />

Validators approve configuration changes through voting. An update changes the implementation used by every WalletTg account on that network. Wallet owners cannot change the implementation or opt out of updates.

The brief [contract reference](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/contract/content.md) documents storage and upgrade migration behavior.

## Two-key rotation architecture [#two-key-rotation-architecture]

WalletTg is the only TON wallet contract that can rotate its public signing key without changing its address. Its [24-word rotation mnemonic](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/mnemonics/content.md) combines two 12-word [multichain mnemonics](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/mnemonics/content.md): the first half derives an *anchor key*, and the second half derives a *signing key*. The complete rotation mnemonic preserves both the anchor and the signing keys.

Initially, an anchor key is also the signing key. The contract's [`StateInit`](https://ton-blockchain.github.io/docs/llms/foundations/messages/deploy/content.md) uses the anchor public key as its first signing public key. The *rotation* replaces the current on-chain signing key with a new one. It requires a request signed by the current private key and a rotation proof signed by the new private key. The anchor key does not change.

After rotation, only the new signing key authorizes requests — the anchor key continues to derive the original address, but it cannot restore signing access on its own.

<Callout type="caution">
  Composing a new `StateInit` with the new signing key would yield a different address. The original `StateInit` must always be composed with the original signing key, which is the anchor key.
</Callout>

## Comparison with V5 [#comparison-with-v5]

[Wallet V5](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/v5/content.md) is the default general-purpose wallet contract on TON. It does not rotate the signing key, has an optional extensions support, and does not allow code upgrades. Additionally, V5 uses a different [messages format](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/v5-api/content.md) compared to the [WalletTg messages](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/telegram/messages/content.md).

WalletTg is used primarily by Telegram. Wallet apps and services should default to Wallet V5 for all new TON wallet contracts, but also support importing rotation mnemonics and managing WalletTg contracts.

<Callout type="note">
  Compare wallet capabilities in the [table](https://ton-blockchain.github.io/docs/llms/contracts/standard/wallets/comparison/content.md).
</Callout>
