Solana Namespace - Asset

Author Qiao Liang
Status Draft
Type Standard
Created 2022-06-01
Updated 2022-06-01
Requires CAIP-2, CAIP-10, CAIP-19, CAIP-30

CAIP-19

For context, see the CAIP-19 specification.

Rationale

On Solana, all contracts are stateless and state is instead represented using “accounts”. More specifically, all fungible and non-fungible tokens use the same instance of token contracts and for each token:

  • 1 single global “mint” account instance is used for the global data like “total supply”.
  • each token account represents an account balance belonging to a given address.

The only difference between fungible tokens and non-fungible tokens is that non-fungible token mints have a total supply of 1 and zero decimal place. Both asset type can be identified by their “mint” account.

Syntax

After the CAIP-2 (namespace+chainID), a slash defines an asset_namespace and an asset_reference. Since both fungible and non-fungible tokens can be identified using the mint account, we use token (fungible) and nft (non-fungible) as the asset namespaces and the address of the mint account as the reference in both.

Reference Equivalent to See also
token ERC20 Token Metaplex Fungible
nft ERC721 Metaplex NonFungible

Examples

# One Solana Mainnet NFT:Pesky Penguins #398
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644XiTqU5W3w9w

# Solana Mainnet USDC
solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

Copyright and related rights waived via CC0.

Citation

Please cite this document as:

Qiao Liang, "namespaces/solana-caip19: Solana Namespace - Asset [DRAFT]," Chain Agnostic Namespaces, solana-caip19, June 2022 / June 2022. [Online serial]. Available: https://github.com/ChainAgnostic/namespaces/solana-caip19.md