taproot-assets icon indicating copy to clipboard operation
taproot-assets copied to clipboard

[tracking]: Ensure AuxFundingController functionality meets tap deliverables / needs

Open dstadulis opened this issue 10 months ago • 4 comments

https://github.com/lightningnetwork/lnd/pull/8622 Adds AuxFundingController functionality to lnd and relies on a new MsgRouter to intercept messages passed over the wire for use in processing/arbitrating tap channel state.

Editable deliverable list tapd would need

  • [ ]

Design implementation commentary:

idea is we pass in AuxFundingController at the top level, it implements MsgEndpoint, so it can handle processing the tx_asset_proof messages so given an external pending chan ID (kinda like the FundingStateStep stuff), it'll process all that and arrive at the top level commitment needed then once open+accept chan come, we use that pending chan ID to map to the blobs and stuff we need so that's now passed all the way down into the db, and the funding+commitment txn construction in that PR now I'll circle back to look at signing, rn no new sigs are sent, but if you set these values properly, both sides will now arrive at the "correct" funding output + commitment txn that'll hold the asset

dstadulis avatar Apr 05 '24 01:04 dstadulis

To address this issue, I think it's sufficient to concentrate on this type introduced in PR https://github.com/lightningnetwork/lnd/pull/8622 :

// 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
}

And then the question becomes: are those fields sufficient to setup a tap payment channel? I think the answer is yes. Do you agree @guggero ? Is there anything else we need to consider here?

ffranr avatar Apr 05 '24 12:04 ffranr

And then the question becomes: are those fields sufficient to setup a tap payment channel? I think the answer is yes. Do you agree @guggero ?

Yes, I think answering that question by implementing the MsgRouter and AuxFundingController is the main task of this issue.

guggero avatar Apr 05 '24 12:04 guggero

And then the question becomes: are those fields sufficient to setup a tap payment channel? I think the answer is yes. Do you agree @guggero ?

Yes, I think answering that question by implementing the MsgRouter and AuxFundingController is the main task of this issue.

Oh I thought this issue was about checking that the AuxFundingController setup was flexible enough for tap. Rather than the actually implementing for tap. Ah I think you want to check by implementing.

ffranr avatar Apr 05 '24 13:04 ffranr

I've unassigned myself. There is nothing for me to do here. Oli is writing the code for this issue.

ffranr avatar Apr 11 '24 12:04 ffranr

Fixed by https://github.com/lightningnetwork/lnd/pull/8622 and https://github.com/lightningnetwork/lnd/pull/8632.

guggero avatar May 27 '24 15:05 guggero