Objective
By the end of this guide, you will have:- A 24-word mnemonic phrase (seed phrase) for your wallet
- A calculated wallet address (but not yet deployed on-chain)
- Configuration parameters:
subwalletId
andtimeout
Prerequisites
- Node.js 18+ or TypeScript environment
@ton/ton
,@ton/core
,@ton/crypto
packages installed- Highload Wallet v3 wrapper and compiled contract code
No deployment yet: Creating a wallet calculates its future address but does not deploy it. The wallet will auto-deploy on the first external message (when you send your first transfer).
Step 1: Set up dependencies
Install required packages:Why copy wrappers? The official
@ton/ton
SDK does not include Highload Wallet v3 wrappers yet. Copy HighloadWalletV3.ts
and HighloadQueryId.ts
from the repository until SDK support is added.Step 2: Choose configuration parameters
Highload Wallet v3 requires two configuration parameters at creation time:timeout
Type: uint22
(0 to 4,194,303 seconds)Purpose: Validity window for external messages and cleanup cycle duration The
timeout
determines:
- How long a signed external message remains valid:
created_at
must be within[now - timeout, now]
- When old processed messages rotate to
old_queries
: everytimeout
seconds - When
old_queries
is cleared: after2 × timeout
Range | Use case |
---|---|
Short (60–300s) | Fast certainty if message expires; lower storage costs; requires tight synchronization |
Medium (1–6 hours) | Balanced; suitable for most production use |
Long (24+ hours) | High tolerance for blockchain congestion; higher storage costs; slower certainty on expiration |
Cannot be changed later:
timeout
is part of the contract’s initial configuration. Changing it would change the wallet address entirely.subwalletId
Type: uint32
(0 to 4,294,967,295)Purpose: Isolate multiple wallets derived from the same keypair A single mnemonic can generate multiple independent wallet addresses by varying
subwalletId
. Each wallet has its own balance, state, and transaction history.
Recommended value:
Use a
0x10ad
(4269).Use a
subwalletId
different from other wallet types (standard wallets v3/v4/v5 or vesting wallets) derived from the same keypair. The value 0x10ad
is recommended in the official repository to avoid conflicts with other contracts.subwalletId
across different wallet types (e.g., Highload v3 and standard wallet v5), they might share the same address, causing conflicts. Using 0x10ad
ensures isolation from standard wallets.
See Storage structure in the specification for details.
Step 3: Generate or load a mnemonic
A mnemonic is your wallet’s master secret. It derives the private key used to sign all transactions.Generate a new mnemonic
Load an existing mnemonic
Protect your mnemonic: Anyone with access to your mnemonic can control your wallet and all funds. Store it securely (password manager, hardware wallet, encrypted storage). Never commit it to version control.
Step 4: Derive the keypair
Convert the mnemonic to an Ed25519 keypair:Step 5: Create the wallet instance
Create a Highload Wallet v3 contract instance with your chosen parameters:Step 6: Get the wallet address
Calculate the wallet’s address:CODE
, publicKey
, subwalletId
, and timeout
. The same parameters always produce the same address.
Why non-bounceable? When funding a
nonexist
account, use the non-bounceable format to prevent funds from bouncing back if the account doesn’t exist yet. See Address formats for details.nonexist
The calculated address exists only as a deterministic value. No account exists on the blockchain yet — no balance, no code, no data.
Step 7: Fund the wallet
Funds at risk: You will send TON to this address. Test on testnet first. Verify the wallet address carefully — blockchain transactions cannot be reversed.
nonexist
to uninit
status and provide the balance needed for deployment. See Account statuses for details on how account states work.
Send TON using a faucet (testnet) or from another wallet (mainnet). After funding, the account transitions to uninit
status — it has a balance and can accept external messages, but no code or data yet.
Saving wallet data
For convenience, save your wallet configuration to reuse later:Never commit
.wallet.json
: Add it to .gitignore
. This file contains your mnemonic.