Skip to content

fix: return signable_payload from to_bytes for unsigned transactions#220

Merged
lcovar merged 1 commit intomasterfrom
BTC-3161/fix-unsigned-extrinsic-format
Mar 19, 2026
Merged

fix: return signable_payload from to_bytes for unsigned transactions#220
lcovar merged 1 commit intomasterfrom
BTC-3161/fix-unsigned-extrinsic-format

Conversation

@lcovar
Copy link
Contributor

@lcovar lcovar commented Mar 19, 2026

Make to_bytes() for unsigned DOT transactions return signable_payload() instead of a standard V4 extrinsic. The signing payload format (call_data | era | nonce | tip | extensions | additional_signed) matches what legacy BitGoJS produces via construct.signingPayload(), preserving nonce readback in bgms.

Key changes:

  • Transaction::new() constructor for builder-created transactions (no raw extrinsic bytes stored)
  • to_bytes() unsigned path calls signable_payload() instead of returning raw_bytes
  • parse_extrinsic() detects signing payload format (no compact length prefix or version byte) and parses call_data using metadata type registry, then extracts era/nonce/tip from signed extensions
  • Removed build_unsigned_extrinsic() from builder (no longer needed)

BTC-3161

@lcovar lcovar requested a review from a team as a code owner March 19, 2026 20:08
@lcovar lcovar force-pushed the BTC-3161/fix-unsigned-extrinsic-format branch from 793b938 to 84ffe49 Compare March 19, 2026 20:16
Make to_bytes() for unsigned DOT transactions return signable_payload()
instead of a standard V4 extrinsic. The signing payload format
(call_data | era | nonce | tip | extensions | additional_signed) matches
what legacy BitGoJS produces via construct.signingPayload(), preserving
nonce readback in bgms.

Key changes:
- Transaction::new() constructor for builder-created transactions
  (no raw extrinsic bytes stored)
- to_bytes() unsigned path calls signable_payload() instead of
  returning raw_bytes
- parse_extrinsic() detects signing payload format (no compact length
  prefix or version byte) and parses call_data using metadata type
  registry, then extracts era/nonce/tip from signed extensions
- Removed build_unsigned_extrinsic() from builder (no longer needed)

BTC-3161
@lcovar lcovar force-pushed the BTC-3161/fix-unsigned-extrinsic-format branch from 84ffe49 to 9872edf Compare March 19, 2026 20:28
@lcovar lcovar enabled auto-merge March 19, 2026 20:46
@lcovar lcovar merged commit 2a6ec45 into master Mar 19, 2026
13 checks passed
@lcovar lcovar deleted the BTC-3161/fix-unsigned-extrinsic-format branch March 19, 2026 20:48
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.

2 participants