Skip to content

Fetch the spending public key with P1=0x01 (display + confirm) - #23

Merged
zy0n merged 1 commit into
mainfrom
fix/spending-pubkey-p1-display
Jul 24, 2026
Merged

Fetch the spending public key with P1=0x01 (display + confirm)#23
zy0n merged 1 commit into
mainfrom
fix/spending-pubkey-p1-display

Conversation

@zy0n

@zy0n zy0n commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

RAILGUN firmware 1.6.1 changed the spending-public-key command to require P1 = 0x01 (display + confirm): the device shows the account index and pubkey and returns the 64-byte key only on approval, rejecting P1 = 0x00 with SW_WRONG_P1P2. buildGetPublicKey sent P1 = 0x00, so on current firmware the spending-key fetch — and therefore wallet-artifact derivation / wallet loading — fails.

Change

  • buildGetPublicKey now sends P1 = 0x01.
  • The viewing-private-key command (INS 0x13) keeps P1 = 0x00 — it is gated by its own on-device confirmation and would return SW_WRONG_P1P2 under P1 = 0x01. Documented on both builders so it isn't changed by mistake.
  • Smoke test locks both P1 values.

Behavior / compatibility

  • getPublicKey() and getWalletArtifacts() now prompt for an on-device approval (previously silent). Reject maps to the existing user-rejected error (0x6985).
  • Firmware-coordinated change: the client now targets firmware >= 1.6.1 for key retrieval.

Typecheck clean; full suite green.

RAILGUN firmware 1.6.1 requires P1=0x01 (display + confirm) on the
spending-public-key command and rejects P1=0x00 with SW_WRONG_P1P2, so
the device now shows the account index and pubkey for on-device approval
before returning the key. Update buildGetPublicKey accordingly.

The viewing-private-key command keeps P1=0x00 (it is gated by its own
confirmation); document that so it is not changed by mistake. Lock both
P1 values in the public-API smoke test.
@zy0n
zy0n merged commit 2863680 into main Jul 24, 2026
3 checks passed
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.

1 participant