Motivation
We’re considering the ways to implement Non-Fungible Tokens (NFTs) which we believe would be quite useful. NFTs’ distinguishing feature is that they’re not interchangeable since each NFT describes a unique object and has characteristics that recognize it from all other tokens. NFTs can be used in many ways, for example in gaming, ticketing and as proof of ownership.
Currently, we able to issue an asset for each NF-token, but the problem here is that assets issuance is expensive. We propose to issue them simultaneously, and they will share a common script as well.
The proposed feature would give the ability to create NFTs and manage common assets scripts’ more conveniently.
What do you think about this feature?
The Basic Explanation
An AssetClass is a way to generalize an Asset. Essentially, an AssetClass is a category that contains assets. An asset may either belong to only one AssetClass or not belong to any.
AssetClassTransaction
We propose to add a new transaction type that is used for the creation of an AssetClass and issuing assets in it.
AssetClassTransaction Example:
{
"sender" : "3PBSduYkK7GQxVFWkKWMq8GQkVdAGX71hTx",
"senderPublicKey" : "3LZmDK7vuSBsDmFLxJ4qihZynUz8JF9e88dNu5fsus5p",
"version" : 1,
"id" : "GnupVrhwszpPSAsKAQT741sLptYPAviGs9iXXGj7NhtE",
"script" : "base64:AQQAAAAEaW5hbAIAAAAESW5hbAQAAAAFZWxlbmECAAAABAAAEaW5hbAUAAAAFZWxlbmEFAAAABGxvdmV4ZFt5",
"description" : "My Game Characters",
"assets" : [ {
"id" : 1,
"name" : "Zombie",
"quantity" : 1000,
"reissuable" : true,
"decimals" : 0
}, {
"id" : 2,
"name" : "Dragon",
"quantity" : 1,
"reissuable" : false,
"decimals" : 0
} ],
"fee" : 100000000,
"timestamp" : 1519271860,
"proofs" : [ "jh24r6c4K427G245Y8725L8g68tcrEJ52HG8FK8528g25G8HFfJGHdCfghdefgJEf" ]
}
The issued assets cannot have scripts, but they share an AssetClass’ script.
The issued assets can be treated like any other assets. Their AssetIds are calculated by replacing the last 4 bytes of AssetClassId with Id bytes (see the example for details).
This method of an AssetId calculation allows for the following possibilities:
- Uniform AssetId generation from the AssetClassId.
- Ability to store some object’s characteristics in its Id as a binary mask.
Applications
Fungible Tokens with a Common Script
We can issue fungible assets in an AssetClass and regulate them with a common script. The script is specified in the AssetClass but validates all transactions with every asset in the class.
Semi-Fungible Tokens
Semi-fungible tokens enable interchangeability of some assets of a certain type but types still are not interchangeable with each other:
Non-Fungible Tokens
Using AssetClasses we’re able to create non-fungible tokens (NFTs).
We have to create AssetClass that contains assets, each has decimals=0, totalAmount=1. We also might want to create an account with state containing assets’ descriptions.
AssetClass would solve the following problems relating to NFTs:
- fixed issue price;
- ease of use;
- common assets’ script.
This approach also allows for the following features:
- NFTs are interchangeable with fungible tokens and users are able to resell NFTs.
- NFTs’ metadata can be stored off-chain. The smart account’s state contains a reference to metadata and its hash, so it would be easy to ensure that the metadata wasn’t changed.
- Users are able to track an asset’s history to check its provenance.
- The issuer can have a share from each users’ NFT resell.
- The issuer can set restrictions for resale (deny increasing the price; set a minimum and maximum price caps).
- The issuer can control reissuability of each asset.