input: update all taproot script spends to optionally make the ctrl block
In this commit, we update all the taproot scripts spends to optionally make the control block. This is useful in cases where we've already created the control block, or may not have the items needed to construct it in the first place. We also add the control block to the sign descriptor itself.
This commit is contained in:
5 files changed
+354
-92
No files matched your search
@@ -98,6 +98,13 @@ type SignDescriptor struct {
|
||||
// This MUST be set when spending Taproot outputs.
|
||||
PrevOutputFetcher txscript.PrevOutputFetcher
|
||||
|
||||
// ControlBlock is a fully serialized control block that contains the
|
||||
// merkle proof necessary to spend a taproot output. This may
|
||||
// optionally be set if the SignMethod is
|
||||
// input.TaprootScriptSpendSignMethod. In which case, this should be an
|
||||
// inclusion proof for the WitnessScript.
|
||||
ControlBlock []byte
|
||||
|
||||
// InputIndex is the target input within the transaction that should be
|
||||
// signed.
|
||||
InputIndex int
|
||||
@@ -218,6 +225,8 @@ func WriteSignDescriptor(w io.Writer, sd *SignDescriptor) error {
|
||||
return err
|
||||
}
|
||||
|
||||
// TODO(roasbeef): also write ctrl block?
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user