Examples Showing How To Create Digital Assets (NFTs) On Blockchain
STEP 1. Register A New Digital Asset Collection
NFTRegisterCollection transaction enables us to register a new type of digital asset by defining its structure. The structure is defined in the form of a standard JSONSchema (see example below). After the digital asset collection is registered we can create (mine) tokens with the help of NFTCreate transaction type. We need to define:
maximum supply (optional)
jsonSchema - structure of the digital asset
allowedIssuers - if empty anyone can create/mine a new asset
How To Use NFTRegisterCollection Transaction
examples/nft-register-collection.ts at develop · protokol/examples
We can create (mine) new digital assets from the genesis wallet (the wallet that registered the new collection in STEP 1). To create a digital asset we need to comply with the asset type - that is the collection we registered with NFTRegisterCollection transaction. We need to specify:
token attributes - need to comply with the registered JSONSchema
After token is created it lives inside the genesis wallet, until it is transferred to a trading address, or to a new owner with the NFTTransfer Transaction.
How To Use NFTCreate Transaction
examples/nft-create.ts at develop · protokol/examples
Our NFT plugin set also enables burning capability for digital assets. This is useful with loyalty programs and expiring trading cards or gaming card functionality - where the asset is destroyed when used. Only token owners can burn/destroy a digital asset. Digital asset or usage history is still visible on the blockchain.
How To Use NFTBurn Transaction
examples/nft-burn.ts at develop · protokol/examples