Welcome! đź‘‹ In this guide, we will deep dive into minting NFTs on Base. By the end, you will be able to create an NFT collection, mint NFTs, and send NFTs to wallets, X accounts and email addresses using no-code tools and APIs. Additionally, we will show you how to sell NFTs and create a storefront/claims page for your users.
Whether you’re building the next big marketplace, launchpad, game or loyalty program on Base, you will need enterprise-grade tokenization, wallets, and payments that scale reliably. Crossmint has built the enterprise standard toolkit for web3 apps, trusted by thousands of developers, from web3 native companies like Phantom to enterprises like Mastercard and Redbull.
For any assistance, contact our sales team - they'll answer all of your questions about pricing, features, and implementation.
Choosing between Crossmint's Minting API vs minting in-house
Minting in-house may be the best solution if you are looking to create a few NFTs with basic functionality, limited volume, you have a wallet and can pay for gas fees with your own cryptocurrency, and are looking to mint in one single chain.
However, if you are looking for something more sophisticated, Crossmint can help you build enterprise-grade applications in minutes, scalable to millions of users. More concretely, the tokenization platform offers:
- APIs for the entire token lifecycle: minting, editing, burning, airdropping, setting up royalties, and more.
- Audited smart contracts to keep your assets and reputation safe.
- Same API surface for 40+ chains, including EVM but also Solana, Sui, Aptos, Cardano, and more
- Transaction handling to handle millions of NFTs and hour and activity spikes: batching and queuing of transactions,
- Gasless. For you and your users
- No-code dashboards to execute actions and track activity from a simple interface.
Prerequisites for Minting Base NFTs
Before you start, you will need to create a Crossmint Account so that you can access Crossmint's suite of onchain developer and no-code tools.
To create Base NFTs using our no-code tools, head on over to our no-code NFT minting guide for a step-by-step walkthrough.
We will now navigate to the "Developers" section and create a Server-side API Key with these 4 essential scopes: "nfts.create", "nfts.read", "collections.create" and "collections.read".
Creating an NFT Collection (Smart Contract) on Base
A collection or smart contract is a container of NFTs, used by applications like marketplaces and wallets to group NFTs together.
Crossmint allows you to create managed collections via API or directly from the console and has a library of pre-audited smart contracts which work for most major use cases. However, you can also bring your own contract if you already have one.
Crossmint supports non-fungible and semi-fungible tokens (editions), free and paid mints, and builds on open standards. On Base, ERC-721 and ERC-1155 contracts are supported.
The first time you mint an NFT on Base, Crossmint will assign it, and any subsequent mints, to a default collection for that chain. You can create additional collections from the console or in a single API call:
curl --request POST \
--url https://staging.crossmint.com/api/2022-06-09/collections/ \
--header 'content-type: application/json' \
--header 'x-api-key: <X_API_KEY>' \
--data '
{
"chain": "base",
"metadata": {
"name": "A new collection",
"imageUrl": "https://www.crossmint.com/assets/crossmint/logo.png",
"description": "A new collection with its own dedicated smart contract"
}
}
'
Mint a Base NFT
With our key created, we’re now going to write a small function that creates an NFT and delivers it to a user.
Create a file (e.g. mintNFT.js) and enter this code into it:
const apiKey = "YOUR_API_KEY";
const chain = "base";
const env = "staging";
const recipientEmail = "TEST_EMAIL_ADDRESS";
const recipientAddress = `email:${recipientEmail}:${chain}`;
const url = `https://${env}.crossmint.com/api/2022-06-09/collections/default/nfts`;
const options = {
method: "POST",
headers: {
accept: "application/json",
"content-type": "application/json",
"x-api-key": apiKey,
},
body: JSON.stringify({
recipient: recipientAddress,
metadata: {
name: "Crossmint Test NFT",
image: "https://picsum.photos/400",
description: "My first NFT using Crossmint",
},
}),
};
fetch(url, options)
.then((res) => res.json())
.then((json) => console.log(json))
.catch((err) => console.error("error:" + err));
This code creates an NFT, uploads it to the blockchain, and delivers it to a user wallet, attached to the email address provided. Before running it, be sure to fill in values for:
- YOUR_API_KEY with the key obtained in the prior step.
- TEST_EMAIL_ADDRESS with an email address you control, for testing.
Now, run the mintNFT.js script.
node mintNFT.js
After a few seconds, it should return a response indicating the mint has started processing. Check the full response and save its actionId property, as you’ll use it later.
Confirm Delivery of the NFT
The mint has started processing. However, blockchains can take a few seconds (or, at times of extreme network congestion, even minutes) to confirm the operation.
Before showing the user a success screen, the next step is checking the status of the mint.
To do this, grab the actionId received at the end of step 3 and use it alongside your API key in one of the snippets below.
# Replace "staging" with "www" for production, and fill in your api key and mint action id
ENV="staging"
API_KEY="<YOUR_API_KEY>"
MINT_ACTION_ID="<MINT_ACTION_ID>"
curl --header "x-api-key: $API_KEY" \
-X GET \
https://${ENV}.crossmint.com/api/2022-06-09/actions/${MINT_ACTION_ID}
Pay attention to the “status” field. Once it says “success”:
Congratulations! You have minted your first NFT 🥳
View your NFTs
- If the NFTs were delivered to an email address, the recipient can see them:
- From your website if you use embedded wallets. See the API for getting the NFTs in a wallet.
- By logging into their wallet from Crossmint’s website. For staging, they must use https://staging.crossmint.com.
- If the NFTs were delivered to a wallet address, the user will be able to see them there directly, connecting to testnet if needed, or on the testnet blockchain explorer.
Next Steps
Now that you’ve created an NFT collection on Base, you can learn how to:
- Launch your project in Production with 5 easy steps
- Learn how to create custodial & non-custodial Base wallets
- Edit and burn NFTs
- Sell NFTs using Crossmint’s NFT Checkout
- Set up a Claims Page for users to claim NFTs into their wallets
Need Support?
- Contact our Sales Team
- Join the Crossmint Discord Server
- Visit the Crossmint Help Page