Add NEAR Protocol namespace (near) with CAIP-2 profile - #203
Open
okwme wants to merge 1 commit into
Open
Conversation
Adds a CAN for the near ecosystem with a CAIP-2 Blockchain ID profile. Drafted by the maintainers of FAR, an open cross-reference between CAIP-19, CoinGecko and ISO 24165 identifiers, which needs a CAIP-2 for this chain to name assets that exist on it. The authors do not represent the near ecosystem and offer this as a starting point for its community to correct, adopt or replace. Discussion: 0xcounting/FAR#1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a CAN for NEAR Protocol with a CAIP-2 Blockchain ID profile.
This answers the open request in #106 ("CAIP-2 for NEAR"), which pointed at ChainAgnostic/CAIPs#43 — that PR was closed unmerged in 2023 with "please make all namespace PRs in the namespaces repo", and nobody did. There is no
near/folder and no other NEAR PR, so this should not collide with in-flight work.Who wrote this, and why you should read it sceptically
I do not represent the NEAR ecosystem. I maintain FAR, an open cross-reference between CAIP-19, CoinGecko and ISO 24165 (DTI) identifiers, which needs a CAIP-2 for NEAR in order to name 72 assets that exist on it. This is offered as a starting point for NEAR's maintainers to correct, adopt or replace, and I would rather it carried their name than mine. Happy to close it in favour of a NEAR-authored version.
Proposal
near:+ the nearcorechain_idstring, verbatim and case-sensitive.Verified live (2026-09-14)
statusonrpc.mainnet.near.organdrpc.testnet.near.org, and independently onfree.rpc.fastnear.com/test.rpc.fastnear.com— all four agreechain_idis literally"mainnet"/"testnet".RpcStatusResponse.chain_idis a required field in nearcore's own OpenAPI, documented "Unique chain id", with the warning "If your testnet blockchains do not have unique chain IDs, you will have a bad time".core/primitives-core/src/chains.rs.Why the human-readable id rather than a genesis hash
Two reasons the spec argues rather than asserts:
UNKNOWN_BLOCKfor block0— genesis heights are 9,820,210 (mainnet) and 42,376,888 (testnet), because each network's genesis is a state snapshot rather than a bootstrapped empty chain. An implementer following the usual "query block 0" recipe gets an error.bip122's 32 hex chars are exactly the first 16 bytes; base58 has no such property.Precedent cited:
cosmos(cosmos:cosmoshub-3appears in CAIP-2's own test cases),sui,flow,stellar,tezos.Flagged for whoever writes the CAIP-19 profile
NEAR account ids may contain
_(verified live:v3.oin_finance.nearis a working NEP-141 token), and_is not legal in either a CAIP-19asset_referenceor a CAIP-10account_address. Percent-encoding as%5Fis legal under both and is named as the obvious candidate, but I deliberately left that decision to whoever writes those profiles rather than pre-empting it from outside the ecosystem.discussions-topoints at 0xcounting/FAR#1, which also carries the wider gap list.