Build a Gasless NFT Mint with Privy | Samuel Golland at ETHOnline 2026

ETHOnline 2026 · 10 Sept 2026 · 11:17

Samuel Golland builds Stamp, a Next.js demo app in which users log in with email, receive an embedded wallet and mint an NFT on the Base Sepolia testnet without paying gas, the fee normally charged for a transaction. He creates an app in the Privy dashboard, configures the Privy provider with login methods, supported chains and automatic wallet creation, and reads login state through a hook. In the final phase he sends the mint through Privy's send transaction hook with sponsorship turned on, after enabling gas sponsorship and client transactions in the dashboard, and he notes that gas sponsorship on mainnet requires a payment method.

Speakers

Topics

From ETHOnline 2026, hosted by ETHGlobal.

Transcript

[music] Hello everybody. Welcome to the Privy ETH Global Workshop. In this workshop, we'll be building a demo application called Stamp, which allows users to log in with email, create a wallet, and mint an NFT. So let me start by showing the final result and then we'll build it up using privy. So to start I click login with email. I enter my email address which happens to be at privy.

I copy the confirmation code in. And now you'll see I'm logged in with an embedded wallet. An embedded wallet is a wallet that lives inside of this application. and is associated with a privy app as opposed to a browser extension wallet or hardware wallet or mobile wallet. So now I'll click mint NFT and I'll see this screen. We'll see that um I'm submitting a transaction on base the test net for base and the fee is being covered as well. And so this is a privy feature to cover fees using gas sponsorship.

So I approved the transaction. It was complete and we'll see that the NFT was minted and we can see that on base scan as well. So this is the NFT page and we'll see the transaction just happened. Great. So let's build this up. The code for this project is uh uploaded on GitHub. It's a Nex.js application and I will attach this link to the workshop description so anyone can clone the repo and follow along. If you have

any questions as well, feel free to open up an issue or make a pull request. The workshop will proceed in three phases. Um, each phase has its own component in the workshop app file and you can proceed by commenting them back in. But let's see what the starter workshop looks like. This is the starter workshop. It's the same skeleton, but clicking login with email doesn't do anything. So, let's hook up Privy to this application so we can log in and create an embedded wallet.

The first thing we'll need to do is visit privy.io and log in. This will create an account for us if we're not already logged in. copy in my confirmation code and I log into the privy dashboard. Um, let's create our first application here. We can call it the ETH global demo and we'll set it up for web and we can extend this if we need to.

So, this creates an app ID and an app secret. For this demo, we won't be needing the app secret, but we will be needing the app ID. So, I'll make sure to copy that. This is the application homepage. There are a lot of controls here, but for the purposes of this demo, we'll be focused on wallets as well as fee sponsorship. Back in the code, we'll have to paste that app ID into our environment file. Create an env.local file if you don't already have one. and paste the privy app ID under this environment variable.

Now let's comment in authentication and see if we can log in. Great. So we're back in the application. When we now when we click the login with email button, it opens up the login modal here. So you'll notice a wallet was created for me and now I have a new embedded wallet here. If we copy this wallet address and look it up in basecan, we'll see that has a balance of zero ETH and it has no transaction history. So this

is a newly created wallet embedded inside of this stamp application. This button isn't hooked up yet, but let's explore what we did for enabling wallet creation. So, we overrode workshop.app with the authentication workshop. Let's see what this did. It created a provider and wrapped the authentication content in this privy provider and it exposed this workshop off hook. So let's first look in the provider.

We'll see that it reads our app ID from the environment and configures this privy provider with a few things. We can choose the appearance. We can set the default chain and supported chains of our application. In this case, it's base sapoleia which we're importing from beh. We set up our login methods which in this case is just email but you can extend this to social pass keys mobile etc. And we set up our configuration for embedded wallets. So here we're saying that we will create a new embedded wallet on uh for Ethereum for users when they log in and that's pretty much

enabling the entire offflow which we saw. There's also this hook and this is also imported from privy.ioact and it exposes some information about our logged in state which it reads from the provider. It allows us to log in and log out and tells us information about our connected wallet. The result of that hook is being passed down as props into the workshop view.

And that's how the app knows what wallet address to render, whether or not we're authenticated, and has hooks to log us in and log out. Back in the prevy dashboard, if we explore the wallets tab, we can also see that this wallet was created here and has an EVM chain type and a balance of zero. It was just created. And this is a view onto all the wallets which are created in this application. Now that we've finished configuring authentication, let's set up the last step, which is submitting a transaction on chain. So, let's comment this back in and try to submit a transaction.

So, here I'm logged in still and when I click the button, let's see what happens. We have set up a sponsored transaction and when we try to approve it, we get an error message saying guest sponsorship is not enabled for this application. So let's go back to the privy dashboard and enable guest sponsorship for this application. So in the fee sponsorship tab, I will enable guest sponsorship by checking this toggle and I'll look up base and enable it on chain.

You'll notice many of the uh chains are commented out or disabled when uh trying to select them and those are the mainet chains where gas sponsorship is not free but it will become enabled if you attach a payment method. So let's try again and it still fails. So let's go back and we see that we have to enable one more toggle to allow transactions from the client as well.

Great. So let's try one more time. And now it works. And we can view this NFT as we did last time. Great. So let's look in the code and see what we enabled. So the complete workshop has the same privy provider and the same workshop o hook and it has one more hook here called use mid NFTt. This hook is importing the usend transaction hook from reactto which is the primary feature here. It constructs a transaction to mint the NFT

and passes it into this use transaction hook. In addition, you'll notice that we're passing in the second argument which includes a reference to the wall address and the sponsor set to true. And this is what enables gas sponsorship on the client. We're then parsing the result according to the NFT ABI so that we can render the token ID and render the appropriate link. But that's pretty much it. So if you're familiar with sending transactions on VH, you will find this API also very familiar with just this custom argument to enable easy guest

sponsorship. So that concludes the workshop. Um to summarize what we did is we built a test application called stamp. We set up login with email through privy. We created a new wallet. We logged in and we minted an NFT which was also sponsored by Privy. This is a introduction into the features that Privy offers and I recommend reading the Privy docs for a overview of some of the other features that Privy offers as well. Thank you for your time and look forward to seeing your submissions.

[music]