Skip to content

feat(canton): implement getSignablePayload override for EdDSA extended payload#8337

Draft
derranW26 wants to merge 1 commit intomasterfrom
WP-8187-investigate-txintentmismatch-for-canton
Draft

feat(canton): implement getSignablePayload override for EdDSA extended payload#8337
derranW26 wants to merge 1 commit intomasterfrom
WP-8187-investigate-txintentmismatch-for-canton

Conversation

@derranW26
Copy link

Summary

Implements the upstream fix for Canton EdDSA signature verification by overriding getSignablePayload() in the Canton coin class to construct the proper extended payload format.

Problem

Canton's HSM must sign a structured payload containing transaction metadata concatenated with the signable hash, not just the hash alone. The base implementation was returning only the hash, causing signing/verification mismatches.

Solution

Override getSignablePayload() in Canton coin to:

  1. Parse the serialized transaction (base64 JSON)
  2. Extract the signable hash (preparedTransactionHash)
  3. Build extended payload based on transaction type:
    • WalletInitBuilder: [txnType (optional)] || itemCount || [lenOfTx || tx]... || signableHex
    • TransactionBuilder: itemCount || lenOfTx || preparedTransaction || signableHex

Impact

  • Eliminates duplicate payload construction logic across microservices
  • Provides single source of truth in BitGoJS for Canton extended payload format
  • Allows signing code to automatically use correct bytes
  • Enables microservices code simplification (remove 80+ lines)

Test Plan

  • TypeScript compilation succeeds
  • Unit tests for Canton coin
  • Integration tests for signing/verification flows

@derranW26 derranW26 force-pushed the WP-8187-investigate-txintentmismatch-for-canton branch 2 times, most recently from 5326d63 to d5c7249 Compare March 23, 2026 20:13
@derranW26 derranW26 force-pushed the WP-8187-investigate-txintentmismatch-for-canton branch from d5c7249 to 0621452 Compare March 23, 2026 20:39
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