subwallet_id in the wallet config. Each subwallet_id produces a unique address under the same seed phrase.
Example
Explanation
-
subwallet_id— a 32-bit integer used to derive distinct wallet addresses from the same mnemonic. It is part of the wallet config (WalletV3Config,WalletV4Config, etc. fromton_core), passed to.from_mnemonic()/.from_private_key()/.create()via theconfig=argument. -
Use cases:
- Splitting funds across logical accounts.
- Managing separate balances.
- Creating derived wallets for contract operations.
Important Notes
-
subwallet_idis not supported in:WalletV1*WalletV2*WalletPreprocessedV2
-
Default value: for all wallet types with an integer
subwallet_id(WalletV3*,WalletV4*,WalletHighloadV2,WalletHighloadV3R1) the default is698983191(DEFAULT_SUBWALLET_IDfromton_core). -
WalletV5R1andWalletV5Betause a structured identifier instead of a plain integer:WalletV5SubwalletIDfromton_core, with fieldssubwallet_number(default0),workchain(WorkchainID, default basechain),version(default0), andnetwork(NetworkGlobalID, default mainnet). Ifsubwallet_idis left unset in the config, the library fills it in using the client’s network.WalletV5R1packs the fields into a 32-bit integer XORed with the network global ID;WalletV5Betastores the four fields separately in the wallet data:Default packed values (WalletV5R1):