Create NFTs on CARDANO #CNFT

Twitter @NftPigeons

Join our discord server :
https://t.co/RVc8ZlUcOf?amp=1

Stake your ADA with NOOPS

1 Create a NFT payment addr (air-gapped offline machine)

cardano-cli address key-gen \
--verification-key-file nft-payment.vkey \
--signing-key-file nft-payment.skey
  • Build a payment address for the payment key
cardano-cli address build \
--payment-verification-key-file nft-payment.vkey \
--out-file nft-payment.addr \
--mainnet

2 Fund your NFT payment addr

3 Create policy

cardano-cli address key-gen \
--verification-key-file nft-policy.vkey \
--signing-key-file nft-policy.skey
  • Hash your policy.vkey
cardano-cli address key-hash --payment-verification-key-file nft-policy.vkey
  • Add the policy.vkey hash to the policy.script
{
“type” : “all”,
“scripts” : [
{
“keyHash”: “
<policy.vkey-hash>”,
“type”: “sig”
},
{
“type” : “before”,
“slot” :
<slotplus1h>
}
]
}
  • Retrieve the policyid
cardano-cli transaction policyid --script-file policy.script

4 Add your NFT to IPFS

  • Add your nft
curl "https://ipfs.blockfrost.io/api/v0/ipfs/add" \
-X POST \
-H "project_id: <PROJECT_ID>" \
-F "file=@<NFTFILE>"
  • Store the ipfs_hash

5 Create Metadata

{
"721": {
"<policy-id>": {
"Noops1": {
"id": 0,
"name": "<NFT_NAME> 0",
"image": "ipfs://ipfs/<IPFS_HASH>",
"tags": [
"<TAG1>"
]
},
"Noops2": {
"id": 1,
"name": "<NFT_NAME> 1",
"image": "ipfs://ipfs/<IPFS_HASH>",
"tags": [
"<TAG1>"
]
}
},
"description": "<DESCRIPTION>",
"creator": "<CREATOR>",
"publisher": [
"<PUBLISHER>"
],
"version": 1
}
}

4 Create the transaction

cardano-cli query utxo --address $(cat nft-payment.addr) \
--mainnet
  • Build the transaction
tx_in="${tx_in} --tx-in ${in_addr}#${idx}"cardano-cli transaction build-raw \
$tx_in \
--tx-out $ADDR+0+"1 $POLICYID.Noops1 + 1 $POLICYID.Noops2" \
--mint="1 $POLICYID.Noops1 + 1 $POLICYID.Noops2" \
--metadata-json-file metadata.json \
--fee 0 \
--invalid-hereafter $slot1000 \
--out-file tx.raw
fee=$(cardano-cli transaction calculate-min-fee \
--tx-body-file tx.raw \
--tx-in-count 1 \
--tx-out-count 1 \
--witness-count 2 \
--mainnet \
--protocol-params-file protocol.json | awk '{ print $1 }')

afterfee=$(($total_balance-$fee))
cardano-cli transaction build-raw \
--fee $fee \
$tx_in \
--tx-out $ADDR+$afterfee+"1 $POLICYID.Noops1 + 1 $POLICYID.Noops2" \
--mint="1 $POLICYID.Noops1 + 1 $POLICYID.Noops2" \
--invalid-hereafter $slot1000 \
--metadata-json-file metadata.json \
--out-file tx.raw

5 Sign the transaction (air-gapped offline machine)

cardano-cli transaction sign \
--signing-key-file nft-payment.skey \
--signing-key-file nft-policy.skey \
--script-file policy.script \
--mainnet \
--tx-body-file tx.raw \
--out-file tx.signed

6 Submit the transaction

cardano-cli transaction submit --tx-file tx.signed --mainnet

Let me introduce our ADA pool NOOPS. We are here to support the Cardano network’s decentralization.