Skip to content

feat(hive): Hive blockchain integration — firmware through txbuilder#187

Merged
BitHighlander merged 7 commits into
developfrom
feature/hive
May 27, 2026
Merged

feat(hive): Hive blockchain integration — firmware through txbuilder#187
BitHighlander merged 7 commits into
developfrom
feature/hive

Conversation

@BitHighlander
Copy link
Copy Markdown
Collaborator

Summary

Full Hive blockchain integration from firmware proto through transaction builder. All API verification checkpoints pass with device connected on feature/hive firmware.

Layer 0 — device-protocol (feature/hive branch, submodule pinned):

  • messages-hive.proto with wire IDs 1600–1603
  • Added to build:js; excluded from build:json (pbjs v0.0.5 can't parse reserved fields)

Layer 1 — Firmware (feature/hive branch, submodule pinned):

  • lib/firmware/hive.c, fsm_msg_hive.h, include/keepkey/firmware/hive.h
  • BIP44 path m/44'/1275'/0'/0/0

Layer 2 — hdwallet (fork/feature/hive SHA adee5155):

  • hdwallet-core/src/hive.tsHiveGetPublicKey, HiveSignTx, HiveSignedTx interfaces
  • hdwallet-keepkey/src/hive.ts — protobuf shims + transport (returns {publicKey: 'STM...'})

Layer 4 — Vault:

  • chains.tschainFamily: 'hive', CONFIGS entry, CAIP/networkId/decimal fallbacks
  • index.tspublicKey fallback in address extraction, pioneerBaseUrl passed to txbuilder
  • txbuilder/hive.tsbuildHiveTransfer (Pioneer tx-params + account lookup) + broadcastHiveTx
  • rest-api.ts + swagger.json/addresses/hive, /api/pioneer/status, /api/pioneer/url
  • Makefile — device-protocol build stamp

API verification (all pass with feature/hive firmware)

  • CP1 hive:beeab0de in supportedChains — ✅
  • CP2 /addresses/hive returns STM6... key — ✅
  • CP3 endpoint in swagger — ✅
  • CP4 CAIP hive:beeab0de correct — ✅
  • CP5 portfolio balance — pending Pioneer balance handler deployment
  • CP6 minFirmware gate excludes chain when no device — ✅

What's next (before merge)

  • Onboarding UI — Hive has no address, just an STM key; users need to create an account externally before first send. Need an asset page that explains this + links out
  • Send flowbuildHiveTransfer throws helpful error if no on-chain account; send UI needs to surface this clearly vs a generic error
  • CP5 — Pioneer balance handler fully deployed and tested
  • Pioneer packages published to npm so Chain.Hive / CAIP fallbacks can be removed
  • Rebase onto develop once develop catches up with any conflicting changes

Test plan

  • With feature/hive firmware: GET /addresses/hive returns STM6...
  • minFirmware gate: chain absent from supportedChains when no device connected
  • /api/pioneer/url switches backend at runtime; persists across restart
  • buildHiveTransfer throws "No Hive account" for a fresh key (no on-chain account)
  • Full send flow once an on-chain Hive account exists for the derived key

BitHighlander and others added 7 commits May 22, 2026 17:45
Points modules/keepkey-firmware to the feature/hive branch which
adds Hive blockchain signing support (HiveGetPublicKey, HiveSignTx).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Points to BitHighlander/device-protocol@f2b32d8 which adds
messages-hive.proto with HiveGetPublicKey/HiveSignTx/HiveSignedTx
(wire IDs 1600-1603).
…build pipeline

- chains.ts: add HIVE to chainFamily union, CONFIGS entry (BIP44 m/44'/1275'/0'/0/0,
  color #E31337, hiveGetPublicKey/hiveSignTx), and CAIP/networkId/decimal fallbacks
  (hive:beeab0de/slip44:1275, decimals 3) since pioneer-caip PR not yet published
- index.ts: fix address extraction to check result?.publicKey for Hive (hiveGetPublicKey
  returns { publicKey: 'STM...' } not { address: '...' })
- Makefile: add DEVICE_PROTOCOL_BUILD_STAMP — auto-builds device-protocol on make dev/install
- modules/device-protocol: bump to feature/hive (adds messages-hive.proto to build:js,
  drops broken build:json which pbjs v0.0.5 cannot parse with reserved fields)
POST /addresses/hive: derives STM-prefixed public key via hiveGetPublicKey,
caches result, returns { address: 'STM6...' }. Requires firmware v7.14.0+.
- txbuilder/hive.ts: buildHiveTransfer (fetches tx-params + resolves STM
  key → account name via Pioneer in parallel) and broadcastHiveTx (POSTs
  signed tx to Pioneer /api/v1/hive/broadcast with reassembled JSON body)
- txbuilder/index.ts: wire case 'hive' into buildTx / signTx / broadcastTx;
  add pioneerBaseUrl param so custom Pioneer URLs flow through to txbuilder
- index.ts: fix fromAddress extraction for hiveGetPublicKey (returns
  publicKey not address); pass getPioneerApiBase() to buildTx
- rest-api.ts + swagger.json: GET /api/pioneer/status and POST /api/pioneer/url
  endpoints for switching Pioneer backend at runtime
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