mempool: reject bare multisig outputs with invalid public keys #2641
All Vouch review confidence checks passed
Residual risk 0.25 = Change Risk (0.46) × (1 − Review Confidence (0.45)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.46 · 255 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.332
Real PR Conversation Timeline
1 comments
"Review active on #2641"
general
weight: 0.35
allocz
Change Description
extractMultisigScriptDetailscounts every push or non-small-int opcode as apublic key, even when it is not a valid key encoding. Outputs such as
OP_1 <20 bytes> OP_1 OP_CHECKMULTISIGare therefore classified as standardmultisig and relayed by btcd, although they can never be spent.
Bitcoin Core's
Solveronly matches multisig when every key is a data pushwhose size matches its header byte (
CPubKey::ValidSize), so Core rejectsthese outputs with
scriptpubkey.This applies the same check in
checkPkScriptStandard.txscriptis notchanged, so script classification and address extraction behave as before;
only mempool policy changes. Hybrid-size keys (0x06/0x07) stay standard, as in
Core.
I found this while comparing btcd's standardness rules against Bitcoin Core
31.1
testmempoolaccepton regtest.Steps to Test
The new cases (20-byte push, 520-byte push, non-push opcode, 0x05 header,
compressed header with 65 bytes) fail without the policy change; the
uncompressed and hybrid-size cases stay standard.
Pull Request Checklist
Testing
Code Style and Documentation