Skip to main content
Privy makes it easy to create smart wallets for your users to sponsor gas fees for transactions on Ethereum. This is done by using a paymaster to pay for users’ gas fees.
This guide explains how to use smart wallets from your server to sponsor gas fees for transactions on Ethereum. Using wallets as smart wallets gives your application all the benefits of account abstraction, including gas sponsorship, with the flexibility of wallets.In this setup, an embedded wallet created on your wallet is the signer for the smart wallet. Note that the wallet’s address is not the smart wallet address in this case - it simply authorizes actions taken by the smart wallet. All transactions and assets are tied to the smart wallet.
This guide uses Kernel as the smart wallet contract provider, but your implementation can use any smart wallet provider.

0: Install necessary dependencies

This guide uses Privy’s server SDK to create the wallet, Pimlico’s permissionless package, and viem. Install these packages with the following command:

1: Create a wallet

Create a privy client and use the create method from Privy’s SDK to create a wallet. If you already have a wallet you wish to use, you can skip this step.

2: Get a viem LocalAccount for the wallet

Create a viem LocalAccount object representing the wallet. Use the createViemAccount method from Privy’s SDK.
If your wallet requires an authorization context, you should pass it to the createViemAccount method like so:

3: Create a smart wallet

Use permissionless to create a smart wallet with the wallet as the signer. Learn more about creating smart wallet accounts in the permissionless docs.

4: Create a client for the smart wallet

You can use this smart wallet client to request signatures and transactions from the smart wallet. Learn more about making transactions on the client in the permissonless docs.