Skip to content

Protocol for closing DLC by mutual consent #161

@matthewjablack

Description

@matthewjablack

The introduction specifies that in a DLC, contract collateral is locked in an output that can only be spent by mutual consent.

However, there is currently no protocol for requesting to close a DLC before cet_locktime with mutual consent.

Additionally, there are some concerns with requesting to close a DLC early. Say Alice wishes to exit her DLC early. Alice could simply provide a mutual close signature to Bob. However, if Bob does not respond this could result in a free option problem where Bob can simply wait for favorable market conditions and sign and broadcast when it is optimal for him.

After chatting with @nkohen it seems the simplest choices to solve this issue are invalidation or revocation (without going into the realm of verifiable encryption).

Invalidation could be solved by having Alice provide her own Input in addition to the DLC Input. If Bob doesn't respond after a certain amount of time, Alice could spend this input, invalidating this close tx.

A close_dlc Message could be formatted as following:

  1. type ??? (close_dlc_v0)
  2. data:
    • [32*byte:contract_id]
    • [signature:close_signature]
    • [u64:offerPayoutSatoshis]
    • [u64:acceptPayoutSatoshis]
    • [u16:num_funding_inputs]
    • [num_funding_inputs*funding_input:funding_inputs]

payout_spk and payout_serial_id from offer_dlc as well as payout_spk and payout_serial_id from accept_dlc could be used for constructing the close transaction

funding_inputs would be the input(s) provided by Alice that could be invalidated after a timeout.

Curious to hear if folks think this should be added to the spec. I personally think there are quite a few use cases for closing a DLC (such as requesting to close a position where a market maker is the counterparty).

This might also make more sense to add as an optional second layer interaction rather than to the core protocol.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions