Skip to content
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

interactive-tx: Add dual-funding flow, using the interactive tx protocol (feature 28/29) #851

Merged
merged 21 commits into from
Feb 13, 2024

Commits on Nov 2, 2023

  1. Configuration menu
    Copy the full SHA
    998b789 View commit details
    Browse the repository at this point in the history
  2. interactive-tx: Add dual-funding flow, using the interactive tx protocol

    This commit adds the interactive transaction construction protcol, as
    well as the first practical example of using it, v2 of channel
    establishment.
    
    Note that for v2 we also update the channel_id, which now uses the hash
    of the revocation_basepoints. We move away from using the funding
    transaction id, as the introduction of RBF* makes it such that a single
    channel may have many funding transaction id's over the course of
    its lifetime.
    
    *Later, also splicing
    niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    7f57338 View commit details
    Browse the repository at this point in the history
  3. v2 opens: add a tx_abort message

    Requested-by: @t-bast
    niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    6ce7491 View commit details
    Browse the repository at this point in the history
  4. Clarify RBF funding requirements

    t-bast authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    11b8451 View commit details
    Browse the repository at this point in the history
  5. Use signed amounts in RBF messages

    While dual funding only needs unsigned funding amounts, other protocols
    that leverage interactive-tx may use signed funding amounts, for example
    to take funds out of an existing channel (splice-out).
    
    It is thus more future-proof to use signed amounts in `tx_init_rbf` and
    `tx_ack_rbf`.
    t-bast authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    a810c67 View commit details
    Browse the repository at this point in the history
  6. peer-protocol: send first+second commit point in openchanv2 + accept

    Repeat the second commit point in the initial openchannel2 +
    acceptchannel2 messages.
    
    Suggested-By: @pm47
    niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    0749591 View commit details
    Browse the repository at this point in the history
  7. v2 opens: proposal to get rid of the minimum estimated fee

    Prior versions of the v2 dual-funding protocol assumed a 'minimum fee'
    payment for any witness stack of any input, as a way to simplify fee
    checks.
    
    The suggested min feerate didn't make sense for taproot spend paths etc;
    instead we remove this check entirely.
    niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    4caa100 View commit details
    Browse the repository at this point in the history
  8. Add require_confirmed_inputs TLV

    This lets any side of the protocol require the other side to use confirmed
    inputs, to avoid paying the fees of a low feerate unconfirmed ancestor.
    t-bast authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    c2ac8a7 View commit details
    Browse the repository at this point in the history
  9. Add section about liquidity griefing

    This issue is non-trivial and worth mentioning, otherwise implementations
    may forget to handle this which would result in an easy way of attacking
    node's on-chain liquidity, creating a large opportunity cost.
    t-bast authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    c5f3c75 View commit details
    Browse the repository at this point in the history
  10. Store state when sending commitment_signed

    If we only store state when sending `tx_signatures`, there are cases where
    we cannot reconcile states if a disconnection occurs during the signing
    steps: one side will have sent `tx_signatures` and thus must wait for the
    transaction to be spent or double-spent, while the other side has already
    forgotten that channel because they haven't sent `tx_signatures`.
    
    This is fixed by storing state when sending `commitment_signed`, and
    adding a `next_funding_txid` field to `channel_reestablish` to ask our
    peer to retransmit signatures that we haven't received.
    t-bast authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    36c04c8 View commit details
    Browse the repository at this point in the history
  11. Use bitcoin wire encoding for witnesses

    dunxen authored and niftynei committed Nov 2, 2023
    Configuration menu
    Copy the full SHA
    c33cdc8 View commit details
    Browse the repository at this point in the history

Commits on Nov 10, 2023

  1. Configuration menu
    Copy the full SHA
    9f85945 View commit details
    Browse the repository at this point in the history
  2. Bolt 2: Make interactive-tx explicitly use SIGHASH_ALL

    This was previously assumed but adding it to the spec makes it explicit, should we ever want to change it in the future.
    
    Suggested-By: @morehouse
    ddustin authored and niftynei committed Nov 10, 2023
    Configuration menu
    Copy the full SHA
    d705522 View commit details
    Browse the repository at this point in the history

Commits on Nov 20, 2023

  1. tx-abort: port over meaning of the data field from warning

    `tx_abort`'s structure comes from the `warning`/`error` messages,
    but we failed to port over the rationale/rules for the `data` field.
    
    Suggested-By: @morehouse
    niftynei committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    e5b2677 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5edaaa6 View commit details
    Browse the repository at this point in the history
  3. nit: verbiage + wording

    Suggested-By: @morehouse
    niftynei committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    820852e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    e73ce64 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    5185bd0 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    afc4c72 View commit details
    Browse the repository at this point in the history
  7. dual-fund, verbiage: clarify situation for closing a underfunded channel

    Moved up some rationale from the Rationale section and added a
    bit of clarification to when you'd want to close/cancel an open.
    
    Reported-By: @morehouse
    niftynei committed Nov 20, 2023
    Configuration menu
    Copy the full SHA
    024df99 View commit details
    Browse the repository at this point in the history

Commits on Dec 13, 2023

  1. dual-fund: add require_confirmed_inputs to RBF messages

    Make `require_confirmed_inputs` explicit for RBF regnegotiation.
    
    Requested-By: @t-bast
    niftynei committed Dec 13, 2023
    Configuration menu
    Copy the full SHA
    27ffef4 View commit details
    Browse the repository at this point in the history