Module
NFT
An overlay on the stock cosmossdk.io/x/nft keeper that adds the rules a real world asset needs: an issuer-scoped class id, a technical issuer, sequential token ids, immutable metadata and a lock other modules can escrow with.
On-chain name: nftrwa · Consensus version 1
What the module owns
- A class id is
{issuer}/{product_ref}. The first segment must be the signer's own bech32 address, both segments are printable ASCII, the separator appears exactly once and neither side may contain a slash. - A token id is
{class_id}/{sequence}. The sequence is a per-class counter that starts at 1 and only ever increases, and the module assigns it rather than the sender choosing it. token_metadata_immutableis fixed when the class is created. When it is set,MsgSetNFTMetadatafails withErrImmutableTokenMetadata, but only after the sender is confirmed as the class issuer.- The lock is the escrow other modules use: the holder keeps ownership and nobody else can move or burn the token until it is released.
Key features
Issuer-scoped classes
Class id format {issuer}/{product_ref} prevents name squatting and ensures clear ownership.
Sequential token IDs
Module assigns sequential IDs per class. No ID collision, no manual assignment.
Immutable metadata
Per-class flag token_metadata_immutable. When true, metadata cannot be changed after creation.
Cross-module escrow (lock)
The lock mechanism lets other modules (NFT market, Income) escrow tokens without taking ownership.
Messages
- MsgCreateClass -- Create a new NFT class with issuer, product reference, and metadata immutability flag.
- MsgMintNFT -- Mint a new token in a class (issuer only). Module assigns sequential ID.
- MsgBurnNFT -- Burn a token (holder or issuer).
- MsgSetNFTMetadata -- Update token metadata (only if class is not immutable, and only by issuer).
- MsgTransferNFT -- Transfer ownership to another account.
- MsgLockNFT / MsgUnlockNFT -- Escrow/release a token for other modules (NFT market, Income).
- MsgUpdateClassIssuer -- Transfer class issuance authority (gov only).
Queries
- Class / Classes -- Fetch a single class or paginated list of classes.
- NFT / NFTs -- Fetch a single token or paginated list of tokens in a class.
- ClassOwner / NFTsByOwner -- Owner queries by address.
- Params -- Module parameters (caps, etc.).
Caps and limits
- Class ID segments: printable ASCII, no slashes in segments
- Max class metadata size: per module config
- Token metadata: per module config
- Sequential IDs: start at 1, monotonic increase
Integration guide
Represent a position as a unique token
Sell an NFT on chain
Where the rules live
The NFT module provides the asset layer. NFT market adds secondary trading; Income adds yield distribution. Both hook NFT burns: market refunds the seller deposit, Income releases the token's earmark.