Skip to content

Commit 75c9c8c

Browse files
committed
lnwallet: add new AuxFundingDesc struct
This struct will house all the information we'll need to do a class of custom channels that relies primarily on adding additional items to the tapscript root of the HTLC/commitment/funding outputs.
1 parent 236b1f6 commit 75c9c8c

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

lnwallet/wallet.go

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import (
3131
"github.com/lightningnetwork/lnd/lnwallet/chanvalidate"
3232
"github.com/lightningnetwork/lnd/lnwire"
3333
"github.com/lightningnetwork/lnd/shachain"
34+
"github.com/lightningnetwork/lnd/tlv"
3435
)
3536

3637
const (
@@ -89,6 +90,33 @@ func (p *PsbtFundingRequired) Error() string {
8990
return ErrPsbtFundingRequired.Error()
9091
}
9192

93+
// AuxFundingDesc stores a series of attributes that may be used to modify the
94+
// way the channel funding occurs
95+
type AuxFundingDesc struct {
96+
// CustomFundingBlob is a custom blob that'll be stored in the database
97+
// within the OpenChannel struct. This should represent information
98+
// static to the channel lifetime.
99+
CustomFundingBlob tlv.Blob
100+
101+
// TapscriptRoot is the root of the tapscript tree that will be used to
102+
// create the funding output.
103+
TapscriptRoot chainhash.Hash
104+
105+
// CustomLocalCommitBlob is a custom blob that'll be stored in the
106+
// first commitment entry for the local party.
107+
CustomLocalCommitBlob tlv.Blob
108+
109+
// CustomRemoteCommitBlob is a custom blob that'll be stored in the
110+
// first commitment entry for the remote party.
111+
//
112+
// TODO(roasbeef): have this just use the leaf fetcher?
113+
CustomRemoteCommitBlob tlv.Blob
114+
115+
// InitAuxLeaves is the set of aux leaves that'll be used for the very
116+
// first commitment state.
117+
InitAuxLeaves CommitAuxLeaves
118+
}
119+
92120
// InitFundingReserveMsg is the first message sent to initiate the workflow
93121
// required to open a payment channel with a remote peer. The initial required
94122
// parameters are configurable across channels. These parameters are to be

0 commit comments

Comments
 (0)