Exploring NFTs on the Diamante Network

Calvin
2 min readAug 8, 2024

--

NFTs can have a single supply or multiple supply, and the metadata about the asset is stored on-chain using IPFS.

How is it done on the Diamante Network? In the Diamante Network, transactions contain operations that specify the logic to be performed. A transaction should contain a minimum of one operation and up to 1000 operations.

The operations used for creating assets include payment operations. The account that wants to create an asset creates an asset object, which is a combination of the asset code and the issuing public key. After issuance, anyone can search the network for your unique asset.

First, you must generate a unique keypair. The public key will act as your issuing identity on the network, while you use the secret key to sign transactions.

The unique keypair should hold twice the base reserve for the network, and additionally, one more base reserve has to be added because this issuing account will store the metadata in its data field (data fields are key-value pairs that an account can store), making the subentry count increase by one, thus requiring the account to hold the minimum DIAMs.

Now we have the issuing account ready.

User accounts must establish a trustline with the issuing account to hold that issuer’s asset. This is true for all assets except for the network’s native token.

Once the user account has performed the transaction involving the change trust operation for the asset, the issuing account can mint the assets to the user account.

The payment operation is used to actually issue (or mint) your asset. A payment creates the amount of an asset specified, up to the maximum 64-bit integer.

So, the issuing account will create a transaction that includes the following operations:

  • A payment operation to mint the assets to the user account and supply mentioned.
  • A manage data operation to store key-value data, where the key would be the asset code and the value would be the metadata of the asset.
  • A set options operation, updating the issuance signing key itself to zero.

Now, after this transaction by the issuing account, assets are minted with the mentioned supply to the user’s wallet, metadata is stored, and its own signing weight is set to zero, so the metadata associated with the issuing account can never be updated or modified.

After this step, the asset can be transferred between accounts through a payment operation.

Note:

  • IPFS CID can be used to hold asset metadata.
  • For NFTs/RWAs with single supply, the supply can be 0.0000001 so that the supply cannot be broken further, making it a fixed single supply.

Demo code : https://github.com/calvinjoshua/diamante-asset-issuance

--

--

Calvin

I am a passionate blockchain enthusiast with a deep interest in building decentralized applications on both public and private blockchains.