Skip to main content

On Demand Minting

On-demand minting (or "signature-based minting") allows you to specify which tokens can be minted into your smart contract.

How it works:

  1. Wallet A generates a signature for a token (specifying name, image, description, properties, and minter address).
  2. 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.

Smart Contract Design

Our Signature Minting Design Doc has a detailed explanation of how signature-based minting works and includes details of each parameter that can be configured.

On-demand minting is a way for a contract admin to authorize an external party's request to mint tokens on the admin's contract.

You can authorize some external party to mint tokens on your contract and specify what will be minted by that party.

Signature Drop

// 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

NFT Collection

// 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

Edition

// 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

Token

// 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 tokens
const tx = contract.signature.mint(signedPayload);
const receipt = tx.receipt; // the mint transaction receipt