BIP 89: Chain Code Delegation for Private Collaborative Custody#2004
BIP 89: Chain Code Delegation for Private Collaborative Custody#2004murchandamus merged 12 commits intobitcoin:masterfrom
Conversation
jonatack
left a comment
There was a problem hiding this comment.
Looks complete, labelling as needing number assignment.
|
@arminsabouri @jonatack thank you for taking the time to review! I've gone ahead and addressed your comments in |
af0ec04 to
c5aac26
Compare
|
thanks @jonatack! i think i got everything! |
|
Thanks for updating.
@jurvis can you help me out, please: Is this accurate? I'm trying to adapt our process and understanding. |
|
hi @jonatack, happy to help. does the scan run through the sample code as well? the sample code contains a lot of boilerplate that we leveraged LLMs to help us with, and may be the reason why it registers high. However, the contents of the mediawiki itself should be ~90% original. We leaned on LLM use in the mediawiki mostly to ensure that our formatting was aligned with existing conventions (heavily referencing BIP 340, BIP 352, BIP 32, and BIP 3), and to convert it from Markdown, which we had originally used to write our draft. For example, we wrote out our original one of the algorithms in the following format originally: Which we got ultimately turned into this, to align with how BIP 32 reads: Hope that helps. |
Gave it the BIP draft only. |
|
hi @jonatack just following up to see if there's anything I can do here to move things along. thanks! |
|
The inclusion of major parts of secp256k1lab in this form violates the (only) requirement in the MIT license under which secp256k1lab is distributed, see its COPYING file. |
|
A related editorial question is whether it's a good idea to include distributions of secp256k1lab in the BIPs repo. This question is relevant not only for this BIP draft but also for #2070 and for the ChillDKG draft BIP (no PR yet). We had raised that question in the context of ChillDKG over a year ago on the mailing list, specifically hoping to hear the opinion of the BIPs editors, but noone has commented so far: https://groups.google.com/g/bitcoindev/c/HE3HSnGTpoQ/m/Y2VhaMCrCAAJ (This post refers to the library as "secp256k1proto". This was our working title before we switched to "secp256k1lab" when publishing the code in a separate repo.) |
murchandamus
left a comment
There was a problem hiding this comment.
I gave the proposal draft a first read. I find myself somewhat confused as to the terms “Delegator and Delegatee”. The scenario I envisioned was one Delegatee and one or multiple Delegators, but at times it seems that maybe multiple Delegatees are in play. If that’s the case, it could perhaps be clarified what scenarios are covered and how multiple Delegatees would collaborate.
I skipped some of the paragraphs of the Blinded Signing section.
@real-or-random: TBH, I don’t think I fully understand the trade-offs of the approaches you proposed. I would prefer that any software with on-going development were maintained outside of the BIPs repository, but maybe we could chat some time so that I better understand the situation. |
Let me try to simplify the discussion: If the BIP editors are okay with integrating a snapshot of secp256klab as a subtree in each "Snapshot" means that it is a static thing, and maintenance of secp256k1lab will, of course, happen in its repo. I guess the only reason to ever touch a snapshot subtree in the BIPs repo is to fix a secp256k1 bug that specifically affects the BIP code that uses the library (and even in that case, other ways to resolve the overall issue could be considered). |
That seems reasonable to me, as it ensures that a functional reference implementation is retained in the context of the BIPs. The only concern that comes to mind would be that we might get more pull requests by LLM-commit farmers on those, but I guess we’d just have to filter those. |
|
@murchandamus Thanks for the detailed review, I will revise accordingly. I agree that delegatee/delgator is confusing, but I'm not sure what the better terminology is. @real-or-random I'll make sure to include the copyright and permission notice which I believe will satisfy the license requirements for secp256k1lab. |
Yep, thanks, and no offense, by the way. :) I just think it's good practice to keep licenses with the code. It helps everyone later on. I suggest just including the existing COPYING file. And I think it would also be very useful to future readers of the BIP to note somewhere from which commit the files are taken, (e.g., have a sentence in the BIP, in some README file, or added to the top of the COPYING file) such as |
|
Hopefully the last comment on the secp-library discussion in your PR: Let’s continue that conversation in #1855 |
- Upgrade vendored secp256k1lab to commit a265da1 (adds type annotations) - Add COPYING file to satisfy MIT license requirements - Document secp256k1lab commit reference in BIP text
- Fix TweakContext to use Scalar types for gacc/tacc - Replace HashFunction enum with Callable type alias - Fix bytearray to bytes conversion in blind_sign - Move imports to top of file - Fix boolean comparison style (use 'not' instead of '== False') - Add proper type annotations and casts for dict handling - Remove unused imports and type ignore comments
- Add intro explaining delegation naming (chain code is delegated, not signing authority) - Reorder terminology to list Delegator before Delegatee - Replace "quorum" with clearer "can co-sign for UTXOs" language - Clarify derivation constraints in terms of delegatee's extended key - Rename "Delegatee Signing" section to "Signing Modes" - Fix "delegatee can apply" to "delegator can produce" (line 112) - Replace undefined "caller" with "delegatee" (line 173) - Clarify "Change outputs" to "Tweaks for change outputs" (line 98) - Add note that message is separate from CCD bundle - Add note on application-specific verification (addresses, amounts) - Add transition sentence clarifying non-concurrent protocol scope
- Change Type from 'Standards Track' to 'Specification' (valid type) - Change 'Created' to 'Assigned' (correct field name per BIP format) - Change 'Post-History' to 'Discussion' (recognized field in buildtable.pl)
|
Hi 👋 I'm coming over from reviewing the FROST PR. @siv2r pointed out to me that this proposal (along with MuSig2) share the semantics for tweaking protocol data structures and algorithms ("TweakContext", "ApplyTweak", "TweakCtxInit") . Do the authors have a strong opinion on the idea of working on a separate BIP that specifies those data structures, and then just reference those algorithms in this BIP - similar to how the FROST proposal delegates definitions to BIP340 to define schnorr signatures in it's writing. This work could be done yourselves - as the authors on this work have been pretty prolific in this space :-) - or delegated to other volunteers (such as myself, or maybe Sivaram if he has bandwidth) to execute on the idea. In summary 👍 or 👎 |
|
@jurvis, @jesseposner: Just so we don’t cross wires, my understanding is that y’all are still working on addressing review, and you’ll let us know here when you’re caught up. Also, please feel free to resolve any review that you feel has been addressed. |
Co-authored-by: Mark "Murch" Erhardt <[email protected]>
|
@murchandamus: All review items have now been addressed. I got an error when I tried to resolve the comments, but I posted the commit hash to show it has been resolved. |
|
@Christewart My bandwidth is limited, but I think it's a good idea and happy to support any efforts to make this happen. |
murchandamus
left a comment
There was a problem hiding this comment.
I just looked over the changes. They seem good to me. I marked the open review comments as resolved that seemed to have been addressed by the new commits.
I’ll assume that this is ready for publication, unless I hear otherwise. :)
|
@Christewart, I've been thinking about this TweakContext BIP idea. The scope would be small: just the data structure For downstream BIPs, the spec text could reference the TweakContext BIP instead of duplicating the algorithms. However, there's a challenge with reference code: if this BIP vendors secp256k1lab (needed for group operations), and downstream BIPs also vendor secp256k1lab for their own crypto, they'd end up with two copies. So downstream BIPs would likely just copy-paste the functions anyway, meaning this would only reduce BIP text duplication, not code duplication. A better approach might be treating this as an informational BIP (for people who aren't aware of this tweaking methodology) with reference code for demonstration, but without expecting downstream BIPs to import it. Additionally, we could add a I see three options: (A) create the informational BIP + add
If A seems like the way to go, I can raise a pull request to secp256k1lab for the P.S. Sorry for spamming this PR thread. Wasn't sure where else to post this comment. |
We propose a new BIP for Chain Code Delegation, a collaborative custody technique that involves privileged participants (delegatee) withholding BIP32 chain codes at key setup time from a delegator, and sharing only enough information for non‑privileged participants to provide their signature.
For non-blinded signing, the delegatee derives a per‑spend scalar tweak t from the (withheld) chain code, the delegator computes the child key (x+t, P+tG), and produces a standard signature over the transaction’s sighash. For blind signing, the nonce and challenge are blinded so the delegator returns a blind Schnorr signature that the counterparty unblinds; thanks to Schnorr’s linearity, the same tweak is incorporated without revealing the final message or linkable details (optionally with predicate proofs for policy).
This enables participants like collaborative custodians to co‑sign when needed, while avoiding the broad visibility that comes with holding an xpub.
More background and discussions can be found: https://delvingbitcoin.org/t/chain-code-delegation-private-access-control-for-bitcoin-keys/1837.
This is joint work with @jesseposner. Feedback appreciated!