From 7fb0fcbd1b9530214ff22fa3f2d6c158cdaade58 Mon Sep 17 00:00:00 2001 From: liang Date: Wed, 1 Jun 2022 19:04:57 +0800 Subject: [PATCH 1/6] add caip-19 asset type for solana namespace --- solana/caip19.md | 70 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 solana/caip19.md diff --git a/solana/caip19.md b/solana/caip19.md new file mode 100644 index 0000000000000..aa38049d22b58 --- /dev/null +++ b/solana/caip19.md @@ -0,0 +1,70 @@ +--- +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. + + +## Syntax + +After the CAIP-2 namespace+chainID, a slash defines an `asset_namespace` and an `asset_reference`. +- + +## Examples + +``` +# One Solana Mainnet NFT +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token-mint:{the-token-mint-account-address} +``` + +### Backwards Compatibility + +Not applicable + +## Test Cases + +This is a list of manually composed examples + +``` +# Solana Mainnet +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ + +# Solana Devnet +solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K +``` + +## References + +[Address Lookup Table Proposal]: https://docs.solana.com/proposals/transactions-v2 +[Account Types]: https://docs.solana.com/terminology#account +[Address Expressions]: https://docs.solana.com/cli/transfer-tokens#receive-tokens +[Token Mint]: https://spl.solana.com/token#creating-a-new-token-type +[CAIP-2]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md +[CAIP-10]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-10.md +[CAIP-19]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-19.md +[CAIP-30]: https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-30.md + + +## Copyright + +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file From 27dd1749e414f9c049c435af752869a94cd5abcb Mon Sep 17 00:00:00 2001 From: liang Date: Wed, 1 Jun 2022 19:08:47 +0800 Subject: [PATCH 2/6] added syntax --- solana/caip19.md | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/solana/caip19.md b/solana/caip19.md index aa38049d22b58..7e81a73adda79 100644 --- a/solana/caip19.md +++ b/solana/caip19.md @@ -27,8 +27,8 @@ But 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`. -- +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 `spl-token-mint` as the namespace and the address of the mint account as the reference. + ## Examples @@ -37,22 +37,6 @@ After the CAIP-2 namespace+chainID, a slash defines an `asset_namespace` and an solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token-mint:{the-token-mint-account-address} ``` -### Backwards Compatibility - -Not applicable - -## Test Cases - -This is a list of manually composed examples - -``` -# Solana Mainnet -solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ - -# Solana Devnet -solana:8E9rvCKLFQia2Y35HXjjpWzj8weVo44K -``` - ## References [Address Lookup Table Proposal]: https://docs.solana.com/proposals/transactions-v2 From ee8d0d1317b3a5182d44cf4cdf665e31a9d5be61 Mon Sep 17 00:00:00 2001 From: liang Date: Sat, 4 Jun 2022 19:42:29 +0800 Subject: [PATCH 3/6] updated example, use spl-token-min -> spl-token --- solana/caip19.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/solana/caip19.md b/solana/caip19.md index 7e81a73adda79..c35260675ae92 100644 --- a/solana/caip19.md +++ b/solana/caip19.md @@ -27,14 +27,17 @@ But 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`. And since both fungible and non-fungible tokens can be identified using the mint account, we could use `spl-token-mint` as the namespace and the address of the mint account as the reference. +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 `spl-token` as the namespace and the address of the mint account as the reference. ## Examples ``` -# One Solana Mainnet NFT -solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token-mint:{the-token-mint-account-address} +# One Solana Mainnet NFT:Pesky Penguins #398 +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644XiTqU5W3w9w + +# Solana Mainnet USDC +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v ``` ## References From 81298f57a2e45e964c12c9f370b57ce125946c67 Mon Sep 17 00:00:00 2001 From: liang Date: Fri, 10 Jun 2022 19:24:58 +0800 Subject: [PATCH 4/6] use as namespace to avoid using --- solana/caip19.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/solana/caip19.md b/solana/caip19.md index c35260675ae92..76b281f465f23 100644 --- a/solana/caip19.md +++ b/solana/caip19.md @@ -27,17 +27,17 @@ But 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`. And since both fungible and non-fungible tokens can be identified using the mint account, we could use `spl-token` as the namespace and the address of the mint account as the reference. +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` as the namespace and the address of the mint account as the reference. ## Examples ``` # One Solana Mainnet NFT:Pesky Penguins #398 -solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644XiTqU5W3w9w +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644XiTqU5W3w9w # Solana Mainnet USDC -solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/spl-token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v +solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v ``` ## References From 10a6e6a4aa950f589c39d566143f180790618d6c Mon Sep 17 00:00:00 2001 From: liang Date: Mon, 22 Aug 2022 17:27:42 +0800 Subject: [PATCH 5/6] added reference table to metaplex --- solana/caip19.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/solana/caip19.md b/solana/caip19.md index 76b281f465f23..e663748bf1718 100644 --- a/solana/caip19.md +++ b/solana/caip19.md @@ -27,7 +27,12 @@ But 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`. And since both fungible and non-fungible tokens can be identified using the mint account, we could use `token` as the namespace and the address of the mint account as the reference. +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](https://docs.metaplex.com/programs/token-metadata/token-standard) Fungible | +| nft | ERC721 | [Metaplex](https://docs.metaplex.com/programs/token-metadata/token-standard) NonFungible| ## Examples From cd87c31fee0f458afde4107467a3a685d9fdc631 Mon Sep 17 00:00:00 2001 From: Bumblefudge Date: Thu, 17 Nov 2022 23:17:35 +0100 Subject: [PATCH 6/6] grammar fixes - no content changes --- solana/caip19.md | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/solana/caip19.md b/solana/caip19.md index e663748bf1718..e20c9816a60fd 100644 --- a/solana/caip19.md +++ b/solana/caip19.md @@ -16,18 +16,17 @@ requires: ["CAIP-2", "CAIP-10", "CAIP-19", "CAIP-30"] ## 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: +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 represent an account balance belong to a certain address. +- each token account represents an account balance belonging to a given 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. +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`. 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. +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 | | :--- | :---- | :--- | @@ -45,7 +44,7 @@ solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:Fz6LxeUg5qjesYX3BdmtTwyyzBtMxk644X solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v ``` -## References +## Links [Address Lookup Table Proposal]: https://docs.solana.com/proposals/transactions-v2 [Account Types]: https://docs.solana.com/terminology#account @@ -59,4 +58,4 @@ solana:4sGjMW1sUnHzSxGspuhpqLDx6wiyjNtZ/token:EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEG ## Copyright -Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). \ No newline at end of file +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).