Liquidity is always provided by an on-chain transaction (channel open or splice), which can be triggered by:
- On-chain funds added by the wallet user.
- A lightning payment to the wallet user requiring additional liquidity.
Liquidity is always provided by an on-chain transaction (channel open or splice), which can be triggered by:
Bitcoin Core's coin selection algorithms optimizes mostly for the following metrics:
This doesn't match what liquidity providers need. Liquidity providers need to:
Lightning Address is a very popular protocol that brings UX improvements that users love. We'd like to provide those UX benefits without its privacy and security drawbacks.
As described here, the lightning address protocol requires payment senders to make an HTTP request to the recipient's domain owner. This has some inconvenient side effects:
Let's consider the following setup:
cltv_expiry_delta
for the blinded path:
cltv_expiry_delta
of every hopcltv_expiry_delta = 10
in the encrypted_recipient_data
for Ccltv_expiry_delta = 15
in the encrypted_recipient_data
for Dmin_final_expiry_delta
(let's use 5
)The current swap-in flow for Phoenix uses the following steps:
Representing message flows for lightning protocols is hard, because we're not using turn-based protocols: peers may be sending messages at the same time. It is very useful though to find a suitable way of representing protocol flows, to be able to discuss edge cases and implement the corresponding test cases.
The following diagram perfectly represents the fact that messages can be interleaved. There is no way to misinterpret it since Bolt 8 guarantees that messages are ordered. But it is hard for the reader to match a received message with the place where it was sent.
This gist details various splicing protocol flows as they are currently implemented in eclair
.
We detail the exact flow of messages for each scenario, which should help the review process.
We call "active commitments" the set of valid commitment transactions to which updates (update_add_htlc
, update_fulfill_htlc
, update_fail_htlc
, update_fail_malformed_htlc
, update_fee
) must be applied.
While a funding transaction is unconfirmed, updates must be valid for all active commitments.
When using the interactive-tx
protocol, we currently store the channel state only after we've sent tx_signatures
.
This makes sense from a funds safety point of view: the commitment transactions can only be broadcast once we've given our peer the signatures they needed to broadcast the funding transaction first.
But in some cases, this creates an issue where one side has stored the channel state but not the other side. See the following scenario for example (where -->X
indicates a message that wasn't received):
Alice Bob
| |
This document contains sample fee-bumping scenarios used by lightning nodes to replace a malicious commitment transaction. Commitments transactions in these test cases don't pay any fees. The fee-bumping child (the anchor transaction) spends from one or more commitment transactions and an unrelated wallet transaction (used to add funds).
The actual tests implementing this can be found here.