Repository navigation
[Tracking] QR miniscript + SP + Musig + ... - #214
Draft
pythcoiner wants to merge 27 commits into
Draft
pythcoiner wants to merge 27 commits into
pythcoiner wants to merge 27 commits into
Conversation
… refuse two keys on one path Bump libwally to add "psbt: reject key-path signing with a non-internal key" and "psbt: do not gate script-path signing on the key-path lookup" on top of 501b204e. Without the latter, an input whose key path is already signed gets no leaf signature: libwally stops looking up the taproot leaf keys once PSBT_IN_TAP_KEY_SIG is present. An input whose PSBT_IN_TAP_BIP32_DERIVATION entries name two keys on one of our derivation paths refuses the whole PSBT before anything is signed.
…lds, recovery keys included master's own-keys matching already signs a Liana spend with our primary and recovery keys; these tests pin it down, and that a keypath on the other primary chain does not claim the script.
…les 4, 6 and no blocks
…w hex-encoded parts in the QR viewer
… its Rust staticlib
…or under several aliases
…r bipqr, under aliases
… read under the descriptor, captioned with its alias and path
… request's inputs and change under the aliases it names
…d with other signers A PSBT with silent payment outputs gets the seed's ECDH shares and DLEQ proofs, global when it holds every eligible input, per input otherwise. Once the shares cover every eligible input the output scripts are derived; until then the review shows the amounts and adds the shares alone. Our silent payment inputs, change and self-transfers are classified, reviewed and signed.
BIP375 has every input of a silent payment send signed with SIGHASH_ALL. A PSBT with silent payment outputs and an explicit PSBT_IN_SIGHASH_TYPE other than SIGHASH_ALL, SIGHASH_DEFAULT included, is refused at parse time; an input naming no sighash type is signed with SIGHASH_ALL, the field removed again after the signing pass.
Get Keys answers a private key only on the BIP352 scan branch, m/352'/coin'/0'/1'/*, so a wallet can scan for the account's payments; any other private key is refused with 0x0C. The confirmation says what the scan key reveals, and the encoded response is wiped once shown.
…r requests name alone Register Descriptor takes FORM 0x03 silent payment keys: our spend key with our scan key, or with a scan key that is not ours. The alias is stored on flash as a record the seed marks, listed in the session descriptors settings beside the descriptors, and named alone by later Address Verification and Signing requests. Address Verification answers the account's base or labelled sp address, captioned with its alias and label; Signing takes the account, a FORM 0x03 body or our own sp() descriptor, and change paying our spend key under a scan key not ours is ours. Get Info advertises silent payment accounts.
Unregister Descriptor also removes a silent payment account alias and its record on flash, once the user confirms the alias, our fingerprint, our spend key path and whether the scan key is external.
A Signing request for a silent payment send is no longer refused. The response carries Kern's ECDH shares and DLEQ proofs beside its signatures, and only the shares while another signer still owes one; a signed PSBT leaves out the scripts of the silent payment outputs still pending. Get Info advertises silent payment sends, so CAPABILITIES is 0x7F.
A musig() is taken as the tr() internal key and inside tapscript leaves, where it is rewritten into the key it stands for before libwally parses it and written back as it came. Its participants are the BIP138 backup's recipients, and a registry input or output whose script a musig() of ours generates is claimed as CLAIM_MUSIG.
Round 1 stores a new session of the nonce cache BIP draft and adds our public nonce to each of our MuSig2 signatures, with no signature of any kind. Round 2 takes the session, deleted durably before any partial signature is written, and signs each one every participant's nonce is in for, the tr() internal key on the key path and a leaf musig() on its leaf, keyed as BIP-373 keys them. The sessions live in NVS through the bip_nonces_cache C binding and a device wipe erases them. A PSBT naming a nonce cache session is refused: signing from one is the nonce cache capability.
…res, advertising MuSig2 A musig() descriptor body is taken and a Signing request's PSBT is checked for its MuSig2 step before the user is asked: a missing, consumed or mismatched session answers 0x0D, a PSBT waiting for another participant's nonce with nothing else of ours to sign 0x09, and a PSBT naming a nonce cache session 0x0F, Kern not advertising the nonce cache. Our public nonces and partial signatures are returned as SIG_KIND 0x04 and 0x05. CAPABILITIES gains bit 7 (0xFF).
A PSBT naming a nonce cache session (PSBT_GLOBAL_NONCE_CACHE_SESSION) is signed in one round from the session it names: the reference must match the one the session holds, a nonce of one of our participant keys the session did not prepare answers a session error, and the session is taken, deleted durably before any partial signature is written. Issuance creates or extends a session and returns the public nonces of the key at a path, for the Nonce Preparation request to answer with.
…dvertising the nonce cache A Nonce Preparation request (TYPE 0x06) is answered with the public nonces of our key at its path, from the session it names or a new one whose ID is drawn when it names none. An optional descriptor must hold that key as a participant of one of its musig(). A missing or mismatched session answers 0x0D. CAPABILITIES gains bit 8 (0x1FF).
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a tracking PR that mirror the advancement of my work, not expected to be merged as is, all changes are expected to be backported to master scoped PRs
Fixes:
UI:
Tests:
Features: