Skip to content

fix: use actual P2PK input size for dust - #1095

Open
KeenHero wants to merge 1 commit into
kaspanet:masterfrom
KeenHero:agent/fix-p2pk-dust-size
Open

KeenHero wants to merge 1 commit into
kaspanet:masterfrom
KeenHero:agent/fix-p2pk-dust-size

Conversation

@KeenHero

Copy link
Copy Markdown

Summary

Use Kaspa's actual 118 byte serialized P2PK input size in wallet dust calculations.

Root cause

The wallet inherited Bitcoin's combined 148 byte output and input estimate, then added the Kaspa output size again. This overestimated the cost of spending a P2PK output and raised the dust threshold.

Impact

Wallet dust checks now use the 36 byte outpoint, 8 byte signature length, 66 byte signature script, and 8 byte sequence. A boundary regression test covers the resulting threshold.

Fixes #750.

Validation

cargo test -p kaspa-wallet-core p2pk_dust_threshold_uses_actual_input_size

@KeenHero
KeenHero marked this pull request as ready for review August 14, 2026 11:37
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.

Why is the minimum p2pk input script size 148 bytes and not 118 or 170?

1 participant