Artifact
An Artifact
represents one or an amount of non-fungible token (NFT) on the universe chain and is associated with a predefined set of materials on the Previous chain. This allows NFTs to be programmable within both set contracts and kind contracts.
For an NFT to be used within the protocol, it must first be registered in the token registry. During registration, details such as the token standard, contract address, and associated material hashes must be provided.
Representation
The Artifact
structure is defined as follows:
#![allow(unused)] fn main() { pub struct Artifact { token_std: u8, token_index: u56, id: u64, amount: u128, } }
Field Descriptions
Size (bytes) | Field | Type | Description |
---|---|---|---|
1 | token_std | u8 | Specifies the token standard. |
7 | token_index | u56 | A unique index assigned at the token registry under the specified token standard. |
8 | id | u64 | The unique identifier of the NFT. |
16 | amount | u128 | The amount of the token held, applicable for tokens like ERC-1155, or 0 if not applicable. |
Token Standards
At genesis, the supported token standards for Artifact
elements are:
Standard | Value | Description |
---|---|---|
TOKEN_STD_721 | 3 | ERC-721-like tokens. |
TOKEN_STD_1155 | 4 | ERC-1155-like tokens. |
Additional token standards can be registered to support more types of tokens.
Limitations
The protocol encodes an Artifact
element using 256 bits, which imposes certain limitations:
-
ID: The
id
field is limited to 64 bits, which restricts the maximum ID value that can be assigned to a token. In the ERC-1155 and ERC-721 standards, the ID of a token is typically represented as auint256
. -
Amount: The
amount
field is limited to 128 bits, constraining the maximum amount of a token that can be represented. In the ERC-1155 and ERC-721 standards, the amount of a token is typically represented as auint256
.