Skip to content

fix(hive): emit the wire symbols hived uses, not the display ones#376

Merged
BitHighlander merged 1 commit into
developfrom
fix/hive-wire-symbols
Jul 21, 2026
Merged

fix(hive): emit the wire symbols hived uses, not the display ones#376
BitHighlander merged 1 commit into
developfrom
fix/hive-wire-symbols

Conversation

@BitHighlander

Copy link
Copy Markdown
Collaborator

The bug

hived encodes HIVE as STEEM and HBD as SBD. The 2020 rebrand renamed the tokens but not their on-chain serialization. asset() wrote the display spelling, so the device signed bytes hived never reproduces. hived re-serializes the operation to check the signature, recovers a key from different bytes, finds it in no authority, and reports:

missing required active authority: Missing Active Authority <account>
Transaction failed to validate using both new (hf26) and legacy serialization

Found in live testing on a limit_order_create; the message points at keys and the keys were fine.

Scope: every asset-bearing op here — transfer_to_vesting, convert, comment_options, transfer_to_savings, transfer_from_savings, claim_reward_balance, limit_order_create. Not vote / comment / custom_json (no assets), not the VESTS-only ops (VESTS is spelled the same), and not hive_transfer (firmware builds those bytes from typed fields, never through this serializer) — which is why voting and transfers worked.

The fix

One line in asset(): write WIRE_SYMBOL[symbol] ?? symbol. Input parsing, precision rules and the symbol whitelist still speak in display symbols, so callers and error messages are unchanged.

Why the tests didn't catch it

They were byte-exact mirrors of the firmware parser, which expected the same wrong bytes. Two independent implementations of the same misunderstanding is not verification.

Added two golden vectors from hived's own condenser_api.get_transaction_hex (limit_order_create and claim_reward_balance, covering all three symbols), compared against the full serializer output. They drop hived's trailing signatures-count byte, since the digest preimage stops after the extensions varint.

57/57 pass.

Ships with

BitHighlander/keepkey-firmware#316 — the parser has to accept STEEM/SBD and map back to HIVE/HBD for the OLED. Merging this alone makes the device reject every asset-bearing op.

🤖 Generated with Claude Code

hived encodes HIVE as "STEEM" and HBD as "SBD" — the 2020 rebrand renamed
the tokens but not their serialization. We emitted the display spelling, so
the device signed bytes hived re-serializes differently; its signature check
recovers a key from those bytes, finds it in no authority, and reports
"missing required active authority". Every asset-bearing op was affected.

This serializer and the firmware parser were byte-exact mirrors of each
other, so both were wrong together and every test passed. Added two golden
vectors from hived's own condenser_api.get_transaction_hex — the only source
that could have caught it.

Requires the matching firmware fix (BitHighlander/keepkey-firmware#316).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@BitHighlander
BitHighlander merged commit 2a09591 into develop Jul 21, 2026
1 check passed
@BitHighlander
BitHighlander deleted the fix/hive-wire-symbols branch July 21, 2026 01:21
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