Fetch the spending public key with P1=0x01 (display + confirm) - #23
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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, rejectingP1 = 0x00withSW_WRONG_P1P2.buildGetPublicKeysentP1 = 0x00, so on current firmware the spending-key fetch — and therefore wallet-artifact derivation / wallet loading — fails.Change
buildGetPublicKeynow sendsP1 = 0x01.P1 = 0x00— it is gated by its own on-device confirmation and would returnSW_WRONG_P1P2underP1 = 0x01. Documented on both builders so it isn't changed by mistake.Behavior / compatibility
getPublicKey()andgetWalletArtifacts()now prompt for an on-device approval (previously silent). Reject maps to the existing user-rejected error (0x6985).Typecheck clean; full suite green.