DEV Community

BiasGoose for RippleX Developers

Posted on

NFT ID Generation on the XRP Ledger: fixNFTokenRemint Amendment

The ‘fixNFTokenRemint’ amendment is a protocol change designed to enhance the integrity of NFTs (Non-Fungible Tokens) on the XRP Ledger. While it may not appear to be a significant change, it addresses a critical issue—avoiding situations where the same NFT is minted multiple times with the same sequence number, which could lead to collision scenarios.

This amendment currently has support from a supermajority of validators and could become enabled as soon as 2023-11-27 (UTC).

For developers working with NFTs on the XRP Ledger, this proposed amendment is important. It’s all about changing how NFT IDs are calculated, and it’s worth delving deeper into what this means for your work.

Impact on NFT Sequence Numbers

The core of the fixNFTokenRemint amendment changes how NFT sequence numbers are constructed. If you currently generate NFT IDs manually during the minting process, instead of fetching them from the ledger, it’s time to make some code adjustments.

When the amendment becomes enabled, NFT IDs will be created using a new "FirstNFTSequence" field of accounts, based on the account's sequence number when it first mints an NFT, instead of NFT's sequence number always starting from 1. This prevents an NFT from having the same sequence number as a previously-minted NFT if the issuer's account were deleted and re-created.

So, what actions should you take as a developer to adapt to this amendment?

Updating Your Code

To get ready for the fixNFTokenRemind amendment, you need to get NFTokenID values in a way that uses the FirstNFTSequence field if it exists. However, not all XRPL NFT projects will be affected. You can rest easy if your project falls under any of these conditions:

You are already using the ‘getNFTokenID’ function of the xrpl.js library, or the equivalent function in the xrpl-py or xrpl4j libraries.
Your project reads the nftoken_id field from transaction metadata.
You calculate the NFTokenID by comparing the difference between the NFTokenPage object in the metadata.

If your project aligns with any of these categories, you won’t need to make any code changes.

Take Action Now

Being proactive is important. The ‘fixNFTokenRemint’ amendment is currently in the active voting phase, and could be enabled as early as November 27th (UTC). This could potentially impact your project and its users. To ensure a seamless transition, you should double-check your code and make any necessary adjustments before that time.

Top comments (0)