Skip to content

feat(solana): KKSOLSW1 lookup-table account attestation tests - #37

Merged
BitHighlander merged 1 commit into
masterfrom
feat/kksolsw1-tests
Aug 21, 2026
Merged

feat(solana): KKSOLSW1 lookup-table account attestation tests#37
BitHighlander merged 1 commit into
masterfrom
feat/kksolsw1-tests

Conversation

@BitHighlander

Copy link
Copy Markdown
Owner

Four tests for the transaction-bound attestation that upgrades an ALT transaction from a blind sign to a described one.

The positive test asserts the screen count, not just that signing succeeded — and that is the whole reason it was worth writing: it caught a real firmware bug on first run. nanopb hands each repeated bytes element back as a {size, bytes[32]} struct, and the firmware was casting the array to (uint8_t(*)[32]) — hashing the size word plus 28 bytes of the first key. The signature never verified. A test that only checked "did it sign" would have passed, because the fallback path signs perfectly well.

test asserts
..._shown_and_blind_sign_still_follows base flow + 1 identity + 1 per account, baseline codes still at the tail
..._bad_signature_degrades_to_todays_flow unverifiable attestation adds nothing, refuses nothing
..._does_not_replay_onto_another_transaction same signature on a perturbed tx describes nothing
..._no_signer_loaded_means_no_extra_screens trust is opt-in per session

Note for whoever extends these: the three negative cases pass trivially if the signer is not loaded, because "no extra screens" is also what a broken positive path produces. Only the count assertion distinguishes them. That is why it exists and why it should not be relaxed into "signature is 64 bytes".

messages_solana_pb2.py regenerated — must use a protoc whose output protobuf==3.20.3 accepts; system protoc emits google.protobuf.runtime_version imports that 3.20 lacks. grpcio-tools==1.48.2 works.

Four tests for the transaction-bound attestation that upgrades an ALT
transaction from a blind sign to a described one.

The positive test asserts the SCREEN COUNT, not just that signing succeeded,
and that is the whole reason it was worth writing: it caught a real firmware
bug on first run. nanopb hands each repeated `bytes` element back as a
{size, bytes[32]} struct, and the firmware was casting the array to
(uint8_t(*)[32]) -- hashing the size word plus 28 bytes of the first key. The
signature never verified. A test that only checked "did it sign" would have
passed, because the fallback path signs perfectly well.

  test_attested_accounts_are_shown_and_blind_sign_still_follows
      base flow + 1 identity screen + 1 per account, and the baseline codes
      still present at the TAIL -- the additive invariant, restated for Solana
  test_bad_signature_degrades_to_todays_flow
      an unverifiable attestation adds nothing and refuses nothing
  test_attestation_does_not_replay_onto_another_transaction
      the same signature against a perturbed tx describes nothing
  test_no_signer_loaded_means_no_extra_screens
      trust is opt-in per session; without a provider the payload is inert

Note for whoever extends these: the three negative cases pass trivially if the
signer is not loaded, because "no extra screens" is also what a broken positive
path produces. Only the count assertion in the first test distinguishes them.
That is why it exists, and why it should not be relaxed into "signature is 64
bytes".

messages_solana_pb2.py regenerated for the new tags. It must be generated with
a protoc whose output the pinned protobuf==3.20.3 runtime accepts -- the system
protoc emits code importing google.protobuf.runtime_version, which 3.20 does
not have. grpcio-tools==1.48.2 produces compatible output.
@BitHighlander
BitHighlander merged commit a5df311 into master Aug 21, 2026
1 of 2 checks passed
@BitHighlander
BitHighlander deleted the feat/kksolsw1-tests branch August 21, 2026 18:46
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