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

Make a CIP-30 extension CIP, to allow the "Network magic" to be reported from a wallet. #17

Open
stevenj opened this issue Dec 18, 2024 · 0 comments
Assignees

Comments

@stevenj
Copy link
Collaborator

stevenj commented Dec 18, 2024

We need a way to tell what network a wallet is conencted to, not just if its a tesnet or mainnet.

Cip30: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0030/README.md

CIP30 defines a way to create extensions: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0030/README.md#extension
It also defines a method to return the network: https://github.com/cardano-foundation/CIPs/blob/master/CIP-0030/README.md#apigetnetworkid-promisenumber
However, this only says if the network is mainnet, or not. Its not useful, pre-prod, pre-view or any other test network are all lumped together as 0. We need to be able to tell if a wallet is used Preprod or preview or some other test network reliably.
Actual wallet addresses do not do this, as they could be the same across test networks.

So, create a CIP 30 extension CIP that adds a api.getNetworkMagic(): Promise<number> function which returns the connected networks magic number, so the dapp can determine exactly what test network it is connected to.

for pre-existing examples of cip-30 extensions, See:
https://github.com/cardano-foundation/CIPs/blob/d08e2671148a4f970ad9dab6ea82c9e94ddf32af/CIP-0106/README.md?plain
https://github.com/cardano-foundation/CIPs/blob/d08e2671148a4f970ad9dab6ea82c9e94ddf32af/CIP-0095/README.md?plain
https://github.com/cardano-foundation/CIPs/blob/d08e2671148a4f970ad9dab6ea82c9e94ddf32af/CIP-0104/README.md?plain

The extension should be small and introduce this one feature.

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

No branches or pull requests

2 participants