This guide explains how to use smart wallets from your server to sponsor gas fees for transactions on Ethereum. Using managed wallets as smart wallets gives your application all the benefits of account abstraction, including gas sponsorship, with the flexibility of managed 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.2: Get a
Create a viem
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’spermissionless
package, and viem
. Install these packages with the following command:1: Create a wallet
Create aprivy
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.3: Create a smart wallet
Usepermissionless
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 thepermissonless
docs.