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)FieldTypeDescription
1token_stdu8Specifies the token standard.
7token_indexu56A unique index assigned at the token registry under the specified token standard.
8idu64The unique identifier of the NFT.
16amountu128The 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:

StandardValueDescription
TOKEN_STD_7213ERC-721-like tokens.
TOKEN_STD_11554ERC-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 a uint256.

  • 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 a uint256.