Skip to content

fix(cli-wallet): use canonical RTC hex addresses#6519

Merged
Scottcjn merged 2 commits into
Scottcjn:mainfrom
eliasx45:fix-cli-wallet-rtc-address
May 28, 2026
Merged

fix(cli-wallet): use canonical RTC hex addresses#6519
Scottcjn merged 2 commits into
Scottcjn:mainfrom
eliasx45:fix-cli-wallet-rtc-address

Conversation

@eliasx45
Copy link
Copy Markdown
Contributor

Summary

Fixes #6518.

This updates the legacy tools/cli-wallet address path so it no longer emits or accepts Base58-style RTC... addresses. It now aligns with the canonical RustChain format used by the current wallet/docs: RTC plus 40 hexadecimal characters.

Changes

  • Generate addresses as RTC + first 40 hex chars of SHA-256 over the wallet public key bytes.
  • Validate addresses with exact RTC[0-9a-fA-F]{40} semantics.
  • Update CLI wallet README examples and troubleshooting text.
  • Remove the now-unused base58 dependency from the legacy CLI wallet crate.
  • Extend the existing unit tests to reject legacy Base58-shaped, short, long, and non-hex RTC addresses.

Verification

Local Windows host does not currently have Cargo installed, so I could not run the Rust crate tests locally.

Static checks performed:

git diff --check -- tools\cli-wallet
rg -n 'base58' tools\cli-wallet -S

The first check passed. The second check returns no remaining Base58 usage in tools/cli-wallet.

@github-actions github-actions Bot added documentation Improvements or additions to documentation BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) size/S PR: 11-50 lines labels May 28, 2026
@github-actions github-actions Bot added the node Node server related label May 28, 2026
@eliasx45
Copy link
Copy Markdown
Contributor Author

CI follow-up: the initial run failed during Python test collection before reaching this wallet change because node/gpu_render_endpoints.py had a syntax error in the current base tree (expected except or finally block).

I added a second tiny commit that restores the intended indentation for the GPU release settlement block. Local verification for that unblocker:

.venv\Scripts\python.exe -m py_compile node\gpu_render_endpoints.py
.venv\Scripts\python.exe -m pytest -q tests\test_gpu_render_endpoints_security.py --tb=short
# 11 passed

Cargo is still unavailable on this Windows host, so the tools/cli-wallet Rust tests are left for GitHub CI.

@eliasx45
Copy link
Copy Markdown
Contributor Author

Follow-up on the second CI run:

  • The branch-specific targeted checks still pass locally:
.venv\Scripts\python.exe -m py_compile node\gpu_render_endpoints.py
.venv\Scripts\python.exe -m pytest -q tests\test_gpu_render_endpoints_security.py tests\test_wallet_cli_39.py --tb=short
# 19 passed

git diff --check origin/main...HEAD
# clean

@Scottcjn Scottcjn merged commit 91eb0e2 into Scottcjn:main May 28, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

BCOS-L1 Beacon Certified Open Source tier BCOS-L1 (required for non-doc PRs) documentation Improvements or additions to documentation node Node server related size/S PR: 11-50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

2 participants