NFT Collections
NFTs rarely exist in isolation, usually they are part of a bigger set, a collection. In smart contract based NFTs like ERC1155, a collection and the NFTs in it are all tracked in a single contract. In UTXO based systems like IOTA/Shimmer this is not possible, so a new way of linking NFTs together is needed.
The Stardust protocol allows linking NFTs together via the Issuer Feature. Since NFTs are first class citizens in the protocol, they can function as issuers themselves. This feature is exploited for L1 NFT collections.
Create of a Collection NFT
A Collection NFT is a just a normal NFT Output but with special purpose: it is used to mint all NFTs in the collection. The Collection NFT becomes the Issuer of the NFT Outputs representing NFTs within the collection.
It is possible to:
- Permanently lock the Collection NFT to prevent any future minting. No diluting is ever possible by issuers.
- Lock the Collection NFT for some time to prevent minting,
- Deposit the Collection NFT into a L2 chain where minting activity can be governed via smart contracts or DAOs.
Example Transaction
Transaction H mints a Collection NFT the same way as Transaction A mints a regular one. The metadata makes it clear that the intended use of this NFT is to serve as a Collection NFT.
- The name defines the name of the collection,
- The uri points to a website with more information about the project. Note, that type defines the resource type for uri.
Minting NFTs Within the Collection
NFTs within the collection must be minted in a way that their issuer is the Collection NFT. Therefore, we include NFT Output #10, the freshly minted Collection NFT from Transaction H in Transaction J, and define the Issuer Feature of all minted NFTs to hold the NFT Address of the Collection NFT.
We also place unique metadata in each NFT within the collection. The metadata is formatted according to IRC27 and contains information about:
- Where the asset represented by the NFT resides.
- The issuer or artist.
- The collection the NFT belongs to.
- Optional royalty addresses.
- Custom attributes.
Example Transaction
Transaction J mints a very limited collection, there are only 3 items NFT Output #12, #13 and #14. The issuer must also provide the storage deposit for the newly minted NFTs, therefore Basic Output #7 is consumed in the transaction.
Once the minting transaction confirms, it is possible to fetch all NFT outputs within the collection via the Indexer API TIP-26. The following query returns all NFT outputs (their Output IDs) that have been issued by the Collection NFT:
GET <indexer-base-url>/api/indexer/v1/outputs/nft?issuer=<collection-nft-address>
Lock the NFT Collection
The best way to ensure scarcity of collections is to prevent future minting activity. You can lock the NFT Collection in the ledger for some time via a Timelock Unlock Condition, or for eternity by sending it to the zero address.
The zero address is an Ed25519 address where the hash of the Ed255129 public key is all zeroes, therefore there is no private key that can successfully unlock it.
Example Transaction
ted Code Examples
- wallet.rs
- iota.js