Hedera Namespace - Assets

Author Danno Ferrin, Juan Caballero
Discussions-To https://github.com/hashgraph/hedera-improvement-proposal/discussions/169
Status Draft
Type Standard
Created 2021-11-01
Updated 2022-03-27
Requires CAIP-2, CAIP-19
Withdrawal reason CAIP-75

CAIP-19

For context, see the CAIP-19 specification.

This specification defines a CAIP-19 scheme for both fungible and non-fungible tokenized assets in the Hedera ecosystem. The [Hedera Token Service][] is used in slightly different ways for both. When interacting with these two types of Hedera token, Solidity contracts can interact with most (but not all!) functions defined by the ERC20 and ERC721; for a list, see the current ERC20 & ERC721 Compatibility page in the developer documentation.

Standard NFT Fees, Metadata and other uses of the “memo” field in HTS tokens, and custom fees are all out of scope and are not encoded in a CAIP-conformant address; see HIP-17, HIP-10, and HIP-18 respectively.

Fungible Tokens

In CAIP-19 a general asset identification scheme is defined. This is the implementation of CAIP-19 for token in representing fungible tokens, which are addressed in the same way as accounts are addressed in the Hedera CAIP-10 specification, i.e., {shard}.{realm}.{address}.

Semantics

Token Asset Namespace

The asset namespace for fungible tokens in the Hedera Token Service (HTS) is token (case-sensitive).

Asset Reference Definition

The Asset Reference format is the tokenID in the specific hashgraph (see the Hedera CAIP-10 specification for semantics).

Syntax

The following regular expression can be used to validate fungible tokens:

hedera:[-a-zA-Z0-9]{5,32}\/token:[0-9]{1,19}\.[0-9]{1,19}\.[0-9]{1,19}(\-[a-z]{5}){0,1}

Backwards Compatibility

Not applicable

Test Cases

This is a list of manually composed examples

# Dried Nutm (Dri)
hedera:mainnet/token:0.0.278981

Non-Fungible Tokens

In CAIP-19 a general asset identification scheme is defined. CAIP-153 extended this sane scheme to include a broader characterset, enabling the .-concatenated shard/realm prefixes before addresses which are standard in Hedera. This describes the implementation of CAIP-19 for token in representing non-fungible tokens, which are addressed in the same way as accounts are addressed in the Hedera CAIP-10 specification, i.e., {shard}.{realm}.{address}.

Semantics

Token Asset Namespace

The asset namespace is called nft hosted in the Hedera Token Service (HTS). It references HTS non-fungible tokens in the hedera namespace (see CAIP-75).

Asset Reference Definition

The Asset reference format is the tokenID in the specific hashgraph (see the Hedera CAIP-10 specification for semantics).

Token ID Definition

The Token ID reference format is the serial number of the specific token.

Syntax

The following regular expression can be used to validate fungible tokens:

hedera:[-a-zA-Z0-9]{5,32}\/nft:[0-9]{1,19}\.[0-9]{1,19}\.[0-9]{1,19}(\-[a-z]{5}){0,1}\/[0-9]{1,19}

Backwards Compatibility

Not applicable

Test Cases

This is a list of manually composed examples

# Edition 12 of 50: First-Generation Hedera Robot VENOM EDITION
hedera:mainnet/nft:0.0.55492/12

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

Danno Ferrin, Juan Caballero, "namespaces/hedera-caip19: Hedera Namespace - Assets [DRAFT]," Chain Agnostic Namespaces, hedera-caip19, November 2021 / March 2022. [Online serial]. Available: https://github.com/ChainAgnostic/namespaces/hedera-caip19.md