Build a Gasless NFT Mint with Privy | Samuel Golland at ETHOnline 2026
ETHGlobal·Fri, Sep 11, 2026, 12:00 AM
Transcript
Hello everyone. Welcome to the Privy ETH Global Workshop. In this workshop, we will create a demo app called Stamp that allows users to log in with email, create a wallet, and generate NFTs. So and generate NFTs. So , let me start by showing the end result end result , and then we'll create it using Privy.
So, to get started, I click "Sign in with email." I enter my email address, which turns out to be in Privy. I'm copying the verification code and now you'll see that I'm logged in using the built-in wallet. A built-in wallet built-in wallet is a wallet that resides within this app and is associated with the Privy app, as opposed to a browser extension wallet, hardware wallet, or mobile wallet. So now I click "Create NFT" and I see this screen.
We will see that I am sending a transaction to Base Sepolia, the testnet for Base. And the commission is also covered. So, this is a Privy feature to cover commissions through gas sponsorship. So, I approve the transaction. It was completed and we will see that the NFT has been created and we can also see it on Base Scan.
So this is the NFT page, and we'll see that a transaction just took place. Perfectly. So let's work this out. The code for this project has been uploaded to GitHub. This is a Next.
js application. And I will add this link to the masterclass description to the masterclass description so that everyone can clone the repository and follow it. If you have any questions, feel free to open an issue or make a pull an issue or make a pull request. The master request. The master class will take place in three phases.
Um, each phase has its own component in the masterclass application file masterclass application file . And you can continue by commenting them back. But let's see what a starter workshop looks like. This is a starter master starter master class. It's the same skeleton, but clicking the " clicking the " Sign in with email" button does nothing.
So, let's connect Privy to this app so we can log in and create an embedded wallet. The first thing we need to do is visit privy.io and log in. This will create an account for us if we are not already logged in. After copying my verification code, I will log in to the Privy control panel.
Let's create our first application here. We can call it the ETH Global demo. And we'll set it up for the web version and be able to extend that if needed. So, this creates an application ID and an application secret. For this demonstration, we won't need the application secret, but we will need the application ID, so I'll make sure to copy that .
This is the main page of the application. There are many controls here, but for the purposes of this demonstration, we will focus on wallets as well as commission sponsorship. Back to the code, we will need to insert this application ID into our environment file. Create a .env.
local file if you don't already have one and paste the Privy application ID under this environment variable. Now let's comment out the authentication and see if we can log in. Perfectly. So, we're back to the program. When we click on the login button using email, it opens the login model here.
So, you'll notice that a wallet was created for me, and now I have a new built-in wallet here. If we copy the address of this wallet and view it in Base Scan, we will see that it has zero ETH balance and no transaction history. So, this is a newly created wallet built inside the Stamp app. This button is not yet connected. But let's look at what we did to create the wallet.
So, we redefined workshop.app to workshop authentication. Let's see what it did. This created a provider and wrapped the authentication content in this Privy provider. And that provided access to this workshop.
So, let's look at the provider first. We'll see that it reads our application ID from the environment and configures this Privy provider with a few things. We can choose our appearance. We can set the default chain and supported chains of our application. In this case, it's Base Sepolia, which we import from Beam.
We have set up login methods, which in this case are just email, but you can expand them to social authentication, passwords, mobile phone, etc. And we have configured the configuration for the built-in wallets. So here we are saying that we will create a new built-in wallet for Ethereum for users when they log in . And that actually triggers the whole exit process that we've seen. There is also this hook, which is also imported from privy.
io/react-auth, and it provides some information about our login state, which it reads from the provider. It allows us to log in and out of the system and out of the system , and also tells us information about our connected wallet. The result of this hook is passed as props to the workshop window, and this is how the application knows the application knows which wallet address to display, whether we are authenticated, and has hooks for logging in and out. Back in the Privy dashboard, if we look at the wallets tab, we can also see that this wallet was created here, has an EVM chain type, and a zero balance. It has just been created.
And this is an overview of all the wallets created in this program. Now that we have completed the authentication setup, let's configure the final step, which is sending the transaction to the blockchain. So, let's comment this out again and try sending the transaction. So, I'm still logged in , 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 that gas sponsorship is not enabled for this program.
So, let's go back to the Privy dashboard and enable gas sponsorship for this app. So, on the commission sponsorship tab, I'll turn on gas sponsorship by setting this switch. And I found the Sepolia database and included it in the blockchain. You will notice that many blockchains are commented out or disabled when you try to select them, and these are mainnet blockchains where gas sponsorship is not free, but it will become enabled if you add a payment method. So, let's try again.
And it still doesn't work. So, let's go back and see that we need to turn on another switch to allow transactions from the client as well. Perfectly. So let's try again. And now it works.
And we can review this NFT like last time. Perfectly. So let's take a look at the code and see what we've enabled. So, the full workshop has the same privy provider and the same workshop off hook, and there 's another hook called use mint NFT. This hook imports the use send transaction hook from react off, which is the main function here.
It creates a transaction for mint NFT and passes it to this use send transaction hook. Additionally, you will notice that we pass a second argument which contains a reference to the wallet address and the sponsor set to true. And this is what turns on gas sponsorship on the client. We then parse the result according to the NFT API so that we can display the token ID and display the corresponding link corresponding link . But that's actually all.
So, if you are familiar with sending transactions on Beam, you will see that this API is also very familiar with this custom argument to provide easy gas sponsorship. So, this concludes the seminar. To summarize what we did, we created a test application called Stamp. We set up email login through Privy. We created a new wallet.
We are logged in. And we created an NFT that was also sponsored by Privy. This is an introduction to the features that Privy offers. And I recommend reading the Privy documentation for an overview of some of the other features that Privy also offers. Thank you for your time and we look forward to seeing your work.
Automatic transcript — names and jargon may be misspelled.