GUIDELINE 02
Create additional wallets consistently
Give every derived wallet one stable, versioned purpose so the same root identity always reconstructs the same application wallet.
Choose a derivation convention
- Use a namespaced purpose such as
com.example.app:rent:v1orcom.example.app:asset:42:v1. - Never reuse one purpose for two roles.
- Do not include display text that users can rename. Use stable application and object identifiers.
- Record public addresses and roles, not derived private keys.
- Version the purpose only when you intend to create a different wallet.
Pick the right helper
For additional wallets on the same cluster, follow the rent test: recover from the root mnemonic with a stable purpose as the passphrase. Reserve js_derive_app_wallet for deriving an application's registration identity on another cluster; when its input key already belongs to the target cluster, it intentionally returns that existing key.
Stable wallet roles
const APP = "com.example.photos";
const purpose = `${APP}:rent:v1`;
const rentWallet = await itza.js_recover_wallet(
rootWallet.mnemonic, purpose, CLUSTER_ID
);
// Persist only this public mapping.
const walletRole = { purpose, address: rentWallet.address };Bottom line
A purpose string is part of your data model. Document it, test that it remains stable, and never silently change it after release.