Create Cardano NFTs. Non-fungible tokens (NFTs), ERC-721 tokens, can be used on the Cardano blockchain, just like they can be used on most other blockchains. Since 2014, NFTs have been around and are becoming more popular in digital trading art. By September 2021, the number of NFTs will have grown by a staggering 740% since November 2017. This article tells you how to make a non-fungible token (NFT) on the Cardano blockchain.
NFTs are a new type of blockchain-based asset that makes it possible to create, distribute, and trade unique digital assets. Crypto Kitties was the first NFT, and in 2017, it became a huge hit. Cardano is the first platform to use proof-of-stake (PoS) consensus to run smart contracts. The Cardano blockchain is based on the latest research in programming language design and scientific ideas
Step 1
To begin, it is necessary to create a new payment address, which requires two keys. The following is an example code for generating keys:
1. "cardano-cli address key-gen \
2. --verification-key-file payment.vkey \
3. --signing-key-file payment.skey"
Step 2
In order to generate a payment address, a verification and signing key must be generated.
1. "cardano-cli address build \
2. --payment-verification-key-file payment.vkey \
3. --out-file payment. addr \
4. --mainnet"
Step 3
Start processing the display once the payment address has been generated
In the content file,
1. "cat payment.addr
2. addr1v9hhyvjycngmhrng2xcqa58y9j759we4xxhhqhpx26lgpzqyvflfk"
Step 4
After processing the display of the content file, verify your address's current UTXO.
1. "cardano-cli query utxo --address $(cat payment.addr) \
2. --mainnet --mary-era"
As a result of the above step, the following output should be obtained:
"TxHash TxIx Amount
Step 5
According to the example, there were no transactions associated with your address. The next step is to fund your address. The following example code should be used to duplicate your address:
1. "addr1v9hhyvjycngmhrng2xcqa58y9j759we4xxhhqhpx26lzqyvflfk"
To generate your NFT, you will need to have at least 1 Ada in your wallet. According to the amount of ada you wish to create, you may wish to transfer additional ada. In order to send your NFTs to your acquaintances, you will need at least 1.7 ada per transaction. It is currently not possible to send only custom tokens; each transaction must include at least one Ada.
Step 6
Check the UTXO again after funding and duplicating the address,
1. "cardano-cli query utxo --address $(cat payment.addr) \
2. --mainnet --mary-era"
Now the result should appear as given below:
1. "TxHash TxIx Amount
2. 7211b05ef3cb067b36469af2a81a63de5612b6a449cf8db47504cc82726015 0 5000000 lovelace"
Step 7
After checking the UTXO again, export the current network parameters to a file.
1. "cardano-cli query protocol-parameters \
2. --mainnet \
3. --out-file protocol.json"
Step 8
Following the export of the current network parameters, begin the creation of the policy. Create a policy that suits your needs. Tokens can be generated and burned by a policy. To identify a token, the policy id and the token name are always used. The token title is distinct from the policy id, but may also be used with another policy id,
In order to create a policy, one needs two keys:
1. "cardano-cli address key-gen \
2. --verification-key-file policy.vkey \
3. --signing-key-file policy.skey"
It is now possible to generate the policy script in the following way:
1. "touch policy.script && echo "" > policy.script
2. echo "{" >> policy.script
3. echo " \"keyHash\": \"$(cardano-cli address key-hash --payment-verification-key-file policy.vkey)\"," >> policy.script
4. echo " \"type\": \"sig\"" >> policy.script
5. echo "}" >> policy.script
6. cat policy.script
7. { "keyHash": "5805823e303fb28231a736a3eb4420261bb42019dc3605dd83cccd04",
8. "type": "sig"}"
Step 9
The transaction fees will be calculated after the policy has been generated,
1. "cardano-cli transaction calculate-min-fee \
2. --tx-body-file matx.raw \
3. --tx-in-count 1 \
4. --tx-out-count 1 \
5. --witness-count 2 \
6. --mainnet \
7. --protocol-params-file protocol.json195509 Lovelace"
Step 10
Having calculated the transaction fee, what follows is the step of constructing a transaction with fee as part of the process,
1. "cardano-cli transaction build-raw \
2. --mary-era \
3. --fee 195509 \
4. --tx-in b1ddb0347fed2aecc7f00caabaaf2634f8e2d17541f6237bbed78e2092e1c414#0 \
5. --tx-out $(cat payment.addr)+4804491+"1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.MountainGorilla + 1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.BrownBear"\
6. --mint="1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.MountainGorilla + 1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.BrownBear"\
7. --out-file matx.raw"
Step 11
After you have created a transaction with a fee, you will need to proceed to the signing of the transaction,
1. " cardano-cli transaction sign \
2. --signing-key-file payment.skey \
3. --signing-key-file policy.skey \
4. --script-file policy.script \
5. --mainnet \
6. --tx-body-file matx.raw \
7. --out-file matx.signed"
Step 12
It is now time to submit the transaction for approval,
1. "cardano-cli transaction submit --tx-file matx.signed --mainnet"
Step 13
If you have submitted a transaction, you should inquire about your UTXO after you have submitted it. As a result, these tokens will now reflect the newly minted ones;
1. "cardano-cli query utxo --address $(cat payment.addr) \
2. --mainnet --mary-eraTxHash TxIx Amount
3. fd0790f3984348f65ee22f35480b873b4eb9862065514f3e3a9c0f04d0a6ad63 0 4804491 lovelace + 1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.MountainGorilla + 1 677d3bbe3e01eeab498cd8786f7d261d92bd6ecea12109a332e86374.BrownBear"
Conclusion
There are many ways in which NFTs can be used. With the rise of NFTs, several well-designed platforms, such as Ethereum, Polygon (Matic), Wax blockchain, and Cardano blockchain, are gaining popularity. The Cardano blockchain platform is a next-generation distributed ledger that combines the scalability and security of proof-of-stake consensus with the versatility and flexibility of smart contract technology. It is built on decades of research and scientific philosophy.