Guides
Embedded Wallets

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:

  1. PartyLayer authenticates the user via Auth0
  2. A Canton party is allocated on the participant node
  3. The Auth0 user is mapped to the Canton party via IDP
  4. A wallet record is stored in the database
  5. The user can now submit transactions
User Login → Auth0 JWT → Canton Party Allocation → Wallet Ready

Canton 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 exists

Trust Levels

Every wallet has a trust level that determines who controls signing:

LevelNameSigning AuthorityUse Case
1EmbeddedPartyLayer nodeBest UX, simplest setup
2CustodialThird-party (Copper.co)Higher security
3Self-CustodyUser's own walletFull 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');
});