Skip to content

Conversation

@OttoAllmendinger
Copy link
Contributor

Add utxolibCompat option to Dimensions to match @bitgo/unspents vSize
calculations. This allows exact fee estimation compatibility with the
legacy library by using 72-byte signatures instead of 73-byte max.

The implementation handles encoding differences like OP_PUSHDATA2 for
redeemScripts, which affects weight calculations and virtual sizes.

BTC-2908

@OttoAllmendinger OttoAllmendinger force-pushed the BTC-2908.fixes branch 2 times, most recently from 5984652 to 5eb516a Compare January 14, 2026 14:44
Adds compatibility mode to make input size estimates match @bitgo/unspents.
This allows wasm-utxo to produce the same transaction size estimates as
utxo-lib when needed, while still supporting accurate min/max bounds.

The key change is using 72-byte signatures for ECDSA inputs in compat mode
instead of 73-byte for the max calculation, which matches @bitgo/unspents
behavior. The implementation also replicates specific encoding choices
used in utxo-lib.

Issue: BTC-2908

Co-authored-by: llm-git <llm-git@ttll.de>
@OttoAllmendinger OttoAllmendinger marked this pull request as ready for review January 14, 2026 15:01
@OttoAllmendinger OttoAllmendinger requested a review from a team as a code owner January 14, 2026 15:01
@OttoAllmendinger OttoAllmendinger merged commit 8784335 into master Jan 14, 2026
5 checks passed
@OttoAllmendinger OttoAllmendinger deleted the BTC-2908.fixes branch January 14, 2026 16:29
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