Jul 3, 2025
Throughout this guide we’ll be referencing the Privy docs and our GitHub repo demo.
Privy makes it simple to use custom paymasters with embedded wallets without having to manage private keys.
By default, users pay gas fees themselves, but sometimes you’ll want to sponsor transactions to improve user experience. That’s where a custom paymaster comes in.
A paymaster is a smart contract that covers gas fees on behalf of the user. Check out our previous post to learn more about our paymaster. With Privy, you can easily integrate our paymaster to customize gas sponsorship for your app.
We’ve put together this guide to make it easy to implement the SBC Paymaster with Privy’s smart wallets. We also include a simple demo to demonstrate an app that sends gasless transactions.
We’ll go through the process of setting up your Privy dashboard and obtaining an API key for the SBC Paymaster. Then we’ll walk through deploying the demo to see it in action.
Step 1: Privy dashboard configuration using the SBC Paymaster
We first need to set up a Privy account to get access to their dashboard. Within the dashboard, create an app and take note of the App ID. We’ll be using it later in the demo.
Next we’ll need to enable smart wallets and configure the app to work with the SBC Paymaster API. On the Smart wallets page toggle the option to enable smart wallets. Refer to the Privy docs for more details about smart wallets.
We then have the option to select a chain and a smart wallet provider. We chose Kernal (ZeroDev) for this example since our paymaster is currently configured to work with it.

For the chain, we use the Base Sepolia testnet.
Next, go to the the SBC API Dashboard and create an API key for the paymaster configuration. The dashboard is accessible by connecting your crypto wallet.

Then locate the Bundler URL and Paymaster URL fields. This is where you will connect Privy to the SBC Paymaster. Insert the following URL for both the Bundler and Paymaster. Note that the URL is the same for both.
https://api.aa.stablecoin.xyz/rpc/v1/baseSepolia/<api-key>
Replace <api-key>
with an API key from the SBC API Dashboard.

After clicking Save and Close your Privy app is now configured to use the SBC Paymaster. Let's look at the Privy SDK next.
Step 2: Privy SDK configuration (React)
To install and configure the Privy SDK, refer to the docs. For this example, we used a React and Ethereum-based setup.
To install, run npm install @privy-io/react-auth
in the terminal.
For setup, we created a providers.tsx
file and imported the PrivyProvider
component. We included the two required props: appId
and config
. The appId
prop is the app ID from the Privy dashboard. The config
prop let’s us specify Base Sepolia as the chain we want to use.

Next we wrapped the layout.tsx
file with Providers
. (Lines 4 and 31 in the image below.)

In our example, we used wagmi to interface with Ethereum wallets within our app. There are also easy to use guides from Privy for viem and ethers.
Step 3: Privy smart wallet configuration
Refer to Privy’s docs for all the details on configuring smart wallets.
We imported the SmartWalletsProvider
component in the providers.tsx
file. This component was then added to the providers.tsx
file.

We configured the SmartWalletsProvider
component to have sponsored gas and included SBC’s company details.
Follow Privy’s usage docs to see how to implement the smart wallet for your specific use case. You can see how we used the smart wallet in the page.tsx
file.
The smart wallet and gasless transaction logic was then set up in the GaslessTransferButton.tsx
component file. Follow Privy’s docs on smart wallet usage for your own app.
In our example, we execute a user operation that sends 0.01 SBC to another address with the SBC paymaster covering the gas. By using the smartWalletClient
, we’re able to do just that.
Now let’s deploy the SBC Paymaster Demo to see a gasless transaction in action.
Step 4: Deploy the SBC Paymaster Demo
Refer to the readme in the GitHub repo.
First, clone and install the dependencies:
Next, configure the .env file:
The Privy Add ID is the same one used above.
Finally, run pnpm dev
and access the demo at http://localhost:3000.
To start using the demo, connect your wallet through Privy. This creates a smart wallet automatically which enables the gasless feature. Click "Send Gasless Transfer" to see a gasless transaction in action. Your wallet will need testnet SBC on Base Sepolia. Reach out on Telegram and we’ll send you some.