Skip to content

[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
wants to merge 10 commits into from

Conversation

ariard
Copy link

@ariard ariard commented May 11, 2020

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:

  • support update_countersign_dlc
  • support update_fulfill_dlc
  • add ChannelManager::send_dlc
  • abstract some transactions builders such as Channel::build_commitment_transaction or Channel::build_htlc_transaction

Antoine Riard added 10 commits May 10, 2020 16:45
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.
@devrandom
Copy link
Member

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?

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Mar 23, 2021 via email

@TheBlueMatt
Copy link
Collaborator

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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants