Embedded Wallets
PartyLayer creates Canton wallets for your users automatically. No seed phrases, no browser extensions, no friction.
How It Works
When a user logs in with createOnLogin: true:
- PartyLayer authenticates the user via Auth0
- A Canton party is allocated on the participant node
- The Auth0 user is mapped to the Canton party via IDP
- A wallet record is stored in the database
- The user can now submit transactions
User Login → Auth0 JWT → Canton Party Allocation → Wallet ReadyCanton Parties as Wallets
In Canton, a party is the equivalent of an address. Key differences from traditional blockchain:
- Parties are human-readable:
myapp_alice::1220abcd... - The participant node holds signing authority (for embedded wallets)
- Privacy is built-in: only transaction participants see data
- No gas fees or token balances needed
Wallet States
const { wallet, isReady } = useWallet();
// wallet object when ready:
{
partyId: 'myapp_alice::1220abcd...',
trustLevel: 'embedded',
address: 'myapp_alice::1220abcd...', // same as partyId
isReady: true,
mpcEnabled: false,
}Auto-Creation
Enable automatic wallet creation on login:
<PartyLayerProvider
config={{
wallet: {
createOnLogin: true, // Creates wallet on first login
showBalance: true, // Show contract count in UI
},
}}
>Manual Wallet Creation
If you prefer to create wallets explicitly:
const { wallet, isReady } = useWallet();
// Wallet is created when useWallet is first called
// if createOnLogin is true. Otherwise:
const pl = usePartyLayer();
const newWallet = await pl.wallet.get(); // Creates if not existsTrust Levels
Every wallet has a trust level that determines who controls signing:
| Level | Name | Signing Authority | Use Case |
|---|---|---|---|
| 1 | Embedded | PartyLayer node | Best UX, simplest setup |
| 2 | Custodial | Third-party (Copper.co) | Higher security |
| 3 | Self-Custody | User's own wallet | Full control |
See Trust Levels Guide for migration between levels.
Wallet Events
pl.on('wallet:created', (wallet) => {
console.log('New wallet:', wallet.partyId);
});
pl.on('wallet:ready', (wallet) => {
console.log('Wallet ready for transactions');
});