Signature-Based Minting
Signature-based minting, or "on-demand minting" allows you, (the admin wallet) to generate signatures that allow other users to mint tokens on your smart contract.
This allows you to check any on-chain or off-chain conditions before allowing a user to mint a token from/into your smart contract.
Read the full design document to explore how signature-based minting works at the smart contract level below.
Resources
How it works:
- Wallet A generates a signature for a token (specifying name, image, description, properties, and minter address).
- Wallet B can use the signature provided by Wallet A to mint the NFT.
You can grant signatures for specific wallets to mint tokens with properties you specify in your contract.
For example, you could grant a signature for a wallet to mint an NFT that contains their Discord profile picture, and only grant a signature if that person is a member of your Discord server, like we do in our on-demand minting example.
Prebuilt Contracts
Some prebuilt contracts have signature-based minting capabilities built in.
Signature Drop
The signature drop contract allows signature-based claiming.
This means they can claim
lazy-minted NFT(s) with the generated signature.
- React
- Javascript
- Python
- Go
- Unity
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature.generate(payload);
// now anyone can mint the NFT
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature.generate(payload);
// now anyone can mint the NFT
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
var meta = new NFTMetadata()
{
name = "Unity NFT",
description = "Minted From Unity (signature)",
image = "ipfs://QmbpciV7R5SSPb6aT9kEBAxoYoXBUsStJkMpxzymV4ZcVc"
};
string connectedAddress = await sdk.wallet.GetAddress();
var payload = new ERC721MintPayload(connectedAddress, meta);
var signature = await contract.ERC721.signature.Generate(payload); // typically generated on the backend
// Provide the signature you generated above to the Mint function:
var result = await contract.ERC721.signature.Mint(signature);
ERC721
Generate signatures for users to mint new NFTs in your collection
- React
- Javascript
- Python
- Go
- Unity
This feature is missing a code snippet or might not be supported yet.
Check the React SDK Reference for more information.
Reach out on Discord for further assistance!
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature().generate(payload);
// now anyone can mint the NFT
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Unity SDK Reference for more information.
Reach out on Discord for further assistance!
ERC1155
- React
- Javascript
- Python
- Go
- Unity
This feature is missing a code snippet or might not be supported yet.
Check the React SDK Reference for more information.
Reach out on Discord for further assistance!
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature().generate(payload);
// now anyone can mint the NFT
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Unity SDK Reference for more information.
Reach out on Discord for further assistance!
ERC20
- React
- Javascript
- Python
- Go
- Unity
This feature is missing a code snippet or might not be supported yet.
Check the React SDK Reference for more information.
Reach out on Discord for further assistance!
// see how to craft a payload to sign in the `contract.signature.generate()` documentation
const signedPayload = contract.signature().generate(payload);
// now anyone can mint the NFT
const tx = contract.erc20.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt
const mintedId = tx.id; // the id of the NFT minted
This feature is missing a code snippet or might not be supported yet.
Check the Python SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Go SDK Reference for more information.
Reach out on Discord for further assistance!
This feature is missing a code snippet or might not be supported yet.
Check the Unity SDK Reference for more information.
Reach out on Discord for further assistance!