arrow-left Course Hub
Lesson 4: Mint and burn NFTs with React.js
Estimated reading time:

25 minutes

Difficulty:

Intermediate

Key takeaway:

The XRPL has built-in tools to create, destroy, and manage unique assets by using NFTs.

Lesson 4

Mint and burn NFTs with React.js

Use React.js to mint and burn NFTs on the XRP Ledger.

Representing unique assets on ledger

Normal tokens are great for representing fungible and interchangeable assets like fiat currencies. Still, sometimes you want to represent ownership or proof of authenticity of a non-fungible asset—for example, a car deed, a specific piece of art, or a credential. Non-fungible tokens (NFTs) allow you to tokenize those unique assets and use the XRPL to securely buy and sell them.

NFTs on the XRPL

The NFToken object represents a single non-fungible token (NFT) on the XRP Ledger and has a couple of necessary fields to note:

NFTokenTaxon

An arbitrary id used to group NFTs issued by the same account. If you’re creating a collection of similar assets, you can show them the same NFTokenTaxon.

URI

This optional field lets you link to more information related to your NFT. Some people use this to link to the asset the NFT is representing, and others use this to link to additional metadata to help parse the NFT in marketplaces or other applications.

The rest of this lesson will show you how to create (“mint”) an NFT, see which NFTs an account currently owns, and how to delete (“burn”) an NFT.

Seeing this in action

  1. Open the sandbox below.
  2. Wait for the wallets to be funded.
  3. Customize your NFT by adding a link, or small amount of text to the URI field.
    This field accepts a maximum of 256 bytes to keep the data stored on the ledger to a reasonable size.
    This typically is where links to digital content or metadata would be stored.
  4. Click the Send button to mint your NFT, and wait for your NFTokenMint transaction to be validated by the XRPL.
  5. If it succeeds, you should see a token ID in your account, along with the URI you included.
    – You can repeat this using different URIs to see more NFTs get added to your account.
  6. Copy and paste one NFTokenID and paste it into the “burn” field.
  7. Click the Send button to delete that NFToken permanently.
    – Behind the scenes, this sends an NFTokenBurn transaction.
END OF LESSON

Now that you've learned a bit about minting and burning NFTs with React on the XRP Ledger, test your knowledge with a quiz.