Skip to content

Fix: Address Generation Issues - #21

Open
sephynox wants to merge 1 commit into
test/signing-algosfrom
fix/address-generation
Open

Fix: Address Generation Issues#21
sephynox wants to merge 1 commit into
test/signing-algosfrom
fix/address-generation

Conversation

@sephynox

@sephynox sephynox commented Jul 30, 2026

Copy link
Copy Markdown
Collaborator

Summary

The SIGN_BLOCK review screens displayed addresses with the key-type prefix encoded twice and a checksum computed over the doubled bytes, so the address a user saw on device never matched their real account. The encoder now takes the raw key and key type separately, matching node-rs's format_public_key_string, and review fields split on-chain values the same way the node does.

Related Issues

Changes Made

  • Review screens show the canonical keeta_ address for every field
  • All three key types (secp256k1, ed25519, secp256r1) render correctly
  • Device addresses now tested against node-rs and keetanet-client
  • Both reference verifiers gained an address mode for those tests
  • Regenerated the two sign-block review snapshot goldens

Breaking Changes

None


Note

Medium Risk
Changes address strings users see before signing (high user-impact) but fixes a correctness bug; scope is localized to encoding/formatting with strong reference tests.

Overview
Fixes incorrect keeta_ addresses on device by aligning encoding and review formatting with node-rs (format_public_key_string / to_public_key_string).

generate_address now takes a raw key and explicit key type byte (not Algorithm), with shared ADDRESS_PREFIX / CHECKSUM_LEN constants. GET_PUBLIC_KEY and signer derivation pass the algorithm discriminant as key type.

SIGN_BLOCK review no longer treats on-chain account bytes as a pubkey with an inferred prefix: values are split as keyType || rawKey, and 33-byte token keys default to secp256k1 (0x00) when no type byte is present. Algorithm::from_pubkey_prefix is removed.

Tests: Rust and TypeScript reference verifiers add an address mode; test_address_display.py asserts GET_PUBLIC_KEY and review-screen addresses match both references for all three key types; signature round-trip tests use shared verifier helpers in conftest.py.

Reviewed by Cursor Bugbot for commit 0bd1652. Bugbot is set up for automated code reviews on this repo. Configure here.

@sephynox sephynox self-assigned this Jul 30, 2026
@sephynox sephynox added the bug Something isn't working label Jul 30, 2026
@sephynox sephynox changed the title fix: address generation issues Fix: Address Generation Issues Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant