-
Notifications
You must be signed in to change notification settings - Fork 407
[Experimental] Generic Commitment Transaction Output - WIP DLC support #619
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
InboundGenericOutput abstracts state transition from the output type. Actually, we only support HTLC-style of output as contract on our commitment transaction. Adding a generic trait to mask state transition allow us to operate on a generic output, and therefore to plug new output with their own non-LN-standard scripts. Implement InboundGenericOutput for InboundHTLCOutput. New interface is only used in next commit.
Using InboundGenericOutput in channel abstract specific attributes of output and need to be mask at serialization.
We now realize every state transaction by calling appropriated method. Concretness of HTLC still leak in some part, waiting for abstracting OutboundHTLCOutput or refactoring.
New type of commitment payload corresponding to a Contract Execution Transaction.
OutboundGenericOutput abstracts state transition from the output type. Actually, we only support HTLC as contract payload on our commitment transaction. Adding a generic trait to mask state transition allow us to operate on a generic output, and therefore to plug new paylod with their own non-LN-standard scripts. Implement OutboundGenericOutput for OutboundHTLCOutput. New interface is only used in next commit.
We now realize every state transition by calling appropriated method. Concretness of HTLC still leak in some part, waiting for abstracting build_commitment_transaction.
DLC update flow differ from HTLC and reqquires one more round to give back CET's sigs to initiator. Authored-by: Nadav Kohen <[email protected]>
ChannelMessageHandler is extended to support DLC message processing (UpdateAddDLC, UpdateCounterSignDLC, UpdateFulfillDLC). WIP: instead of extending ChannelMessageHandler with new messages we should add a new trait ChannelDLCMessageHandler and implement it for ChannelManager. We need custom messages support in peer_handler before. WIP: split further commit between new methods and peer_handler support. Authored-by: Nadav Kohen <[email protected]>
This message announces DLC to remote party to be included in next commitment_signed after reception of counter-signature.
Is the longer term goal to allow this to be something that can be provided by the developer rather than being in the RL crate? |
Yes, ideally a developer could specify the exact scripts and write the protocol using custom p2p messages.
… On Mar 23, 2021, at 06:52, Dev Random ***@***.***> wrote:
Is the longer term goal to allow this to be something that can be provided by the developer rather than being in the RL crate?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
This is pretty long out-of-date. Gonna go ahead and close but can obviously be re-opened if it gets picked back up again. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a starter work to support generic payload on the commitment transaction. It mostly switches InboundHTLCOutput/OutboundHTLCOutput behind InboundGenericOutput/OutboundGenericOutput traits. This is a headstart on #605
Adding Box in Channel on its performance decrease is yet to be confirmed as an approach but other approach explored were really counter-intuititive, specially for an implementator.
Thanks to @nkohen there is also new DLC messages and a DLC-compatible state machine flow in test_send_dlc.
Next steps:
update_countersign_dlc
update_fulfill_dlc
ChannelManager::send_dlc
Channel::build_commitment_transaction
orChannel::build_htlc_transaction