Mint NFTs (CIP-25)
Overview for minting CIP-25 compliant NFTs/Native Assets on Cardano using the Anvil API's `transactions/build` endpoint. This document specifies the required JSON format for both new and existing poli
Introduction
CIP-25 Mint with New Policy
Prerequisites
Request Structure
{
// Specifies which address should receive any leftover ADA (change)
// after the transaction is completed and fees are paid
"changeAddress": "addr_test1qqwadht4defe...",
// An array of UTXO strings from the wallet paying for the transaction.
"utxos": ["8282...", "8282..."],
// An array of assets to be minted.
"mint": [
{
"version": "cip25",
// UTF-8 or hex format - Must be unique within the collection.
"assetName": { "name": "anvilapicip25", "format": "utf8" },
// Custom Metadata for your NFT. Replace with your own CIP-25 standard values.
// Use https://metadraft.io to generate accurate metadata easily.
"metadata": {
"name": "YOUR_NFT_NAME_HERE",
"image": [
"https://your-storage-provider.com/", // URL to your image
"image-file.png" // File name of your image
],
"mediaType": "image/png", // Media type of your image
"description": "Anvil API CIP-25 Mint Example" // Description of your NFT
},
// The policy ID of the collection.
"policyId": "4d5bd6249f0d9e4b2762ce334e2973dc7fd414ec1e08b4b0c2159bfb",
"quantity": 1 // Accepts integers > 0. Negative numbers will burn assets.
}
],
// An array of native scripts that represent the policy that needs to be pre-loaded for validation.
// This is required for the initial mint. once the policy is registered this is optional.
// Including it saves resources and reduces latency by avoiding blockchain fetches.
"preloadedScripts": [
{
"type": "simple",
// The native script details.
"script": {
"type": "all",
"scripts": [
{
"type": "sig",
"keyHash": "fdf151b600df2492005221876c7d7e33056496572c7363c33a1e3609"
},
{
"type": "before",
"slot": 100000000
}
]
},
// The hash of the native script, which is the Policy ID.
"hash": "4d5bd6249f0d9e4b2762ce334e2973dc7fd414ec1e08b4b0c2159bfb"
}
]
}Examples
Troubleshooting
Fixes and Best Practices
Specifications
Last updated
Was this helpful?

