Skip to content

[Bug] tools/cli-wallet generates legacy Base58 RTC addresses #6518

@eliasx45

Description

@eliasx45

Summary

The legacy CLI wallet under tools/cli-wallet appears to generate RustChain addresses in an older/incompatible Base58 format, while current wallet code and docs say signed-transfer addresses must be RTC + 40 hex characters.

Evidence

  • tools/cli-wallet/src/main.rs:105-109 hashes the secp256k1 public key and formats the address as RTC + base58(hash[0..20]).
  • tools/cli-wallet/src/main.rs:148-155 validates addresses by Base58-decoding the part after RTC and only requiring length >= 25.
  • Current native wallet code derives addresses as RTC + sha256(ed25519_public_key_bytes)[:40] in rustchain-wallet/src/keys.rs:75-80.
  • docs/API_WALKTHROUGH.md:211 says signed transfers require 43-character addresses: RTC + 40 hex.

Why this is confusing

A newcomer following the CLI wallet README can generate an address that starts with RTC, but the suffix is Base58 and the length is not the documented 40-hex format. That address can then fail in newer validation paths such as bridge/faucet/signed-transfer checks that expect ^RTC[0-9a-fA-F]{40}$.

Expected behavior

All wallet generators and validators should agree on one public format. If the modern format is canonical, tools/cli-wallet should derive RTC + first 40 hex chars of SHA-256 over the public key and validate with the same 43-character hex rule.

Actual behavior

tools/cli-wallet still uses Base58 address derivation/validation and secp256k1 key material, while the newer wallet uses Ed25519 and 40-hex RTC addresses.

Suggested fix

Either deprecate/remove the older tools/cli-wallet README/tool from onboarding paths, or update it to match rustchain-wallet address derivation and validation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions