Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extends solana/caip19 #25

Merged
merged 6 commits into from
Nov 17, 2022

Conversation

qbig
Copy link

@qbig qbig commented Jun 1, 2022


namespace-identifier: solana-caip19
title: Solana Namespace - Asset
author: Qiao Liang (@qbig)
discussions-to:
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 are using 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 represent an account balance belong to a certain address.

And the difference between fungible token and non-fungible token is that non-fungible token mint has a total supply of 1 and zero decimal place.
But both asset type can be identified by their "mint" account.
qbig marked this conversation as resolved.
Show resolved

Syntax

After the CAIP-2 namespace+chainID, a slash defines an asset_namespace and an asset_reference. And since both fungible and non-fungible tokens can be identified using the mint account, we could use token, nft as the namespace and the address of the mint account as the reference.

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

Examples

# One Solana Mainnet NFT:Pesky Penguins #398
solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644XiTqU5W3w9w
# Solana Mainnet USDC
solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v

References

Copyright

Copyright and related rights waived via CC0.

solana/caip19.md Outdated Show resolved Hide resolved
solana/caip19.md Outdated Show resolved Hide resolved
@qbig
Copy link
Author

qbig commented Jun 4, 2022

updated using spl-token as asset namespace

@qbig
Copy link
Author

qbig commented Jun 10, 2022

@bumblefudge could you take another look?

@qbig
Copy link
Author

qbig commented Jun 15, 2022

updated using token as asset namespace

Copy link

@felipe-chamas felipe-chamas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it'd also be nice if you could include the CAIP-22 proposal. I think your issue is titled with CAIP-19, but the ERC721 example with TokenId is based on CAIP-22

solana/caip19.md Outdated Show resolved Hide resolved
@qbig qbig force-pushed the feat/extends-solana-caip19 branch from 07c6949 to 10a6e6a Compare August 22, 2022 09:27
@qbig qbig removed the request for review from ligi August 23, 2022 03:32
@obstropolos
Copy link
Contributor

@qbig - we can move to get this in - can you add a quick description to the PR as well?

@qbig
Copy link
Author

qbig commented Nov 6, 2022

@obstropolos could you take a look when it's convenient?

@bumblefudge bumblefudge merged commit 4eb99d1 into ChainAgnostic:main Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants