Skip to content
LearnBitcoin

ResearchBitcoin Dev Archive lightning-dev list

Half-Delegation & Chaperones for Decker Channels

3 messages, Nov 29 to 30, 2021. Started by Jeremy Rubin.

Jeremy Rubin (2), ZmnSCPxj

Permalink First message in the Wayback Machine

Jeremy Rubin permalink original

Just a minor curiosity I figured was worth mentioning on the composition of delegations and anyprevout...

DA: Let full delegation be a script S such that I can sign script R and then R may sign for a transaction T. DB: Let partial delegation be a script S such that I can sign a tuple (script R, transaction T) and R may sign T.

A simple version of this could be done for scriptless multisigs where S signs T and then onion encrypts to the signers of R and distributes the shares. However, under such a model, if T is signed by S with AnyPrevOut, then T is now arbitrarily rebindable. Therefore let us define more strictly: DC: Let half-delegation be a script S such that I can sign a tuple (script R, transaction T) and R may sign T and revealing T/R does grant authorization to any other party.

The signer of R could choose to sign with APO, in which case they make the txn rebindable. They could also reveal the private keys for R similarly. For "correct" use, R should sign with SIGHASH_ALL, binding the transaction to a single instance.

Observation: a tuple script R + transaction T can, in many cases, be
represented by script R || <H(transaction T)> CTV.
Corollary: half-delegation can be derived from full delegation and a
covenant.

Therefore delegation + CTV + APO may be sufficient for making chaperone signatures work, if they are desired by a user.

Remarks:

APO's design discussion should not revisit Chaperone signatures (hopefully already a dead horse?) but instead consider how APO might compose with Delegation proposals and CTV.

ZmnSCPxj in reply to Jeremy Rubin permalink original

Good morning Jeremy,

Quoted text (6 lines)
> Just a minor curiosity I figured was worth mentioning on the composition of delegations and anyprevout...
>
> DA: Let full delegation be a script S such that I can sign script R and then R may sign for a transaction T.
> DB: Let partial delegation be a script S such that I can sign a tuple (script R, transaction T) and R may sign T.
>
> A simple version of this could be done for scriptless multisigs where S signs T and then onion encrypts to the signers of R and distributes the shares.

Just to be clear, do you mean, "for the case where R is a scriptless multisig"? And, "onion encrypts the signature"?

Since part of the signature `(R, s)` would be a scalar modulo k, `s`, another way would be to SSS that scalar and distribute the shares to the R multisig signers, that may require less computation and would allow R to be k-of-n.

Quoted text (5 lines)
> However, under such a model, if T is signed by S with AnyPrevOut, then T is now arbitrarily rebindable.
>
> Therefore let us define more strictly:
>
> DC: Let half-delegation be a script S such that I can sign a tuple (script R, transaction T) and R may sign T and revealing T/R does grant authorization to any other party.

Do you mean "does *not* grant"?

If S is a delegator that intends to delegate to R, and creates a simple Taproot with keypath S, and signs a spend from that using `SIGHASH_ANYPREVOUT` and distributes shares of the signature to R, then once the signature is revealed onchain, anyone (not just R) may rebind the transaction to any other Taproot with keypath S, which I think is what you wish to prevent with the stricter definition "does *not* grant authorization to any other party"?

Quoted text (3 lines)
>
> The signer of R could choose to sign with APO, in which case they make the txn rebindable. They could also reveal the private keys for R similarly.
> For "correct" use, R should sign with SIGHASH_ALL, binding the transaction to a single instance.

Well, for the limited case where R is a k-of-n multisig (including n-of-n) it seems the "sign and SSS" would work similarly, for "correct" use R should sign with `SIGHASH_ALL` anyway, so in the "sign and SSS" method S should always sign with `SIGHASH_ALL`.

This does not work if the script S itself is hosted in some construction that requires `SIGHASH_ANYPREVOUT` at the base layer, which I believe is what you are concerned about? In that case all signers should really give fresh pubkeys, i.e. no address reuse.

Quoted text (4 lines)
> Observation: a tuple script R + transaction T can, in many cases, be represented by script R || <H(transaction T)> CTV.
> Corollary: half-delegation can be derived from full delegation and a covenant.
>
> Therefore delegation + CTV + APO may be sufficient for making chaperone signatures work, if they are desired by a user.

Hmm what? Is there some other use for chaperone signatures other than to artificially encumber `SIGHASH_ANYPREVOUT` or have definitions drifted over time?

Quoted text (3 lines)
> Remarks:
>
> APO's design discussion should not revisit Chaperone signatures (hopefully already a dead horse?) but instead consider how APO might compose with Delegation proposals and CTV.

no chaperones == good

Regards, ZmnSCPxj

Jeremy Rubin in reply to ZmnSCPxj permalink original

Hi zmnscpxj,

Quoted text (2 lines)
>
>> Just a minor curiosity I figured was worth mentioning on the composition

of delegations and anyprevout...

Quoted text (2 lines)
>>
>> DA: Let full delegation be a script S such that I can sign script R and

then R may sign for a transaction T.

Quoted text (1 line)
>> DB: Let partial delegation be a script S such that I can sign a tuple

(script R, transaction T) and R may sign T.

Quoted text (2 lines)
>>
>> A simple version of this could be done for scriptless multisigs where S

signs T and then onion encrypts to the signers of R and distributes the shares.

Quoted text (4 lines)
>
>Just to be clear, do you mean, "for the case where R is a scriptless
multisig"?
>And, "onion encrypts the signature"?

No. Let's suppose that R = 2 of 3 {a,b,c}.

S signs T. S distributes enc(a, enc(b, T)), enc(a, enc(c, T)), and enc(b, enc(c, T)) and then R can 'sign' by decrypt and broadcast (of course you have an FLP issue here, but let's ignore that for now).

This is a "scriptless multisig with onion encryption" in this context.

Note: you don't have to encrypt T, just the witness to T technically.

Quoted text (4 lines)
>Since part of the signature `(R, s)` would be a scalar modulo k, `s`,
another way would be to SSS that scalar and distribute the shares to the R
multisig signers, that may require less computation and would allow R to be
k-of-n.

Yep that works too! There are a lot of different things S can do here, was just giving the simplest "it works" version v.s. focusing on efficiency.

Quoted text (1 line)
>> However, under such a model, if T is signed by S with AnyPrevOut, then T

is now arbitrarily rebindable.

Quoted text (4 lines)
>>
>> Therefore let us define more strictly:
>>
>> DC: Let half-delegation be a script S such that I can sign a tuple

(script R, transaction T) and R may sign T and revealing T/R does grant authorization to any other party.

Quoted text (2 lines)
>
>Do you mean "does *not* grant"?

Yes absolutely, that was a typo.

Quoted text (7 lines)
>If S is a delegator that intends to delegate to R, and creates a simple
Taproot with keypath S, and signs a spend from that using
`SIGHASH_ANYPREVOUT` and distributes shares of the signature to R, then
once the signature is revealed onchain, anyone (not just R) may rebind the
transaction to any other Taproot with keypath S, which I think is what you
wish to prevent with the stricter definition "does *not* grant
authorization to any other party"?

Correct.

Quoted text (2 lines)
>>
>> The signer of R could choose to sign with APO, in which case they make

the txn rebindable. They could also reveal the private keys for R similarly.

Quoted text (1 line)
>> For "correct" use, R should sign with SIGHASH_ALL, binding the

transaction to a single instance.

Quoted text (5 lines)
>
>Well, for the limited case where R is a k-of-n multisig (including n-of-n)
it seems the "sign and SSS" would work similarly, for "correct" use R
should sign with `SIGHASH_ALL` anyway, so in the "sign and SSS" method S
should always sign with `SIGHASH_ALL`.

Correct.

Quoted text (5 lines)
>This does not work if the script S itself is hosted in some construction
that requires `SIGHASH_ANYPREVOUT` at the base layer, which I believe is
what you are concerned about?
>In that case all signers should really give fresh pubkeys, i.e. no address
reuse.

I don't think so? Not sure what you mean here.

Quoted text (1 line)
>> Observation: a tuple script R + transaction T can, in many cases, be
represented by script R || <H(transaction T)> CTV.
Quoted text (1 line)
>> Corollary: half-delegation can be derived from full delegation and a

covenant.

Quoted text (2 lines)
>>
>> Therefore delegation + CTV + APO may be sufficient for making chaperone

signatures work, if they are desired by a user.

Quoted text (5 lines)
>
>Hmm what?
>Is there some other use for chaperone signatures other than to
artificially encumber `SIGHASH_ANYPREVOUT` or have definitions drifted over
time?
I don't know; but they are interesting. Of course you can just always write
a script like `<1||pk> checksig <chap_pk> checksig`, but where this is
unique is that you can accomplish post-hoc chaperoning which lets you
dynamically pick/rotate keys, for example.
Quoted text (3 lines)
>> Remarks:
>>
>> APO's design discussion should not revisit Chaperone signatures

(hopefully already a dead horse?) but instead consider how APO might compose with Delegation proposals and CTV.

Quoted text (2 lines)
>
>no chaperones == good

:)