Skip to main content
Learn how to create and manage Sub Accounts that provide app-specific wallet accounts embedded directly in your application.

Overview

Sub Accounts allow you to provision dedicated wallet accounts for your users within your application. These accounts are controlled by the user’s main Base Account and provide an enhanced user experience as the user’s interactions produce no passkey prompts or popups. Users can manage all their Sub Accounts at account.base.app.
If you would like to see a live demo of Sub Accounts in action, check out our Sub Accounts Demo.

What you’ll achieve

By the end of this guide, you will:
  • Understand how Sub Accounts work with Base Account
  • Create new Sub Accounts for users
  • Retrieve and manage existing Sub Accounts
  • Implement Sub Account in your Privy project
The code snippets in this guide are based on the following example project:
Base Account Privy Templatehttps://github.com/base/base-account-privy

Setup

Follow the Setup guide to set up Privy with Base Account.

Implementation

Component Setup

Key Methods

Getting Sub Accounts

Use wallet_getSubAccounts to retrieve existing Sub Accounts for a domain:
Get Sub Accounts (components/sections/sub-accounts.tsx)

Creating Sub Accounts

Use wallet_addSubAccount to create new Sub Accounts:
Create Sub Account (components/sections/sub-accounts.tsx)

Network Configuration

Sub accounts work on both Base Mainnet and Base Sepolia:
  • Base Mainnet: Chain ID 8453
  • Base Sepolia: Chain ID 84532

Explore further