AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 18 Bitcoin

Document that P2PKH weight assumes compressed public keys

Public commit record

What the developer wrote

Authored by auto-pr-bot

81/100 · Strong
Document that P2PKH weight assumes compressed public keys

@matt asked:

> @auto-pr-bot please "fix" this by simply updating the documentation to
> note that we require compressed public keys.

`Utxo::new_p2pkh` computes `satisfaction_weight` assuming a compressed
33-byte public key is pushed in the scriptSig. A P2PKH output committing
to an uncompressed 65-byte key needs 128 more weight units than budgeted,
which coin selection would not account for. Rather than overpaying 128
WU on every compressed-key input or changing the API to distinguish the
key form, note the compressed-key requirement in the rustdoc.

Fixes #5198

Requested-by: @matt
Link: https://git.rust-bitcoin.org/lightningdevkit/rust-lightning/issues/5198#issuecomment-462100
Authored-By: matt/GLM-5.3-Flash-GGUF:Q4_K_XL <goose@users.noreply.local>
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This commit only adds a documentation comment to a Rust helper function. It clarifies that the function's built-in fee estimate assumes a compressed public key, and should not be used with older uncompressed keys because the transaction fee estimate would be too low. No code behavior changes, so there is no direct exploit. The practical risk is that a developer who ignores the new warning could create a transaction with insufficient fees if they spend an uncompressed-key P2PKH output.

Recommended action

No immediate action required. Treat as a documentation improvement. Developers using `Utxo::new_p2pkh` should confirm they are spending compressed-public-key P2PKH outputs. If uncompressed keys must be supported, a separate fee-estimation path should be added.

Security signals we found

01

Documentation-only change

02

Clarifies an existing fee-estimation assumption

03

No code path or cryptographic change

04

Potential downstream misuse if documentation is ignored

Risk score

Why this scored 18/100

Our methodology →
Potential impact 2/30
Exploitability 1/25
Stealth signal 1/15
Affected reach 2/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.