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.
This commit is contained in:
Olaoluwa Osuntokun 2024-04-04 17:25:09 -07:00 committed by Oliver Gugger
parent b3223048de
commit 7d86894634
No known key found for this signature in database
GPG Key ID: 8E4256593F177720

View File

@ -31,6 +31,7 @@ import (
"github.com/lightningnetwork/lnd/lnwallet/chanvalidate"
"github.com/lightningnetwork/lnd/lnwire"
"github.com/lightningnetwork/lnd/shachain"
"github.com/lightningnetwork/lnd/tlv"
)
const (
@ -89,6 +90,33 @@ func (p *PsbtFundingRequired) Error() string {
return ErrPsbtFundingRequired.Error()
}
// AuxFundingDesc stores a series of attributes that may be used to modify the
// way the channel funding occurs
type AuxFundingDesc struct {
// CustomFundingBlob is a custom blob that'll be stored in the database
// within the OpenChannel struct. This should represent information
// static to the channel lifetime.
CustomFundingBlob tlv.Blob
// TapscriptRoot is the root of the tapscript tree that will be used to
// create the funding output.
TapscriptRoot chainhash.Hash
// CustomLocalCommitBlob is a custom blob that'll be stored in the
// first commitment entry for the local party.
CustomLocalCommitBlob tlv.Blob
// CustomRemoteCommitBlob is a custom blob that'll be stored in the
// first commitment entry for the remote party.
//
// TODO(roasbeef): have this just use the leaf fetcher?
CustomRemoteCommitBlob tlv.Blob
// InitAuxLeaves is the set of aux leaves that'll be used for the very
// first commitment state.
InitAuxLeaves CommitAuxLeaves
}
// InitFundingReserveMsg is the first message sent to initiate the workflow
// required to open a payment channel with a remote peer. The initial required
// parameters are configurable across channels. These parameters are to be