Skip to content

feat: enable Safe recovery for HBAR - #10038

Merged
pranishnepal merged 1 commit into
masterfrom
WCN-2897
Oct 22, 2026
Merged

pranishnepal merged 1 commit into
masterfrom
WCN-2897

Conversation

@pranishnepal

Copy link
Copy Markdown
Contributor

What

Enables Safe (slot-2 ed25519Multisig) recovery for HBAR and fixes the Safe
key-echo for HBAR and ALGO (WCN-2897).

  • HBAR cutover: Hbar.recover() now signs the backup child lazily via
    ExternalEd25519Signer over the built transaction's bodyBytes, replacing
    the pre-made externalBackupSignature hook (mirrors ALGO's feat: enable Safe recovery for ALGO #10012 cutover)
  • Mapper: hbar/thbar registered in ED25519_MULTISIG_COIN_ENCODERS;
    rootAddress omitted for HBAR (network-assigned account IDs) so the
    caller-supplied address survives param composition
  • Key echo: signed Safe recovery returns derived public keys
    (userKey/backupKey/bitgoKey/rootAddress) for HBAR and ALGO;
    legacy signed/unsigned paths unchanged
  • Integrity: signWithExternalEd25519Signer verifies against the
    original message bytes — a mutating signer can no longer alter the
    transaction body
  • Fail-fast: HBAR validates bitgoKey before any node query or signing

Ticket: WCN-2897

- Cut Hbar.recover() over to the lazy ExternalEd25519Signer, dropping
  the pre-made externalBackupSignature hook (mirrors the ALGO cutover)
- Register hbar/thbar in ED25519_MULTISIG_COIN_ENCODERS; omit rootAddres
  for HBAR since Hedera account IDs are network-assigned
- Echo derived public keys in signed Safe recovery for HBAR and ALGO,
  leaving legacy paths unchanged
- Fix external signer mutation: verify against the original message byte
- Validate bitgoKey before node queries and signing

Ticket: WCN-2897
@linear-code

linear-code Bot commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

WCN-2897

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Unit tests are failing on Node 26.x (Current release line, non-blocking). This is not an LTS version yet, so it does not block merge, but it signals an incompatibility to fix before Node 26.x becomes LTS.

View run

@pranishnepal
pranishnepal marked this pull request as ready for review October 22, 2026 20:29
@pranishnepal
pranishnepal requested review from a team as code owners October 22, 2026 20:29

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.

Tip: disable this comment in your organization's Code Review settings.

@pranishnepal
pranishnepal merged commit 32305d8 into master Oct 22, 2026
26 checks passed
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