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

Network Magic Extension for CIP-0030 #961

Open
nathanbogale opened this issue Jan 9, 2025 · 0 comments
Open

Network Magic Extension for CIP-0030 #961

nathanbogale opened this issue Jan 9, 2025 · 0 comments

Comments

@nathanbogale
Copy link

Overview

We need a standardized way for dApps to identify specific Cardano test networks they're connected to. While CIP-0030's getNetworkId() can distinguish between mainnet and testnet, it cannot differentiate between various test networks (preview, preprod, etc.).

Current Problem

  • getNetworkId() only returns 0 (testnet) or 1 (mainnet)
  • dApps cannot programmatically determine which specific test network they're connected to
  • Makes automated testing and network-specific configurations more difficult
  • Forces developers to use workarounds or manual network selection

Proposed Solution

Add a new CIP that extends CIP-0030 with a getNetworkMagic() function that returns the network's magic number:

  • Mainnet: 764824073
  • Preview Testnet: 2
  • Preprod Testnet: 1
  • Custom Testnet: (other values)

Benefits

  1. Improved development workflow
  2. Better automated testing capabilities
  3. More precise network identification
  4. Maintains backwards compatibility
  5. Simple implementation for wallet providers

Related Links

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

1 participant