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

[Feature] - Add Chain Agnostic Blockchain Reference #6624

Open
0xzoz opened this issue Dec 6, 2022 · 13 comments
Open

[Feature] - Add Chain Agnostic Blockchain Reference #6624

0xzoz opened this issue Dec 6, 2022 · 13 comments
Labels
doc-issue Issue submitted using the Doc issue template

Comments

@0xzoz
Copy link

0xzoz commented Dec 6, 2022

Add Chain Agnostic Blockchain Reference

  • Define a CAIP-2 blockchain reference for Sui.

Motivation

To be able to reference SUI for an integration I am looking at completing for Ceramic Network there is a need to have a blockchain reference in Chain Agnostic. This will be the discussion point for the CAIP that I will be submitting shortly.

@0xzoz 0xzoz added the doc-issue Issue submitted using the Doc issue template label Dec 6, 2022
@0xzoz
Copy link
Author

0xzoz commented Dec 6, 2022

Hey team, here is a draft. I'm not sure how far the discussions are regarding a reference framework or if there is any information available publicly. Any insight?

@0xzoz
Copy link
Author

0xzoz commented Dec 7, 2022

This PR and conversation have been moved to the namespace repository ChainAgnostic/namespaces#43

@joyqvq
Copy link
Contributor

joyqvq commented Dec 12, 2022

wondering what support for this does the sui repo need? does signature needs to commit to this namespace or this is for other usages?

the rfc looks fine to me otherwise to give identifier for network names.

@0xzoz
Copy link
Author

0xzoz commented Dec 14, 2022

Thanks for querying @joyqvq. Nothing is needed in the Sui repo. This was created to provide a place for discussions(as specified in the PR request criteria from Chain Agnostic).

What's required is documentation and/or verification that the namespaces for the sui network are what is specified in the CAIP. While looking in the repo and discord I could see no standard to what sui networks are referred as.

For reference the CAIP has the following sui references:

# Sui mainnet
sui:mainnet
# Sui testnet
sui:testnet
# sui devnet
sui:devnet

Other blockchain CAIPs may provide more context and can be found here

@bumblefudge
Copy link

bumblefudge commented Jan 4, 2023

namespaces editor here!

many namespaces opt for a hash (or subset of a hash) of the genesis block, rather than a concise string identifier, to prevent forks sharing an identifier on systems where a node can return the genesis hash of its chain. Reading around the CAIP-2 profiles in namespaces provides some context on different approaches to chain identification; I leave it to the sui team to decide if the referent of "mainnet" and "testnet" will remain constant or if there is a dispute/ambiguity resolution mechanism built into the node RPC's info/help/etc commands :D

@0xzoz
Copy link
Author

0xzoz commented Jan 10, 2023

Thanks for the insight @bumblefudge. Thats some good information to keep in mind and makes a lot of sense. I'm not sure if that works for all networks though considering Devnet is dynamic and will change regularly(well,it has been in these early stages). Still waiting on some input from the team but it looks like there has been the appoach of naming via 'testnet' and 'devnet' here.

@bumblefudge
Copy link

Well, I think that simplicity or parity between namespace/ecosystem-internal representation isn't necessarily an asset or benefit in CAIP-2 representations-- what matters more is unambiguous addressing from outside of that ecosystem, i.e., without reference to any tribal knowledge, common sense, or offchain consensus. for instance, if the referent of "devnet" changes every 6 months because the chain is fully or partially restarted, it might actually be more useful for CAIP-2 usecases to refer to a specific instance of devnet (unambiguously identified by the genesis hash of the chain between restarts), since the consumer of a CAIP-2 is likely not to know about those regular restarts (i.e. an error message or a mismatch after calling today's devnet and querying genesis hash may be more useful than a reference to today's devnet, particularly if devnet doesn't inherit 100% of previous-devnet's addressable chainstate!)

@bumblefudge
Copy link

See also:
ChainAgnostic/namespaces#41

@bmwill
Copy link
Contributor

bmwill commented Jan 11, 2023

Sorry for not contributing to this thread earlier. I've been working on a number of things related to this topic, let me share a bit about what we're thinking.

Until recently sui didn't really have a concept of a "genesis block", as of a week or so ago this has changed and the output of genesis is now checkpoint 0, or the genesis block as in other systems. This gives us the opportunity to use the hash of checkpoint 0 to be used as an unambiguous chain identifier.

We do use the terminology 'mainnet', 'testnet', 'devnet', etc as more human usable labels for various networks, but going forward they should be treated as tags or references that point to the unambiguous chain id (i.e. the hash of the genesis block), e.g. devnet -> 0x123456....

@bumblefudge
Copy link

Thanks, that makes CAIP-authoring (and interop!) a lot simpler!

@bumblefudge
Copy link

Whoever takes the pen on finishing up the CASA docs, feel free to ping me on the CASA Discord if I miss the GH notif.

@haardikk21
Copy link

Hi - pinging this old thread. Would love to hear the Sui team's thoughts on moving forward with this. We'd like to see Sui having a CAIP-2 and CAIP-10 specification with CASA to build out a CAIP-122 standard therefore enabling a standardized "Sign in with Sui" implementation as defined in CAIP-122.

@bumblefudge
Copy link

@0xzoz @bmwill
I'll also add that since this thread, other contributors to the CASA docs pointed out that it was confusing to know where to start and what the expectations were from just the template, so I wrote this little doc to guide people through it:
https://github.com/ChainAgnostic/namespaces/blob/main/CONTRIBUTING.md
Feel free to ping me anywhere or open an issue or PR if you think the contributing.md file needs more detail or guidance :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc-issue Issue submitted using the Doc issue template
Projects
None yet
Development

No branches or pull requests

10 participants