Repository navigation
Conversation
Pull Request Test Coverage Report for Build 9513655947Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9519109524Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9528732501Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9528834149Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9528865705Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9528900206Details
💛 - Coveralls |
63f97ed to
8e879e1
Compare
Coverage Report for CI Build 43187535476Coverage increased (+0.8%) to 54.631%Details
Uncovered Changes
Coverage Regressions12 previously-covered lines in 2 files lost coverage.
Coverage Stats
💛 - Coveralls |
e4bb95c to
04ec8d7
Compare
|
The BIP-0373 PR was merged a while ago. I also rebased on latest master that has the Golang module fixes and addressed all TODOs. This is ready for review IMO. |
6fc877f to
c9f6407
Compare
|
@TechLateef thank you very much for the thorough review! I've addressed all your comments. |
sputn1ck
left a comment
There was a problem hiding this comment.
BIP-373 implementation review. Inline findings below.
c9f6407 to
0541026
Compare
b6c1164 to
e1f6af4
Compare
|
tACK e1f6af4: the BIP373 fields serialize byte for byte the way btclib-wallet's independent implementation does, in both directions. We checked whether a PSBT written by one implementation reads back unchanged in the other, and whether the MuSig2 sessions it carries still sign and finalize. Both hold for every case we tried. This tests interop, not the finalizer's code. Of BIP373's 24 vectors, both libraries re-serialize the 14 valid ones to identical bytes and reject the 10 invalid ones. We then ran full sessions on cases 1a to 4a twice: once signed by btcd through |
…loses #498) rust-psbt's vector files are vendored under tests/psbt/_data/rust-psbt/, each pinned at the tip of its path, and tests/psbt/rust_psbt_test.py runs every case by its task: parse or refuse, BIP174's Creator, Updater, Signer, Combiner, Finalizer and Extractor walk-through, and BIP370's lock time. A task it has no test for fails the module. Where rust-psbt's file and btclib-wallet part, the test says so. One case of bip371.json holds the hex in its base64 field and is xfail. rust-psbt's runner reads supplementary.psbts alone, so it parses none of the psbts that bip371.json and bip174.json keep under expected; the test reads both. bip375.json asks a parser to refuse BIP375's role failures, which btclib-wallet refuses in its silent payment roles: the test asks such a psbt to be one of BIP375's own invalid ones. The walk-through's Signer cases are signed without low-R grinding, as BIP174's example was. The psbts btcd's MuSig2 code signed (btcsuite/btcd#2198 at e1f6af43) from BIP373's participants-only vectors are vendored under tests/psbt/_data/btcd/ with btcd's ISC license and the Go program that made them. musig2_test.py reads each back byte for byte, checks btcd added only nonces and partial signatures to BIP373's psbt, verifies every partial signature, aggregates them and has the script engine accept the finalized spend. tests/_data/README.md records both provenances and the commands that redo them. The BIP174 entry points at rust-psbt's file for the walk-through, and psbt_test.py's comment about missing Updater tests points at the new module. .secrets.baseline takes the new files' keys and psbts, and pyproject.toml's typos table btcd's SignSuccesful. Closes #485 Closes #498 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: pmazzocchi <paolo@checksig.io>
…loses #498) rust-psbt's vector files are vendored under tests/psbt/_data/rust-psbt/, each pinned at the latest commit touching its path on rust-psbt's master at 51b0ea82. tests/psbt/rust_psbt_test.py runs every case by its task: parse or refuse, BIP174's Creator, Updater, Signer, Combiner, Finalizer and Extractor, and BIP370's lock time. A task it has no test for fails test_every_task_is_replayed. It reads a psbt both from supplementary.psbts and from expected, as rust-psbt's runner does at 51b0ea82, and no case is xfail. bip375.json asks a parser to refuse BIP375's invalid psbts. btclib-wallet's codec refuses those with a field of the wrong shape and its silent payment roles the rest, so the test asks a psbt the codec reads to be one of BIP375's own invalid ones. The Signer cases are signed without low-R grinding, as BIP174's example was. The psbts btcd's MuSig2 code (btcsuite/btcd#2198 at e1f6af43) signed from BIP373's participants-only vectors are vendored under tests/psbt/_data/btcd/, with btcd's ISC license and the Go program that made them. musig2_test.py reads each back byte for byte, checks that btcd added only nonces and partial signatures to the BIP373 psbt its description names, verifies every partial signature, aggregates them and has the script engine accept the finalized spend. tests/_data/README.md records both provenances and the commands that redo them. The BIP174 entry points at rust-psbt's file for the walk-through, and psbt_test.py's comment about missing Updater tests points at the new module. .gitattributes keeps the new JSON files' bytes as they are, .secrets.baseline takes their keys and psbts, and pyproject.toml's typos table takes btcd's SignSuccesful. Closes #485 Closes #498 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: pmazzocchi <paolo@checksig.io>
Allows other packages to use the ComputeSigningNonce function.
A MuSig2 signer needs the same facts the finalizer infers when combining partial signatures: the participants record to aggregate in, the key to record in the nonce and partial signature key data, the tweaks that turn the bare aggregate into the key the signature is checked against, and the message to sign. Until now that inference was private to the finalizer, so every signer would have had to re-implement it and could silently disagree with it. MuSig2SigningInfos exposes it for one participant of one input. It reuses the finalizer's BIP-328 derivation and taproot tweak helpers and only returns a context once the inferred tweaks reproduce the output key or the key found in the leaf script, so a signer following it produces partial signatures the finalizer can combine.
e1f6af4 to
f3d665a
Compare
|
reACK f3d665a Since e1f6af4 the branch was rebased on master. The only change to the PR's own lines is that it no longer adds the testify import, which master's psbt/utils_test.go now has. On this head |
Implements the new input and output fields to the PSBT library according to BIP-0373.