Judge a key BIP341's H by the bytes it holds (closes #464) #483
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.39) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 246 lines diff across 3 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 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
Diff Size
diff_size
0.330
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #483"
general
weight: 0.35
fametrano
What this changes
_is_unspendableansweredkey.pub_key[1:33] == _UNSPENDABLE_X, which read abytessubclass through its own__getitem__. A key whose[1:33]answered H's x coordinate was taken for BIP341's H, sotr()andrawtr()of a key the wallet can sign for listed no key path. A__getitem__that raised madespending_pathsraise from this line.The slice is now taken from
_plain(key.pub_key), the copy the module already reads a key's bytes through. A changelog entry is inchangelog/next/.Closes #464
How it was verified
A test in
tests/descriptors/spending_paths_test.pybuilds an x-onlyKeyExpressionof 1G's even SEC from a subclass whose slices answer H's x, and from one whose slices raise. For each,TrDescriptorandRawTrDescriptorgive one key path, the same paths as the plain key. A control shows the overrides answer.| Check | Result |
| --- | --- |
| The new test on main 38dae92 | 2 failed: no path for the lying key,
RuntimeErrorfrom_is_unspendablefor the raising one || Same, on this branch | 2 passed |
|
uv run pytest| 8981 passed, 1792 skipped; coverage 100.00% ||
uv run --locked --only-group lint pre-commit run --all-files --show-diff-on-failure| exit 0 ||
uv run --locked --no-default-groups --group docs sphinx-build -n -W -b html docs/source docs/build/html| exit 0 ||
tests/descriptors/spending_paths_test.pyon CPython 3.11 | 138 passed |Checks
uv run pre-commit run --all-filesis clean (ruff, mypy strict,markdownlint, the copyright notice,
uv.lock)uv run pytestpassesanswer a review of it without the model
Anything the reviewer should know
The changelog file is named for pull request 483, the number I expect; if it gets another I will rename it in a second commit. I wrote this with AI assistance (Grok Bot). I have read the change and can answer for it.