WalletTg: Telegram wallet contract
WalletTg is the TON wallet contract used by the Telegram's native Gram wallet.
Features
- Receive Gram, jettons, and non-fungible tokens (NFTs) at a stable address.
- Send a single message or a batch of up to 255 messages.
- Connect to decentralized applications (dApps) through TON Connect.
- Import 12-word phrases or 24-word rotation mnemonics in compatible wallet apps.
- Disable Telegram's encrypted backup, with an optional signing-key rotation.
- Rotate the signing key while keeping the same address.
- Submit signed internal requests through a relayer that attaches Gram for processing.
Shared implementation
Each account stores immutable trampoline code. The trampoline loads the shared implementation from configuration parameter -123, while each account keeps its own balance and storage.
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 documents storage and upgrade migration behavior.
Address anchor and signing key
The contract address is derived from the original StateInit, which includes the trampoline code and anchor public key.
Initially, the anchor is also the signing key. Rotation replaces the current on-chain signing key but leaves the original StateInit and address unchanged.
Composing a new StateInit with the replacement key derives a different address.
After rotation, only the current signing key authorizes requests; the anchor cannot restore signing access. The key-management reference explains the two-key mnemonic and rotation.
Backup and self-custody
Telegram's encrypted backup and phrase updates are app features, separate from contract storage.
Comparison with V5
WalletTg and wallet V5 use different signed-request encodings. That is, the layout and composition of their messages differ. Refer to the WalletTg message reference and the V5 reference for details.
Compare wallet capabilities in the table.