Skip to content

Conversation

Copy link

Copilot AI commented Jan 7, 2026

Pull Request Checklist

Before submitting this PR, please make sure:

  • You have run cargo clippy and addressed any warnings
  • You have added appropriate tests (if applicable)
  • You have updated the documentation (if applicable)
  • You have reviewed your own code
  • You have updated changelog (if applicable)

Description

Senate key validation and multisig derivation scripts now support both Substrate SS58 and Solana base58 key formats through automatic detection.

Changes

Enhanced key format detection:

  • is_solana_key(): Multi-step validation distinguishing SS58 (network prefix + checksum) from Solana (plain base58)
  • Checks: character prefix heuristics → base58 decode → SS58 validation attempt
  • Returns Solana if base58 decodes to exactly 32 bytes but fails SS58 validation

Universal key decoding:

  • decode_key() / decode_key_to_hex(): Handle both formats, return 32-byte Ed25519 public key
  • Solana: Direct base58 decode
  • SS58: ss58_decode → hex → bytes

Updated scripts:

  • validate_replacement_key.py: Added format column to validation table
  • derive_senate_multisig.py: Multisig derivation works with mixed key types
  • Both scripts remain self-contained with duplicated helper functions

Documentation:

  • Updated help text with format examples
  • Added dependency: base58 package

Example

# Both formats work interchangeably
senate_keys = [
    "5H47pSknyzk4NM5LyE6Z3YiRKb3JjhYbea2pAUdocb95HrQL",  # SS58
    "7EqQdEULxWcraVx3mXKFjc84LhCkMGZCkRuK3wxXkVSu",      # Solana
]

# Scripts auto-detect format, decode to same 32-byte result
for key in senate_keys:
    decoded = decode_key(key)  # Returns 32 bytes for both

Backward compatible. Existing SS58 keys work unchanged.

Related Issues

N/A

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • astral.sh
    • Triggering command: /usr/bin/curl curl -LsSf REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

make this work with solana keys


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 4 commits January 7, 2026 15:41
Co-authored-by: 21bloc <28872221+21bloc@users.noreply.github.com>
Co-authored-by: 21bloc <28872221+21bloc@users.noreply.github.com>
Co-authored-by: 21bloc <28872221+21bloc@users.noreply.github.com>
Co-authored-by: 21bloc <28872221+21bloc@users.noreply.github.com>
Copilot AI changed the title [WIP] Add functionality to work with Solana keys Add Solana base58 key support to Python validation scripts Jan 7, 2026
Copilot AI requested a review from 21bloc January 7, 2026 15:52
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

Successfully merging this pull request may close these issues.

2 participants