Learn how to create and manage Sub Accounts using Smart Wallet
Smart Wallet’s self-custodial design requires a user passkey prompt for each wallet interaction that the user is presented with, such as a transaction or message signing. While this helps ensure the user is aware and required to approve of every interaction with their wallet, this also impacts user experience when using applications that may require frequent wallet interactions.
To support using Smart Wallet with user experiences that require more developer control over the wallet interactions, we’ve built Sub Accounts in conjunction with ERC-7895, a new wallet RPC for creating hierarchical relationships between wallet accounts.
Sub Accounts allow you to provision wallet accounts that are directly embedded in your application for your users. You can control when a Sub Account is created for your user, and can interact with them just as you would with another wallet via the wallet provider, or other popular web3 libraries like OnchainKit, wagmi, viem, etc.
These Sub Accounts are linked to the end user’s Smart wallet through an onchain relationship. When combined with our Spend Permission feature, this creates a powerful foundation for provisioning and funding app accounts, securely, while giving you, the developer, ample control over building the user experience that makes the most sense for your application.
If you would like to see a live demo of Sub Accounts in action, check out our Sub Accounts Demo.
In this guide, we’ll set up a basic React app using NextJS and Wagmi that:
If you want to skip ahead and just get the final code, you can find it here:
Project Setup - Learn how to set up a NextJS project with Wagmi and configure Smart Wallet Sub Accounts. This guide covers:
Using Sub Accounts - Explore how to interact with Sub Accounts in your application. This guide demonstrates:
useSignMessage
useSendTransaction
Sub Accounts with Privy - Learn how to use Sub Accounts with Privy. This guide demonstrates:
Learn how to create and manage Sub Accounts using Smart Wallet
Smart Wallet’s self-custodial design requires a user passkey prompt for each wallet interaction that the user is presented with, such as a transaction or message signing. While this helps ensure the user is aware and required to approve of every interaction with their wallet, this also impacts user experience when using applications that may require frequent wallet interactions.
To support using Smart Wallet with user experiences that require more developer control over the wallet interactions, we’ve built Sub Accounts in conjunction with ERC-7895, a new wallet RPC for creating hierarchical relationships between wallet accounts.
Sub Accounts allow you to provision wallet accounts that are directly embedded in your application for your users. You can control when a Sub Account is created for your user, and can interact with them just as you would with another wallet via the wallet provider, or other popular web3 libraries like OnchainKit, wagmi, viem, etc.
These Sub Accounts are linked to the end user’s Smart wallet through an onchain relationship. When combined with our Spend Permission feature, this creates a powerful foundation for provisioning and funding app accounts, securely, while giving you, the developer, ample control over building the user experience that makes the most sense for your application.
If you would like to see a live demo of Sub Accounts in action, check out our Sub Accounts Demo.
In this guide, we’ll set up a basic React app using NextJS and Wagmi that:
If you want to skip ahead and just get the final code, you can find it here:
Project Setup - Learn how to set up a NextJS project with Wagmi and configure Smart Wallet Sub Accounts. This guide covers:
Using Sub Accounts - Explore how to interact with Sub Accounts in your application. This guide demonstrates:
useSignMessage
useSendTransaction
Sub Accounts with Privy - Learn how to use Sub Accounts with Privy. This guide demonstrates: