Bucket 1: create wallets and addresses
Replace every V3 wallet, private key and address call with one client and one wallet generation per user. This covers 80 endpoints.
| In V3 | In Smart Wallets |
|---|---|
GET /v3/{chain}/wallet returns a mnemonic and xpub | generateWallet() returns two signing shares, one per curve. There is no mnemonic and no xpub. |
POST /v3/{chain}/wallet/priv returns a private key | No key is exposed. Signing uses the stored share. If you need the key, eject the wallet (see Moving existing users and funds in the main guide). |
GET /v3/{chain}/address/:xpub/:i derives address number i | Read the address from getClientDetails(). A wallet has one address per chain family, not an index. |
| One call per chain | One generation covers all EVM chains, Tron, Bitcoin and Litecoin (SECP256K1) and Solana and Stellar (ED25519) |
Create a wallet for a user
// 1. One client per end user
const newClient = await wallets.custodian.createClient({
body: { isAccountAbstracted: true },
});
// Save newClient.id in your database next to the user.
// 2. Scope the SDK to that client
const client = wallets.initClient({ token: newClient.clientApiKey! });
// 3. Generate the wallet. The shares are shown only once.
const shares = await client.generateWallet();
// shares.SECP256K1 covers EVM, Tron, Bitcoin, Litecoin
// shares.ED25519 covers Solana, Stellar
// 4. Encrypt and store both shares now (for example AES-256-GCM, key in your KMS).
// 5. Confirm storage. The wallet is not ready to sign until you do.
await client.updateSigningSharePairs({
body: {
signingSharePairIds: [shares.SECP256K1.id, shares.ED25519.id],
status: "STORED_CLIENT",
},
});
// 6. Read the addresses
const details = await client.getClientDetails();
const evmAddress = details.metadata.namespaces["eip155"].address;- Addresses:
metadata.namespacesis keyed byeip155(the same address on every EVM chain),solana,stellar,tronandbip122(Bitcoin, P2WPKH). - Backup: create backup shares right after generation with
backupWallet(). If you lose both the client signing share and the client backup share, the wallet cannot be recovered. - Deposit addresses: V3 let you derive thousands of addresses from one xpub. A Smart Wallet has one address per chain family, so create one client per user (or per deposit account) instead. [To confirm the recommended pattern for exchange-style deposit addresses.]
- Reference: Wallet generation, Clients, Wallet details, Backup and recovery.
Updated about 8 hours ago
Did this page help you?