Skip to content

feat(hive): add Hive blockchain protobuf definitions#31

Merged
BitHighlander merged 12 commits into
masterfrom
feature/hive
May 24, 2026
Merged

feat(hive): add Hive blockchain protobuf definitions#31
BitHighlander merged 12 commits into
masterfrom
feature/hive

Conversation

@BitHighlander
Copy link
Copy Markdown
Owner

Summary

  • messages-hive.proto — HiveGetPublicKey (1600), HivePublicKey (1601), HiveSignTx (1602), HiveSignedTx (1603)
  • messages.proto — wire IDs registered at 1600–1603

Protocol design

  • HiveGetPublicKey → returns STM-prefixed base58 public key + raw 33-byte compressed key
  • HiveSignTx — Graphene transfer: chain_id, ref_block_num/prefix, expiration, from/to accounts, amount (milliHIVE), decimals, asset_symbol (HIVE/HBD), memo
  • HiveSignedTx — 65-byte recoverable secp256k1 signature + full serialized transaction

Test plan

  • Protoc compiles without errors
  • python-keepkey messages_hive_pb2.py generated from this proto loads correctly
  • Firmware (feature/hive) handles HiveGetPublicKey and HiveSignTx via fsm_msg_hive.h

BitHighlander and others added 12 commits April 30, 2026 16:24
…TIP-712)

Adds proto definitions for TRON message-signing parity:
- TronSignMessage / TronMessageSignature (1404/1405) — TIP-191 personal_sign
- TronVerifyMessage (1406) — host-asserted signature verification
- TronSignTypedHash / TronTypedDataSignature (1407/1408) — TIP-712 hash mode

Mirrors the Ethereum personal_sign + EIP-712 hash-mode shape. Firmware
implementation will reuse the secp256k1 + keccak256 primitives already
present for Ethereum, swapping the message prefix to '\x19TRON Signed Message:\n'
for TIP-191 and using '\x19\x01' for TIP-712.

Reserves IDs 1404-1408 contiguous to existing TRON range (1400-1403).
Adds TonSignMessage / TonMessageSignature (1504/1505) — basic Ed25519
arbitrary-bytes signing, mirroring SolanaSignMessage's shape.

This primitive lacks domain separation by design (raw Ed25519 over message
bytes). Firmware should gate it behind the AdvancedMode policy — same
fence used for SolanaSignMessage in fsm_msg_solana.h — until a TON
Connect ton_proof envelope is added as a separate proto.

Reserves IDs 1504-1505 contiguous to existing TON range (1500-1503).
Adds SolanaSignOffchainMessage / SolanaOffchainMessageSignature (756/757)
implementing the Solana off-chain message spec:

  '\xff' || 'solana offchain' || version || format || length || message

The '\xff' lead byte is invalid as a Solana transaction prefix, providing
the domain separation that plain SolanaSignMessage (754/755) lacks. With
this primitive, firmware can drop the AdvancedMode policy gate currently
required for SolanaSignMessage (fsm_msg_solana.h:461-472) for ASCII/UTF8
off-chain messages, since the envelope makes transaction-shaped attacks
impossible.

message_format values per spec:
  0 = Restricted ASCII (max 1212 bytes) — display-renderable
  1 = UTF-8 limited (max 1212 bytes) — display-renderable with care
  2 = UTF-8 extended (max 65515) — blind-sign only

Reserves IDs 756-757 contiguous to existing Solana range (750-755).
Bumped message max_size to 1212 to match the spec ceiling for formats 0/1.
Remove fields 3-6 (address, ak, nk, rivk) from ZcashDisplayAddress.
Field numbers are reserved to prevent reuse. The on-device UA
derivation (Sinsemilla + SWU hash-to-curve) shipped — FVK-match
attestation against a host-built UA is strictly weaker than
device-derived display and is no longer supported.

What stays: address_n / account / expected_seed_fingerprint.
What ZcashAddress returns: address (now device-derived) + seed_fingerprint.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
… drop format 2

Agent-Logs-Url: https://github.com/keepkey/device-protocol/sessions/880cd954-b4b2-4f87-af05-8d715e1e0dc4

Co-authored-by: pastaghost <62026038+pastaghost@users.noreply.github.com>
…tocol

release: device-protocol 7.14.1 message-signing sync
Merges upstream 7.14.1 (Tron TIP-191/712, TON SignMessage, Solana
SignOffchainMessage) with fork's Zcash UA/seed_fingerprint/display
address additions. Conflict resolution: kept upstream's format-2
removal from SolanaSignOffchainMessage docs.
Adds messages-hive.proto with HiveGetPublicKey, HivePublicKey,
HiveSignTx, and HiveSignedTx. Assigns message type IDs 1600-1603
in messages.proto.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…step

build:json used pbjs v0.0.5 which cannot parse proto3 reserved fields (present
in zcash, cosmos, ethereum, etc). proto.json is unused by the vault — only
messages_pb.js is imported. Build now runs build:js + build:postprocess only.
@BitHighlander BitHighlander merged commit 2b25cf7 into master May 24, 2026
@BitHighlander BitHighlander deleted the feature/hive branch May 24, 2026 16:49
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.

3 participants