Research/Bitcoin Dev Archive / lightning-dev list
Watchtower-Free Lightning Channels For Casual Users
8 messages, Oct 3 to Nov 2, 2022. Started by jlspc.
jlspc (4), Bastien TEINTURIER (3), David A. Harding
This is the first in a series of posts on ideas to improve the usability and scalability of the Lightning Network. This post presents a new channel protocol that allows casual users to send and receive Lightning payments without having to meet onerous availability requirements or use a watchtower service. This new Watchtower-Free (WF) protocol can also be used to simplify the reception of Lightning payments for casual users. No change to the underlying Bitcoin protocol is required.
A paper with a more complete description of the protocol, including figures, is available [5].
Properties ==========
The user-visible properties of the WF protocol can be expressed using two parameters: * I_S: a short time interval (e.g., 10 minutes) for communicating with peers, checking the blockchain, and submitting transactions to the blockchain, and * I_L: a long time interval (e.g., 1-3 months).
The casual user must be online for up to: * I_S every I_L (e.g., 10 minutes every 1-3 months) to safeguard the funds in their Lightning channel.
With the WF protocol, the latency for payments is unchanged from the current protocol, but the latency for getting a payment receipt from an uncooperative channel partner is increased. In addition, the casual user may have to pay their channel partner for the partner's cost of capital (which depends on I_L). If the casual user and their channel partner follow the protocol, the channel can remain off-chain arbitrarily long.
First Attempt: Use The Current Lightning Protocol =================================================
In order to motivate the new protocol, first consider what would happen if a casual user attempted to achieve the above properties with the current Lightning channel protocol. The casual user would set their "to_self_delay" (which controls how quickly their channel partner can receive funds from a transaction they put on-chain) and "cltv_expiry_delta" (which controls the staggering of timeouts between successive hops) parameters to values approaching I_L (because the casual user could be unavailable for nearly that long). This would create three problems:
* Problem 1: The casual user's proposed channel partner would likely reject the creation of the channel due to the excessive "to_self_delay" value.
* Problem 2: If a channel were created with these parameters, Lightning payments would not be routed through it due to the excessive "cltv_expiry_delta" value.
* Problem 3: If a channel were created with these parameters and if the casual user sent a payment on that channel, their partner could have to go on-chain in order to pull the payment from the casual user. In particular, the casual user could be offline for nearly I_L (e.g., 1-3 months) when their partner receives the receipt, thus forcing their partner to go on-chain to receive payment before the expiry of the associated HTLC.
The WF Protocol ===============
The WF protocol solves these problems by modifying the Lightning protocol as follows:
* Problem 1 is solved by having the casual user pre-pay their channel partner for the cost of the partner's capital that's tied up in the channel due to the very large "to_self_delay" value. This pre-payment is included in the initial channel state and is updated at least once every I_L to reflect the additional cost of capital due to the partner not yet going on-chain.
* Problem 2 is solved by allowing casual users to designate themselves as Casual-Lightning-Users (CLUs), while the remaining users are Dedicated-Lightning-Users (DLUs). CLUs can only partner with DLUs to open channels, such channels must be unannounced, and CLUs must not route (as opposed to send or receive) payments. These constraints fit naturally with the desires of casual users who want to send and receive their Lightning payments, but not route payments for others. Support for CLUs is analogous to support for SPV (Simplified-Payment-Verification) nodes in Bitcoin.
* Problem 3 is solved by modifying both users' Commitment transactions in the channel that sends the payment so the CLU can be offline for nearly I_L without forcing their DLU partner to go on-chain. A simple approach would be to delay the expiry of the HTLC for each payment in the sending channel by I_L. This approach works, but it has the downside of delaying (by I_L) the CLU's ability to force production of a payment receipt. A better approach is to add a relative delay before the CLU can time out the HTLC output of a Commitment transaction, thus enabling the DLU to safely stay off-chain even after the expiry of the HTLC. That's the approach taken here.
Let Alice be a CLU who shares a channel with DLU Bob. Bob sets his channel parameters as he would in the current Lightning protocol, while Alice sets her "to_self_delay" parameter (controlling Bob's payments to himself) to I_L greater than it would be in the current Lightning protocol. Consider the case where Alice sends a Lightning payment on the channel she shares with Bob.
Let:
- eAB denote the expiry for this payment in the channel shared by Alice
and Bob,
- tsdA denote the "to_self_delay" parameter set by Alice, and
- tsdB denote the "to_self_delay" parameter set by Bob.
Three changes are made relative to the current Lightning protocol:
- a relative delay of tsdB is enforced before Alice can spend the HTLC
output for this payment in either Commitment transaction,
- after eAB, only Alice's (rather than both parties') signature is
required to spend the HTLC output in Alice's Commitment transaction,
and that output doesn't need to be spent using an HTLC-timeout
transaction that can be revoked (because the relative delay added
above guarantees Bob can prevent Alice from spending the HTLC output
in a revoked Commitment transaction that she puts on-chain), and
- both parties update the channel state off-chain at least once every
I_L to reflect Bob's cost of capital, as described above.
The resulting protocol, with a single payment from Alice outstanding, is shown below:
+-+ AB +----+ A
|F|----+--->| CC |--->
+-+ | | |
. | | B
. | |--->
. +----+
|
|
| revkeyBi
| +---------->
| |
| +----+ | tsdB & A
+--->|C_Ai|--+---------->
| | |
| | | B
| | |------------->
| | |
| | | revkeyBi
| | | +---------->
| | | |
| | | | tsdB & (eAB) & A
| | |--+------------------->
| +----+ |
| | Preimage(X) & B
| +------------------->
|
|
|
| revkeyAi
| +---------->
| |
| +----+ | tsdA & B
+--->|C_Bi|--+---------->
| | |
| | | A
| | |------------->
| | |
| | | revkeyAi
| | | +---------->
. | | |
. | | | tsdB & (eAB) & A revkeyAi
. | |--+-------------------> +---------->
| +----+ | |
| | Preimage(X) & AB +-----+ | tsdA & B
V +------------------->|Hs_Bi|--+---------->
+-----+
where: F is the Funding transaction, CC is the Cooperative Close transaction, C_Ai is Alice's Commitment transaction for state i, C_Bi is Bob's Commitment transaction for state i, and Hs_Bi is Bob's HTLC-success transaction for state i.
The F transaction is on-chain, while the remaining transactions are off-chain during normal protocol operation.
Requirements for output cases are as follows:
A: Alice's signature,
B: Bob's signature,
AB: Alice's and Bob's signatures,
revkeyAi: a signature using a revocation key that Alice can use to revoke
Bob's state i transaction,
revkeyBi: a signature using a revocation key that Bob can use to revoke
Alice's state i transaction,
tsdA: a relative delay equal to Alice's to_self_delay parameter,
tsdB: a relative delay equal to Bob's to_self_delay parameter,
(eAB): an absolute timelock equal to the expiry of the outstanding HTLC
offered by Alice, and
Preimage(X): the hash preimage of X.
Once Bob knows Preimage(X), he sends Preimage(X) to Alice and attempts to update both parties' Commitment transactions to show payment of the HTLC. If he has spent I_L time unsuccessfully trying to update those Commitment transactions, he can submit his Commitment and HTLC-success transactions to the blockchain. If at any point he sees Alice's Commitment transaction on-chain, he stops trying to update the Commitment transactions off-chain and he puts his transaction that reveals Preimage(X) and spends the HTLC output in her Commitment transaction on-chain as soon as possible.
Alice implements the WF channel protocol as she would the current Lightning channel protocol, except: - she can choose to be intentionally unavailable, provided she is available (or at least not intentionally unavailable) for at least I_S every I_L (to update her pre-payment for Bob's cost of capital and to revoke any old transactions put on-chain by Bob), and - she does not put her Commitment transaction on-chain until she has been available (or at least not intentionally unavailable) for at least a grace period of G following the expiry of her offered HTLC (where G is the same grace period as is used in the current Lightning protocol and G <= I_S).
Correctness ===========
When Alice sends a payment on the channel she shares with Bob, the WF protocol matches the Lightning protocol except the parties stay off-chain longer with the WF protocol (to accommodate Alice's intentional unavailability). Staying off-chain longer is safe for Alice, as she originated the payment and thus does not have to time out the HTLC at any specific time in order receive payment in an earlier hop. Staying off-chain longer is also safe for Bob, because whenever Alice's (or Bob's) Commitment transaction is put on-chain, the tsdB relative delay before Alice can time out the HTLC output is long enough to allow Bob to put his transaction on-chain that takes payment for the HTLC.
Finally, the WF protocol requires that Alice and Bob stay off-chain long enough to guarantee that Alice will be available (or at least not intentionally unavailable) for at least G, which is sufficient for both parties to update the channel state off-chain. As a result, if both parties follow the protocol, the channel will remain off-chain despite Alice's intentional unavailability.
A more detailed proof of correctness is given in the paper [5].
One-Shot Receives =================
While eliminating watchtowers is helpful for casual users, the protocol for receiving Lightning payments could still be awkward for such users. With the current Lightning protocol, when a user receives a payment and their channel partner is unresponsive, the user must submit their Commitment and HTLC-success transactions to the blockchain. However, if their partner's conflicting Commitment transaction wins the race and is included in the blockchain, the user then has to submit a different transaction that reveals the HTLC's secret and spends the HTLC output in their partner's Commitment transaction. The requirement to wait and check the blockchain for the winning Commitment transaction (which might not be determined until multiple blocks have been added to the blockchain) is awkward for a casual user. It would be far preferable if the casual user could always receive a payment by performing a sequence of off-chain message exchanges and at most one submission to the blockchain. A protocol that has this property will be said to support "one-shot receives".
The WF protocol can be made to support one-short receives (and to simplify the process of getting a receipt) for CLU Alice by making the following change whenever a new Commitment transaction for DLU Bob is signed by Alice: - if Bob has one or more outstanding HTLCs offered to Alice, the nLocktime field of Bob's Commitment transaction is set to the expiry of the earliest such HTLC, - otherwise, the nLocktime field of Bob's Commitment transaction is set to I_L in the future (relative to when Bob's Commitment transaction is signed by Alice).
Before examining how this change supports one-shot receives, it's important to resolve a technical issue. In the current Lightning protocol, the nLocktime field in the Commitment transaction provides 24 bits of the channel's state number in order to allow efficient revocation of old on-chain Commitments (with the remaining 24 bits being provided by the nSequence field of the Commitment transaction's sole input). Because we're now using the nLocktime field to enforce an absolute timelock, those 24 bits of state number can no longer be encoded in the nLocktime field. There are two solutions to this problem: - add a second input to Bob's Commitment transaction that spends a UTXO owned by Bob (the value of which is arbitrary and is refunded to Bob in the Commitment transaction) and use the nSequence field of that input to encode 24 bits of state number, or - support only 24-bit state numbers, as 16 million channel states are likely sufficient for most casual users.
In addition, the following constraints are added in order to guarantee one-shot receives: 1. Whenever a new HTLC is offered to Alice, its expiry is set to exactly her min_final_cltv_expiry parameter in the future. This constraint guarantees that new HTLCs have expiries that are monotonically nondecreasing. 2. Whenever Alice gives Bob a secret for an HTLC, that HTLC has the earliest expiry of all the HTLCs in Alice's current Commitment transaction. 3. Whenever a new channel state i+1 is created, Alice's partial signature for Bob's Commitment transaction for state i+1 is given to Bob, and the revocation key for Bob's Commitment transaction for state i is given to Alice, before Bob's partial signature for Alice's Commitment transaction for state i+1 is given to Alice.
Given these constraints and the setting of the nLocktime field in Bob's Commitment transaction, Alice can always put her Commitment transaction on-chain before Bob can put a conflicting current Commitment transaction on-chain, thus providing one-shot receives. The details are provided in the paper [5].
Finally, it's important to verify that the delay of Bob's Commitment transaction (caused by the setting of its nLocktime field) does not create any problems for Bob. First, for HTLCs offered to Alice (that is, payments received by Alice), the current Lightning protocol requires that Bob wait until after the expiry of his offered HTLC before he goes on-chain with his Commitment and HTLC-timeout transactions. Therefore, the nLocktime field has no impact on Bob's actions regarding HTLCs offered to Alice. Second, for HTLCs offered by Alice (that is, payments sent by Alice), the WF protocol does not force Bob to put his Commitment and associated HTLC-success transactions on-chain before any specific time in order guarantee the success of any HTLCs. As a result, Bob's ability to force payment for HTLCs offered by Alice is unaffected by the nLocktime field in his Commitment transactions. Note that the Lightning protocol does require Bob to put his Commitment and associated HTLC-success transactions on-chain by a specific time, which is why the changes described here cannot be made to the Lightning protocol to support one-shot receives.
Getting A Payment Receipt =========================
Consider again the case where casual user Alice has offered an HTLC to Bob. At any time after the expiry of the HTLC, if Alice needs to get a payment receipt and Bob is uncooperative, Alice can put her Commitment transaction on-chain and then attempt to spend the HTLC output of her Commitment transaction tsdB later. As was shown above, she is guaranteed to win the race in putting her Commitment transaction on-chain due to the nLocktime field in Bob's Commitment transaction. Therefore, she will either get her receipt before she is able to spend the HTLC output or she will not have to make her payment (because she succeeded in spending the HTLC output). This procedure for getting a payment receipt isn't one-shot and may be awkward for casual users. Fortunately, it's only required when there's both a payment dispute (or other need to get a receipt quickly) and an uncooperative channel partner.
Asynchronous Payments =====================
The WF protocol gives significant flexibility to when CLUs have to be online, but it still requires that the sender and receiver are both online simultaneously. This requirement can be eliminated by keeping the relative delay but removing the absolute delay in Alice's transaction that times out an HTLC for a payment that she initiates. The details are given in the paper [5].
Related Work ============
The protocol presented here is based extensively on previously-published work, namely the Poon-Dryja Lightning channel protocol [1] and the BOLT specifications [2]. The asynchronous payments protocol is based on Corallo's proposal for sending tips to an offline receiver [3], but differs by using only a relative delay in the sender's HTLC.
The idea of eliminating watchtowers for a casual user by delaying their partner's ability to put transactions on-chain was described by Law [4], but the interaction of that delay with HTLCs was not analyzed and that paper assumed modifications to the underlying Bitcoin protocol.
Conclusions ===========
This post presents the idea of dividing users into Casual-Lightning-Users (CLUs) that only send and receive payments, and Dedicated-Lightning-Users (DLUs) that can also route payments. It gives a new protocol that allows casual users to send and receive Lightning payments in a trust-free manner without requiring a watchtower service. It also allows CLUs to receive payments in a one-shot manner (that is, without having to wait for blocks to be added to the blockchain). No changes to the Bitcoin protocol are required.
The new protocol does have some disadvantages, such as increasing the cost of capital for DLUs that partner with CLUs and increasing the latency for CLUs to get payment receipts from uncooperative partners. Hopefully, the elimination of watchtowers for casual users, and their ability to do one-shot receives, will more than make up for these drawbacks.
I'm not an expert in the area, so I might have missed something.
Corrections and comments are greatly appreciated.
Regards, John
References ==========
[1] Poon and Dryja, The Bitcoin Lightning Network, available at
https://lightning.network/lightning-network-paper.pdf.
[2] BOLT specifications, available at
https://github.com/lightningnetwork/lightning-rfc.
[3] Corallo, A Mobile Lightning User Goes to Pay a Mobile Lightning
User..., available at https://www.learnbitcoin.com/archive/lists/lightning-dev/t/2021/a-mobile-lightning-user-goes-to-pay-a-mobile-lightning-user#m-98981355.
[4] Law, Section 3.6 of Scaling Bitcoin With Inherited IDs, available at
https://github.com/JohnLaw2/btc-iids.
[5] Law, Watchtower-Free Lightning Channels For Casual Users, available at
https://github.com/JohnLaw2/ln-watchtower-free.
Sent with [Proton Mail](https://proton.me/) secure email.
On 2022-10-03 06:55, jlspc via Lightning-dev wrote:
Quoted text (2 lines)
> The WF Protocol > ===============
Hi John,
I had difficulty understanding your proposal description here and in your paper[1]. I wonder if others are having the same the same difficulty, so I've tried to reduce it down to just the essential idea so you can tell me if I'm understanding correctly and others can evaluate it more quickly. Here I go:
In a traditional HTLC, the agreement is essentially:
- Setup: Alice has x BTC, an unpublished value y, and the hash digest z which is hash(y) - HTLC success: Alice offers Bob the x BTC, which he can claim at any time if he publishes y satisfying the equation hash(y) == z - HTLC failure: Alice can spend the x BTC back to her wallet after some time t has elapsed
If I understand your modified protocol correctly, the essential modified agreement is:
- [Setup the same] - [HTLC success the same] - HTLC failure: Alice can spend the x BTC back to her wallet by first getting a trigger[2] transaction confirmed onchain, waiting b blocks, then getting the actual spend-back-to-wallet transaction confirmed
Because the trigger transaction needs to be confirmed for b blocks before Alice can can spend the money back to her wallet, Bob doesn't need to take any action to lock-in an HTLC Success unless he sees the trigger transaction appear onchain or he expects to be offline for more than b blocks. This allows Alice to stay offline for as long as Bob can tolerate (which goes towards your point of Alice prepaying Bob for that tolerance).
[1] https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf [2] "Trigger" transaction is the name given to that type of transaction in section 4.2 of the Eltoo paper: https://blockstream.com/eltoo.pdf
Quoted text (2 lines)
> One-Shot Receives > =================
I understand the essence of this idea to be simply encumbering dedicated user Bob's commitment transaction with a timelock so that he can't publish it until near the time when any HTLCs in it would expire. Alice's version of commitment would be unencumbered, so she could publish it any time.
Quoted text (13 lines)
> when a user receives a payment and > their channel partner is unresponsive, the user must submit their > Commitment and HTLC-success transactions to the blockchain. However, if > their partner's conflicting Commitment transaction wins the race and is > included in the blockchain, the user then has to submit a different > transaction that reveals the HTLC's secret and spends the HTLC output > in > their partner's Commitment transaction. The requirement to wait and > check > the blockchain for the winning Commitment transaction (which might not > be > determined until multiple blocks have been added to the blockchain) is > awkward for a casual user.
Although your proposal may address this in the normal case, I think it doesn't address the pathological case where honest casual user Alice broadcasts the latest commitment transaction but her channel partner, malicious dedicated user Mallory, broadcasts an older revoked commitment transaction. Because Mallory's revoked commitment transaction is older, its timelock has expired, so it can win the race against Alice's latest commitment transaction.
To become aware of this situation and to broadcast a penalty transaction within the necessary time limit, Alice still needs to monitor the block chain. If Alice still needs to monitor the block chain in any case, this proposed change doesn't eliminate the underlying problem of onerous monitoring as far as I can tell.
Thanks as always for the innovative thinking!,
-Dave
Hey John,
Thanks for sharing, this is very interesting.
There is a good insight here that we can remove the intermediate HTLC-timeout transaction for outgoing payments because we are the origin of that payment (and thus don't need to quickly claim the HTLC on-chain to then relay that failure to a matching incoming HTLC).
More generally, you have perfectly identified that most of the complexity of today's transactions come from the need to ensure that a failing/malicious downstream channel doesn't negatively impact honest upstream channels when relaying payments, and that some of this complexity can be lifted when nodes don't relay payments.
However, my main criticism of your proposal is that liquidity isn't free. While your improvements are great from the CLU's point of view, I'm not sure they're acceptable for the DLU. The main (probably only) job of an LSP (DLU in your terminology) is to efficiently allocate their liquidity. In order to do so, they must be able to quickly move liquidity from where it's unused to where it may be better used. That means closely watching the demand for block space and doing on-chain transactions when fees are low (to open/close channels, splice funds in/out [1], make peer swaps [2], etc). With your proposal, DLUs won't be able to quickly move liquidity around, so the only way to make up for this is to charge the CLU for the loss of expected revenue. I'm afraid that the amount DLUs would need to charge CLUs will be prohibitively expensive for most CLUs.
I'm curious to get your feedback on that point.
Thanks again for sharing, and for the inherited IDs [3] proposal as well!
Bastien
[1] https://github.com/lightning/bolts/pull/863 [2] https://www.peerswap.dev/ [3] https://github.com/JohnLaw2/btc-iids
Le lun. 3 oct. 2022 à 18:55, jlspc via Lightning-dev < lightning-dev at lists.linuxfoundation.org> a écrit :
Quoted text (398 lines)
> > This is the first in a series of posts on ideas to improve the usability > and scalability of the Lightning Network. This post presents a new channel > protocol that allows casual users to send and receive Lightning payments > without having to meet onerous availability requirements or use a > watchtower service. This new Watchtower-Free (WF) protocol can also be > used to simplify the reception of Lightning payments for casual users. No > change to the underlying Bitcoin protocol is required. > > A paper with a more complete description of the protocol, including > figures, is available [5]. > > Properties > ========== > > The user-visible properties of the WF protocol can be expressed using > two parameters: > * I_S: a short time interval (e.g., 10 minutes) for communicating with > peers, checking the blockchain, and submitting transactions to the > blockchain, and > * I_L: a long time interval (e.g., 1-3 months). > > The casual user must be online for up to: > * I_S every I_L (e.g., 10 minutes every 1-3 months) to safeguard the funds > in their Lightning channel. > > With the WF protocol, the latency for payments is unchanged from the > current protocol, but the latency for getting a payment receipt from an > uncooperative channel partner is increased. In addition, the casual user > may have to pay their channel partner for the partner's cost of capital > (which depends on I_L). If the casual user and their channel partner > follow the protocol, the channel can remain off-chain arbitrarily long. > > First Attempt: Use The Current Lightning Protocol > ================================================= > > In order to motivate the new protocol, first consider what would happen if > a casual user attempted to achieve the above properties with the current > Lightning channel protocol. The casual user would set their > "to_self_delay" (which controls how quickly their channel partner can > receive funds from a transaction they put on-chain) and > "cltv_expiry_delta" (which controls the staggering of timeouts between > successive hops) parameters to values approaching I_L (because the casual > user could be unavailable for nearly that long). This would create three > problems: > > * Problem 1: The casual user's proposed channel partner would likely > reject the creation of the channel due to the excessive "to_self_delay" > value. > > * Problem 2: If a channel were created with these parameters, Lightning > payments would not be routed through it due to the excessive > "cltv_expiry_delta" value. > > * Problem 3: If a channel were created with these parameters and if the > casual user sent a payment on that channel, their partner could have to > go on-chain in order to pull the payment from the casual user. In > particular, the casual user could be offline for nearly I_L (e.g., 1-3 > months) when their partner receives the receipt, thus forcing their > partner to go on-chain to receive payment before the expiry of the > associated HTLC. > > The WF Protocol > =============== > > The WF protocol solves these problems by modifying the Lightning protocol > as follows: > > * Problem 1 is solved by having the casual user pre-pay their channel > partner for the cost of the partner's capital that's tied up in the > channel due to the very large "to_self_delay" value. This pre-payment is > included in the initial channel state and is updated at least once every > I_L to reflect the additional cost of capital due to the partner not yet > going on-chain. > > * Problem 2 is solved by allowing casual users to designate themselves as > Casual-Lightning-Users (CLUs), while the remaining users are > Dedicated-Lightning-Users (DLUs). CLUs can only partner with DLUs to > open channels, such channels must be unannounced, and CLUs must not > route (as opposed to send or receive) payments. These constraints fit > naturally with the desires of casual users who want to send and receive > their Lightning payments, but not route payments for others. Support for > CLUs is analogous to support for SPV (Simplified-Payment-Verification) > nodes in Bitcoin. > > * Problem 3 is solved by modifying both users' Commitment transactions in > the channel that sends the payment so the CLU can be offline for nearly > I_L without forcing their DLU partner to go on-chain. A simple approach > would be to delay the expiry of the HTLC for each payment in the sending > channel by I_L. This approach works, but it has the downside of delaying > (by I_L) the CLU's ability to force production of a payment receipt. A > better approach is to add a relative delay before the CLU can time out > the HTLC output of a Commitment transaction, thus enabling the DLU to > safely stay off-chain even after the expiry of the HTLC. That's the > approach taken here. > > Let Alice be a CLU who shares a channel with DLU Bob. Bob sets his channel > parameters as he would in the current Lightning protocol, while Alice sets > her "to_self_delay" parameter (controlling Bob's payments to himself) to > I_L greater than it would be in the current Lightning protocol. Consider > the case where Alice sends a Lightning payment on the channel she shares > with Bob. > > Let: > - eAB denote the expiry for this payment in the channel shared by Alice > and Bob, > - tsdA denote the "to_self_delay" parameter set by Alice, and > - tsdB denote the "to_self_delay" parameter set by Bob. > > Three changes are made relative to the current Lightning protocol: > - a relative delay of tsdB is enforced before Alice can spend the HTLC > output for this payment in either Commitment transaction, > - after eAB, only Alice's (rather than both parties') signature is > required to spend the HTLC output in Alice's Commitment transaction, > and that output doesn't need to be spent using an HTLC-timeout > transaction that can be revoked (because the relative delay added > above guarantees Bob can prevent Alice from spending the HTLC output > in a revoked Commitment transaction that she puts on-chain), and > - both parties update the channel state off-chain at least once every > I_L to reflect Bob's cost of capital, as described above. > > The resulting protocol, with a single payment from Alice outstanding, is > shown below: > > +-+ AB +----+ A > |F|----+--->| CC |---> > +-+ | | | > . | | B > . | |---> > . +----+ > | > | > | revkeyBi > | +----------> > | | > | +----+ | tsdB & A > +--->|C_Ai|--+----------> > | | | > | | | B > | | |-------------> > | | | > | | | revkeyBi > | | | +----------> > | | | | > | | | | tsdB & (eAB) & A > | | |--+-------------------> > | +----+ | > | | Preimage(X) & B > | +-------------------> > | > | > | > | revkeyAi > | +----------> > | | > | +----+ | tsdA & B > +--->|C_Bi|--+----------> > | | | > | | | A > | | |-------------> > | | | > | | | revkeyAi > | | | +----------> > . | | | > . | | | tsdB & (eAB) & A revkeyAi > . | |--+-------------------> +----------> > | +----+ | | > | | Preimage(X) & AB +-----+ | tsdA & B > V +------------------->|Hs_Bi|--+----------> > +-----+ > > where: > F is the Funding transaction, > CC is the Cooperative Close transaction, > C_Ai is Alice's Commitment transaction for state i, > C_Bi is Bob's Commitment transaction for state i, and > Hs_Bi is Bob's HTLC-success transaction for state i. > > The F transaction is on-chain, while the remaining transactions are > off-chain during normal protocol operation. > > Requirements for output cases are as follows: > A: Alice's signature, > B: Bob's signature, > AB: Alice's and Bob's signatures, > revkeyAi: a signature using a revocation key that Alice can use to revoke > Bob's state i transaction, > revkeyBi: a signature using a revocation key that Bob can use to revoke > Alice's state i transaction, > tsdA: a relative delay equal to Alice's to_self_delay parameter, > tsdB: a relative delay equal to Bob's to_self_delay parameter, > (eAB): an absolute timelock equal to the expiry of the outstanding HTLC > offered by Alice, and > Preimage(X): the hash preimage of X. > > Once Bob knows Preimage(X), he sends Preimage(X) to Alice and attempts to > update both parties' Commitment transactions to show payment of the HTLC. > If he has spent I_L time unsuccessfully trying to update those Commitment > transactions, he can submit his Commitment and HTLC-success transactions > to the blockchain. If at any point he sees Alice's Commitment transaction > on-chain, he stops trying to update the Commitment transactions off-chain > and he puts his transaction that reveals Preimage(X) and spends the HTLC > output in her Commitment transaction on-chain as soon as possible. > > Alice implements the WF channel protocol as she would the current > Lightning channel protocol, except: > - she can choose to be intentionally unavailable, provided she is > available (or at least not intentionally unavailable) for at least I_S > every I_L (to update her pre-payment for Bob's cost of capital and to > revoke any old transactions put on-chain by Bob), and > - she does not put her Commitment transaction on-chain until she has > been available (or at least not intentionally unavailable) for at least > a grace period of G following the expiry of her offered HTLC (where G > is the same grace period as is used in the current Lightning protocol > and G <= I_S). > > Correctness > =========== > > When Alice sends a payment on the channel she shares with Bob, the WF > protocol matches the Lightning protocol except the parties stay off-chain > longer with the WF protocol (to accommodate Alice's intentional > unavailability). Staying off-chain longer is safe for Alice, as she > originated the payment and thus does not have to time out the HTLC at any > specific time in order receive payment in an earlier hop. Staying > off-chain longer is also safe for Bob, because whenever Alice's (or Bob's) > Commitment transaction is put on-chain, the tsdB relative delay before > Alice can time out the HTLC output is long enough to allow Bob to put his > transaction on-chain that takes payment for the HTLC. > > Finally, the WF protocol requires that Alice and Bob stay off-chain long > enough to guarantee that Alice will be available (or at least not > intentionally unavailable) for at least G, which is sufficient for both > parties to update the channel state off-chain. As a result, if both > parties follow the protocol, the channel will remain off-chain despite > Alice's intentional unavailability. > > A more detailed proof of correctness is given in the paper [5]. > > One-Shot Receives > ================= > > While eliminating watchtowers is helpful for casual users, the protocol > for receiving Lightning payments could still be awkward for such users. > With the current Lightning protocol, when a user receives a payment and > their channel partner is unresponsive, the user must submit their > Commitment and HTLC-success transactions to the blockchain. However, if > their partner's conflicting Commitment transaction wins the race and is > included in the blockchain, the user then has to submit a different > transaction that reveals the HTLC's secret and spends the HTLC output in > their partner's Commitment transaction. The requirement to wait and check > the blockchain for the winning Commitment transaction (which might not be > determined until multiple blocks have been added to the blockchain) is > awkward for a casual user. It would be far preferable if the casual user > could always receive a payment by performing a sequence of off-chain > message exchanges and at most one submission to the blockchain. A protocol > that has this property will be said to support "one-shot receives". > > The WF protocol can be made to support one-short receives (and to simplify > the process of getting a receipt) for CLU Alice by making the following > change whenever a new Commitment transaction for DLU Bob is signed by > Alice: > - if Bob has one or more outstanding HTLCs offered to Alice, the > nLocktime field of Bob's Commitment transaction is set to the expiry of > the earliest such HTLC, > - otherwise, the nLocktime field of Bob's Commitment transaction is set > to I_L in the future (relative to when Bob's Commitment transaction is > signed by Alice). > > Before examining how this change supports one-shot receives, it's > important to resolve a technical issue. In the current Lightning protocol, > the nLocktime field in the Commitment transaction provides 24 bits of the > channel's state number in order to allow efficient revocation of old > on-chain Commitments (with the remaining 24 bits being provided by the > nSequence field of the Commitment transaction's sole input). Because we're > now using the nLocktime field to enforce an absolute timelock, those 24 > bits of state number can no longer be encoded in the nLocktime field. > There are two solutions to this problem: > - add a second input to Bob's Commitment transaction that spends a UTXO > owned by Bob (the value of which is arbitrary and is refunded to Bob in > the Commitment transaction) and use the nSequence field of that input > to encode 24 bits of state number, or > - support only 24-bit state numbers, as 16 million channel states are > likely sufficient for most casual users. > > In addition, the following constraints are added in order to guarantee > one-shot receives: > 1. Whenever a new HTLC is offered to Alice, its expiry is set to exactly > her min_final_cltv_expiry parameter in the future. This constraint > guarantees that new HTLCs have expiries that are monotonically > nondecreasing. > 2. Whenever Alice gives Bob a secret for an HTLC, that HTLC has the > earliest expiry of all the HTLCs in Alice's current Commitment > transaction. > 3. Whenever a new channel state i+1 is created, Alice's partial signature > for Bob's Commitment transaction for state i+1 is given to Bob, and the > revocation key for Bob's Commitment transaction for state i is given to > Alice, before Bob's partial signature for Alice's Commitment > transaction for state i+1 is given to Alice. > > Given these constraints and the setting of the nLocktime field in Bob's > Commitment transaction, Alice can always put her Commitment transaction > on-chain before Bob can put a conflicting current Commitment transaction > on-chain, thus providing one-shot receives. The details are provided in > the paper [5]. > > Finally, it's important to verify that the delay of Bob's Commitment > transaction (caused by the setting of its nLocktime field) does not create > any problems for Bob. First, for HTLCs offered to Alice (that is, payments > received by Alice), the current Lightning protocol requires that Bob wait > until after the expiry of his offered HTLC before he goes on-chain with > his Commitment and HTLC-timeout transactions. Therefore, the nLocktime > field has no impact on Bob's actions regarding HTLCs offered to Alice. > Second, for HTLCs offered by Alice (that is, payments sent by Alice), the > WF protocol does not force Bob to put his Commitment and associated > HTLC-success transactions on-chain before any specific time in order > guarantee the success of any HTLCs. As a result, Bob's ability to force > payment for HTLCs offered by Alice is unaffected by the nLocktime field in > his Commitment transactions. Note that the Lightning protocol does > require Bob to put his Commitment and associated HTLC-success transactions > on-chain by a specific time, which is why the changes described here > cannot be made to the Lightning protocol to support one-shot receives. > > Getting A Payment Receipt > ========================= > > Consider again the case where casual user Alice has offered an HTLC to > Bob. At any time after the expiry of the HTLC, if Alice needs to get a > payment receipt and Bob is uncooperative, Alice can put her Commitment > transaction on-chain and then attempt to spend the HTLC output of her > Commitment transaction tsdB later. As was shown above, she is guaranteed > to win the race in putting her Commitment transaction on-chain due to the > nLocktime field in Bob's Commitment transaction. Therefore, she will > either get her receipt before she is able to spend the HTLC output or she > will not have to make her payment (because she succeeded in spending the > HTLC output). This procedure for getting a payment receipt isn't one-shot > and may be awkward for casual users. Fortunately, it's only required when > there's both a payment dispute (or other need to get a receipt quickly) > and an uncooperative channel partner. > > Asynchronous Payments > ===================== > > The WF protocol gives significant flexibility to when CLUs have to be > online, but it still requires that the sender and receiver are both online > simultaneously. This requirement can be eliminated by keeping the relative > delay but removing the absolute delay in Alice's transaction that times > out an HTLC for a payment that she initiates. The details are given in the > paper [5]. > > Related Work > ============ > > The protocol presented here is based extensively on previously-published > work, namely the Poon-Dryja Lightning channel protocol [1] and the BOLT > specifications [2]. The asynchronous payments protocol is based on > Corallo's proposal for sending tips to an offline receiver [3], but > differs by using only a relative delay in the sender's HTLC. > > The idea of eliminating watchtowers for a casual user by delaying their > partner's ability to put transactions on-chain was described by Law [4], > but the interaction of that delay with HTLCs was not analyzed and that > paper assumed modifications to the underlying Bitcoin protocol. > > Conclusions > =========== > > This post presents the idea of dividing users into Casual-Lightning-Users > (CLUs) that only send and receive payments, and Dedicated-Lightning-Users > (DLUs) that can also route payments. It gives a new protocol that allows > casual users to send and receive Lightning payments in a trust-free manner > without requiring a watchtower service. It also allows CLUs to receive > payments in a one-shot manner (that is, without having to wait for blocks > to be added to the blockchain). No changes to the Bitcoin protocol are > required. > > The new protocol does have some disadvantages, such as increasing the cost > of capital for DLUs that partner with CLUs and increasing the latency for > CLUs to get payment receipts from uncooperative partners. Hopefully, the > elimination of watchtowers for casual users, and their ability to do > one-shot receives, will more than make up for these drawbacks. > > I'm not an expert in the area, so I might have missed something. > > Corrections and comments are greatly appreciated. > > Regards, > John > > References > ========== > > [1] Poon and Dryja, The Bitcoin Lightning Network, available at > https://lightning.network/lightning-network-paper.pdf. > [2] BOLT specifications, available at > https://github.com/lightningnetwork/lightning-rfc. > [3] Corallo, A Mobile Lightning User Goes to Pay a Mobile Lightning > User..., available at
Quoted text (13 lines)
> [4] Law, Section 3.6 of Scaling Bitcoin With Inherited IDs, available at > https://github.com/JohnLaw2/btc-iids. > [5] Law, Watchtower-Free Lightning Channels For Casual Users, available at > https://github.com/JohnLaw2/ln-watchtower-free. > > > > > Sent with Proton Mail secure email. > _______________________________________________ > Lightning-dev mailing list > Lightning-dev at lists.linuxfoundation.org > https://www.learnbitcoin.com/archive/lists/lightning-dev
Hi Dave,
Thanks for reading and for doing a better job of explaining the ideas than I did!
Responses are in-line below:
Quoted text (33 lines)
> Hi John, > > I had difficulty understanding your proposal description here and in > your paper[1]. I wonder if others are having the same the same > difficulty, so I've tried to reduce it down to just the essential idea > so you can tell me if I'm understanding correctly and others can > evaluate it more quickly. Here I go: > > In a traditional HTLC, the agreement is essentially: > > - Setup: Alice has x BTC, an unpublished value y, and the hash digest z > which is hash(y) > - HTLC success: Alice offers Bob the x BTC, which he can claim at any > time if he publishes y satisfying the equation hash(y) == z > - HTLC failure: Alice can spend the x BTC back to her wallet after some > time t has elapsed > > If I understand your modified protocol correctly, the essential modified > agreement is: > > - [Setup the same] > - [HTLC success the same] > - HTLC failure: Alice can spend the x BTC back to her wallet by first > getting a trigger[2] transaction confirmed onchain, waiting b blocks, > then getting the actual spend-back-to-wallet transaction confirmed > > Because the trigger transaction needs to be confirmed for b blocks > before Alice can can spend the money back to her wallet, Bob doesn't > need to take any action to lock-in an HTLC Success unless he sees the > trigger transaction appear onchain or he expects to be offline for more > than b blocks. This allows Alice to stay offline for as long as Bob can > tolerate (which goes towards your point of Alice prepaying Bob for that > tolerance).
Yes, that's exactly right.
I'd note that the transaction that plays the role of the "trigger" transaction is actually just Alice's Commitment transaction, so no new transaction is required.
I'd also note that the parameter "b" is exactly Bob's to_self_delay parameter and he has already committed himself to being able to respond to Alice's on-chain transactions within a window of b blocks, so the protocol doesn't put any additional requirements on his monitoring of the blockchain.
Quoted text (14 lines)
> > [1] > <a href="https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf">https://raw.githubusercontent.com/JohnLaw2/ln-watchtower-free/main/watchtowerfree10.pdf</a> > [2] "Trigger" transaction is the name given to that type of transaction > in section 4.2 of the Eltoo paper: <a href="https://blockstream.com/eltoo.pdf">https://blockstream.com/eltoo.pdf</a> > > > One-Shot Receives > > ================= > > > I understand the essence of this idea to be simply encumbering dedicated > user Bob's commitment transaction with a timelock so that he can't > publish it until near the time when any HTLCs in it would expire. > Alice's version of commitment would be unencumbered, so she could > publish it any time.
Yes, that's correct.
In particular, dedicated user Bob can't publish his current Commitment transaction until Alice has put her conflicting current Commitment transaction on-chain (assuming she follows the protocol) or both parties have updated the state off-chain. As a result, Alice doesn't have to worry about the case where she submits her current Commitment and HTLC-success transactions only to later discover that Bob's current Commitment transaction has won the race, thus forcing Alice to then submit her transaction (which is like an HTLC-success transaction but isn't actually called that in the protocol) which reveals the hash preimage and takes payment of the HTLC. Forcing Alice to wait around to see who's current Commitment transaction has won the race seems like an inconvenient requirement for a casual user.
Is my understanding of this issue correct, or can Alice submit her transaction spending the HTLC output of Bob's current Commitment transaction even before he has submitted his current Commitment transaction? I realize this part of the protocol depends on node relay behavior, so it's harder to nail down and reason about than the consensus portion of the protocol. I may not have the correct understanding here, and if my understanding isn't correct, I'd really like to fix it.
Quoted text (13 lines)
> Although your proposal may address this in the normal case, I think it > doesn't address the pathological case where honest casual user Alice > broadcasts the latest commitment transaction but her channel partner, > malicious dedicated user Mallory, broadcasts an older revoked commitment > transaction. Because Mallory's revoked commitment transaction is older, > its timelock has expired, so it can win the race against Alice's latest > commitment transaction. > > To become aware of this situation and to broadcast a penalty transaction > within the necessary time limit, Alice still needs to monitor the block > chain. If Alice still needs to monitor the block chain in any case, > this proposed change doesn't eliminate the underlying problem of onerous > monitoring as far as I can tell.
You're right that Bob (or Mallory) could still broadcast an older revoked transaction, and if that happens, Alice needs to broadcast a penalty transaction within her long interval (I_L) safety parameter which I was suggesting she could set to something like 1-3 months. I felt that being able to shut off her phone and not worry about the Lightning app for all but a short time (say 10 minutes) every few months wasn't overly onerous. Do you feel that casual users wouldn't see it that way?
The issue of how often Alice needs to monitor the blockchain is based on her setting of her I_L parameter and is really independent of her ability to perform one-shot receives. My understanding is that in the current Lightning protocol, if Alice is receiving a payment and she gives the payment's secret to her partner Bob, and if Bob fails to update the channel state to reflect the payment, Alice has to 1) submit her Commitment and HTLC-success transactions, 2) wait to see if her current Commitment transaction or Bob's current Commitment transaction won the race, and if Bob's current Commitment transaction won, 3) submit her transaction spending Bob's current Commitment transaction's HTLC output. The protocol that supports one-shot receives eliminates steps 2) and 3) above, which seems like a better user interface.
Does that make sense?
Many thanks, John
Sent with Proton Mail secure email.
Hey Bastien,
Thanks for your reply.
Responses are in-line below:
Quoted text (14 lines)
> Hey John, > > Thanks for sharing, this is very interesting. > > There is a good insight here that we can remove the intermediate > HTLC-timeout transaction for outgoing payments because we are the > origin of that payment (and thus don't need to quickly claim the > HTLC on-chain to then relay that failure to a matching incoming HTLC). > > More generally, you have perfectly identified that most of the > complexity of today's transactions come from the need to ensure that > a failing/malicious downstream channel doesn't negatively impact > honest upstream channels when relaying payments, and that some of this > complexity can be lifted when nodes don't relay payments.
Thanks!
Quoted text (14 lines)
> However, my main criticism of your proposal is that liquidity isn't free. > While your improvements are great from the CLU's point of view, I'm not > sure they're acceptable for the DLU. The main (probably only) job of an > LSP (DLU in your terminology) is to efficiently allocate their liquidity. > In order to do so, they must be able to quickly move liquidity from where > it's unused to where it may be better used. That means closely watching > the demand for block space and doing on-chain transactions when fees are > low (to open/close channels, splice funds in/out [1], make peer swaps [2], > etc). With your proposal, DLUs won't be able to quickly move liquidity > around, so the only way to make up for this is to charge the CLU for the > loss of expected revenue. I'm afraid that the amount DLUs would need to > charge CLUs will be prohibitively expensive for most CLUs. > > I'm curious to get your feedback on that point.
I really appreciate your insight here. I'm just an interested observer who doesn't have experience with creating and deploying Lightning nodes, so I'm sure you have a better understanding of the current costs and trade-offs than I do.
My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct?
If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity.
In contrast, with the Watchtower-Free (WF) protocol, the DLU could only move liquidity to another Lightning channel by either: 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements), the desired movement of funds, or 2) putting a non-cooperative close transaction on-chain and waiting approximately 1-3 months (based on the I_L parameter set by the CLU) before moving the liquidity. In case 1), it would make sense for the DLU to refund the remaining portion of CLU's cost-of-capital pre-payment to the CLU, as that capital is now being made available to the DLU. This was not proposed in the paper, but it should probably be added.
With this change (namely refunding the remainder of the cost-of-capital pre-payment), it seems like the only disadvantage of the WF protocol to the DLU is the larger delay (1-3 months vs. 2 weeks). Do you feel increasing the delay from 2 weeks to 1 month is prohibitive?
My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low.
What are your thoughts on this?
Thanks, John
Quoted text (7 lines)
> Thanks again for sharing, and for the inherited IDs [3] proposal as well! > > Bastien > > [1] <a href="https://github.com/lightning/bolts/pull/863">https://github.com/lightning/bolts/pull/863</a> > [2] <a href="https://www.peerswap.dev/">https://www.peerswap.dev/</a> > [3] <a href="https://github.com/JohnLaw2/btc-iids">https://github.com/JohnLaw2/btc-iids</a>
Sent with [Proton Mail](https://proton.me/) secure email.
Quoted text (1 line)
>
Hi John,
Quoted text (13 lines)
> My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct? > > If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: > 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or > 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity.
That's correct, but that's something we intend to change to let LSPs re-allocate their liquidity more frequently and more efficiently.
We don't have a fully specified proposal yet, but by leveraging a mechanism similar to splicing [1], mobile users would pre-sign a transaction that keeps the channel open, but lets the LSP get their balance (or part of it) out non-interactively. This would be used by LSPs if the user isn't using their channel actively enough and the LSP is low on available liquidity for other, more active users.
This transaction would need to be revokable and must be delayed, since we still need the user to be able to punish malicious LSPs, but ideally (from the LSP's point of view) that delay should be at most 1 week, which forces users to regularly check the blockchain (which isn't ideal).
It really is a trade-off to be able to lower the fees LSPs make users pay for liquidity, because LSPs know they can move it cheaply when it becomes necessary. I can see a future where users chose their trade-off: pay more to be able to go offline for longer periods or pay less but check the blockchain regularly. The same LSP could offer both features, if they're able to price them correctly (which isn't trivial).
Quoted text (4 lines)
> My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low.
I'm not convinced by that...even though the value of capital increases with time, liquidity providers will compete to earn more return on their locked capital. If one liquidity provider is able to use their capital more efficiently than another, they will be able to offer lower prices to their customers to a point that isn't economically viable for the other, less efficient liquidity provider?
Since lightning doesn't allow any form of fractional reserve, the total available capital needs to be split between all existing users of the system, which is very inconvenient when trying to onboard a high number of new users.
This is very theoretical though, I have absolutely no idea how those dynamics will actually play out, but it will be interesting to watch it unfold.
Cheers, Bastien
[1] https://github.com/lightning/bolts/pull/863
Le mer. 12 oct. 2022 à 02:11, jlspc <jlspc at protonmail.com> a écrit :
Quoted text (74 lines)
> > Hey Bastien, > > Thanks for your reply. > > Responses are in-line below: > > > Hey John, > > > > Thanks for sharing, this is very interesting. > > > > There is a good insight here that we can remove the intermediate > > HTLC-timeout transaction for outgoing payments because we are the > > origin of that payment (and thus don't need to quickly claim the > > HTLC on-chain to then relay that failure to a matching incoming HTLC). > > > > More generally, you have perfectly identified that most of the > > complexity of today's transactions come from the need to ensure that > > a failing/malicious downstream channel doesn't negatively impact > > honest upstream channels when relaying payments, and that some of this > > complexity can be lifted when nodes don't relay payments. > > Thanks! > > > However, my main criticism of your proposal is that liquidity isn't free. > > While your improvements are great from the CLU's point of view, I'm not > > sure they're acceptable for the DLU. The main (probably only) job of an > > LSP (DLU in your terminology) is to efficiently allocate their liquidity. > > In order to do so, they must be able to quickly move liquidity from where > > it's unused to where it may be better used. That means closely watching > > the demand for block space and doing on-chain transactions when fees are > > low (to open/close channels, splice funds in/out [1], make peer swaps [2], > > etc). With your proposal, DLUs won't be able to quickly move liquidity > > around, so the only way to make up for this is to charge the CLU for the > > loss of expected revenue. I'm afraid that the amount DLUs would need to > > charge CLUs will be prohibitively expensive for most CLUs. > > > > I'm curious to get your feedback on that point. > > I really appreciate your insight here. I'm just an interested observer who doesn't have experience with creating and deploying Lightning nodes, so I'm sure you have a better understanding of the current costs and trade-offs than I do. > > My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct? > > If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: > 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or > 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity. > > In contrast, with the Watchtower-Free (WF) protocol, the DLU could only move liquidity to another Lightning channel by either: > 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements), the desired movement of funds, or > 2) putting a non-cooperative close transaction on-chain and waiting approximately 1-3 months (based on the I_L parameter set by the CLU) before moving the liquidity. > In case 1), it would make sense for the DLU to refund the remaining portion of CLU's cost-of-capital pre-payment to the CLU, as that capital is now being made available to the DLU. This was not proposed in the paper, but it should probably be added. > > With this change (namely refunding the remainder of the cost-of-capital pre-payment), it seems like the only disadvantage of the WF protocol to the DLU is the larger delay (1-3 months vs. 2 weeks). Do you feel increasing the delay from 2 weeks to 1 month is prohibitive? > > My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low. > > What are your thoughts on this? > > Thanks, > John > > > Thanks again for sharing, and for the inherited IDs [3] proposal as well! > > > > Bastien > > > > [1] <a href="https://github.com/lightning/bolts/pull/863">https://github.com/lightning/bolts/pull/863</a> > > [2] <a href="https://www.peerswap.dev/">https://www.peerswap.dev/</a> > > [3] <a href="https://github.com/JohnLaw2/btc-iids">https://github.com/JohnLaw2/btc-iids</a> > > > Sent with Proton Mail <https://proton.me/> secure email. > > >
Hi Bastien,
Thanks for your detailed response.
I see how the use of a pre-signed "splice" transaction that allows the dedicated user to obtain some of their capital creates an inherent trade-off between the dedicated user's capital efficiency and the casual user's ability to be offline for an extended period of time.
In order for the use of a pre-signed splice transaction to be safe, the casual user has to check the blockchain and see the splice transaction before it can be spent by the dedicated user (in order to revoke it if needed). As a result, once the dedicated user decides to splice out some channel funds, the dedicated user cannot access those funds until some time *after* the casual user has been online (provided the protocol is trust-free).
Given this observation, what if the protocol were changed so that, instead of pre-signing a splice transaction, the casual user always checks in with the dedicated user whenever they check the blockchain? At such a check-in, if the dedicated user wants to splice out some channel funds, they send the casual user a splice transaction which splices out some of the funds to the dedicated user without requiring a to_self delay. The casual user then signs the splice transaction and returns the signature as part of the check-in.
This approach has a couple potential advantages: 1) It allows the dedicated user to splice out funds as soon as the casual user comes online (rather than sometime after the casual user comes online, as shown above). Therefore, the use of capital is made more efficient. 2) It allows the splice transaction to pay fees based on the current fee rate, rather than a pre-calculated fee rate.
It does have some potential disadvantages: 1) It requires the casual user to stay online long enough to complete the roundtrip of sending a check-in message to the dedicated user, getting the splice message to sign, signing it, and sending the signature back to the dedicated user. 2) It assumes that the casual user checks the blockchain themselves, rather than using a watchtower service. 3) It requires the dedicated user to decide at the time of the check-in whether or not to perform the splice, as the splice transaction cannot be revoked.
In any case, using a check-in and a non-revokable splice transaction appears to have some advantages in terms of capital efficiency. It's also somewhat more compatible with the WF protocol, as the delay for the dedicated user to obtain spliced-out funds is dependent on the actual time until the casual user next comes online, rather than the worst-case delay until the casual user comes online. This could be a big difference if the casual user is typically online every day, but doesn't want the burden of having to be online every day (or every week). I'm interested in your thoughts on this.
Finally, I understand that the ability to quickly splice out channel funds to improve capital efficiency is critical in the current environment. However, if we eventually get to the point where the blockchain is highly-contested and fees are high, it may no longer be worth paying the fees to put a splice transaction on-chain unless a large amount of capital is at stake for a long period of time.
Regards, John
Sent with [Proton Mail](https://proton.me/) secure email.
------- Original Message ------- On Monday, October 24th, 2022 at 2:50 AM, Bastien TEINTURIER <bastien at acinq.fr> wrote:
Quoted text (138 lines)
> Hi John, > >> My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct? >> >> If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: >> 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or >> 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity. > > That's correct, but that's something we intend to change to let LSPs > re-allocate their liquidity more frequently and more efficiently. > > We don't have a fully specified proposal yet, but by leveraging a > mechanism similar to splicing [1], mobile users would pre-sign a > transaction that keeps the channel open, but lets the LSP get their > balance (or part of it) out non-interactively. This would be used by > LSPs if the user isn't using their channel actively enough and the LSP > is low on available liquidity for other, more active users. > > This transaction would need to be revokable and must be delayed, since > we still need the user to be able to punish malicious LSPs, but ideally > (from the LSP's point of view) that delay should be at most 1 week, which > forces users to regularly check the blockchain (which isn't ideal). > > It really is a trade-off to be able to lower the fees LSPs make users > pay for liquidity, because LSPs know they can move it cheaply when it > becomes necessary. I can see a future where users chose their trade-off: > pay more to be able to go offline for longer periods or pay less but > check the blockchain regularly. The same LSP could offer both features, > if they're able to price them correctly (which isn't trivial). > >> My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low. > > I'm not convinced by that...even though the value of capital increases > with time, liquidity providers will compete to earn more return on their > locked capital. If one liquidity provider is able to use their capital > more efficiently than another, they will be able to offer lower prices > to their customers to a point that isn't economically viable for the > other, less efficient liquidity provider? > > Since lightning doesn't allow any form of fractional reserve, the total > available capital needs to be split between all existing users of the > system, which is very inconvenient when trying to onboard a high number > of new users. > > This is very theoretical though, I have absolutely no idea how those > dynamics will actually play out, but it will be interesting to watch it > unfold. > > Cheers, > Bastien > > [1] https://github.com/lightning/bolts/pull/863 > > Le mer. 12 oct. 2022 à 02:11, jlspc <jlspc at protonmail.com> a écrit : > >> Hey Bastien, >> >> Thanks for your reply. >> >> Responses are in-line below: >> >>> Hey John, >>> >>> Thanks for sharing, this is very interesting. >>> >>> There is a good insight here that we can remove the intermediate >>> HTLC-timeout transaction for outgoing payments because we are the >>> origin of that payment (and thus don't need to quickly claim the >>> HTLC on-chain to then relay that failure to a matching incoming HTLC). >>> >>> More generally, you have perfectly identified that most of the >>> complexity of today's transactions come from the need to ensure that >>> a failing/malicious downstream channel doesn't negatively impact >>> honest upstream channels when relaying payments, and that some of this >>> complexity can be lifted when nodes don't relay payments. >> >> Thanks! >> >>> However, my main criticism of your proposal is that liquidity isn't free. >>> While your improvements are great from the CLU's point of view, I'm not >>> sure they're acceptable for the DLU. The main (probably only) job of an >>> LSP (DLU in your terminology) is to efficiently allocate their liquidity. >>> In order to do so, they must be able to quickly move liquidity from where >>> it's unused to where it may be better used. That means closely watching >>> the demand for block space and doing on-chain transactions when fees are >>> low (to open/close channels, splice funds in/out [1], make peer swaps [2], >>> etc). With your proposal, DLUs won't be able to quickly move liquidity >>> around, so the only way to make up for this is to charge the CLU for the >>> loss of expected revenue. I'm afraid that the amount DLUs would need to >>> charge CLUs will be prohibitively expensive for most CLUs. >>> >>> I'm curious to get your feedback on that point. >> >> I really appreciate your insight here. I'm just an interested observer who doesn't have experience with creating and deploying Lightning nodes, so I'm sure you have a better understanding of the current costs and trade-offs than I do. >> >> My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct? >> >> If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: >> 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or >> 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity. >> >> In contrast, with the Watchtower-Free (WF) protocol, the DLU could only move liquidity to another Lightning channel by either: >> 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements), the desired movement of funds, or >> 2) putting a non-cooperative close transaction on-chain and waiting approximately 1-3 months (based on the I_L parameter set by the CLU) before moving the liquidity. >> In case 1), it would make sense for the DLU to refund the remaining portion of CLU's cost-of-capital pre-payment to the CLU, as that capital is now being made available to the DLU. This was not proposed in the paper, but it should probably be added. >> >> With this change (namely refunding the remainder of the cost-of-capital pre-payment), it seems like the only disadvantage of the WF protocol to the DLU is the larger delay (1-3 months vs. 2 weeks). Do you feel increasing the delay from 2 weeks to 1 month is prohibitive? >> >> My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low. >> >> What are your thoughts on this? >> >> Thanks, >> John >> >>> Thanks again for sharing, and for the inherited IDs [3] proposal as well! >>> >>> Bastien >>> >>> [1] <a href=" >> https://github.com/lightning/bolts/pull/863 >> "> >> https://github.com/lightning/bolts/pull/863 >> </a> >>> [2] <a href=" >> https://www.peerswap.dev/ >> "> >> https://www.peerswap.dev/ >> </a> >>> [3] <a href=" >> https://github.com/JohnLaw2/btc-iids >> "> >> https://github.com/JohnLaw2/btc-iids >> </a> >> >> Sent with [Proton Mail](https://proton.me/) secure email. >> >>>
Good morning John,
Quoted text (3 lines)
> As a result, once the dedicated user decides to splice out some channel funds, the dedicated user cannot access those funds until some time *after* the casual user has been online (provided the protocol is trust-free).
The trick here is that the dedicated user *always* has a splice-out tx available, they don't need to to wait for the casual user to reconnect. At every update of the channel, the casual user will sign a splice tx that lets the dedicated user get some of their funds back in case the casual user goes offline for a long duration. But that splice tx will indeed be csv-delayed.
Most of the time those splice-out txs will simply be discarded the next time the channel is updated, but it gives the dedicated user a guarantee that they're able to get some funds back easily without closing the channel if they need it.
Quoted text (8 lines)
> Given this observation, what if the protocol were changed so that, instead of pre-signing a splice transaction, the casual user always checks in with the dedicated user whenever they check the blockchain? At such a check-in, if the dedicated user wants to splice out some channel funds, they send the casual user a splice transaction which splices out some of the funds to the dedicated user without requiring a to_self delay. The casual user then signs the splice transaction and returns the signature as part of the check-in.
Yes, that is something we'll have as well. On the LSP side, we'll most likely try to get the mobile user to connect and negotiate a splice-out without any delays. If the mobile user doesn't connect, then we'll use the pre-signed delayed splice-out we have from the latest channel state update.
Sorry if this is very hand-wavy, we haven't worked on the details yet, but at a high-level, this is the kind of flexibility we'd like to have.
Quoted text (4 lines)
> However, if we eventually get to the point where the blockchain is highly-contested and fees are high, it may no longer be worth paying the fees to put a splice transaction on-chain unless a large amount of capital is at stake for a long period of time.
That's true, we're currently using the assumption that fees will be high but there will be regular opportunities to get txs confirmed at a lower feerate because of random fluctuations in mempool congestion. If that doesn't happen, funds will most likely be idle and we won't use those splices very often.
Cheers, Bastien
Le lun. 31 oct. 2022 à 01:20, jlspc <jlspc at protonmail.com> a écrit :
Quoted text (176 lines)
> Hi Bastien, > > Thanks for your detailed response. > > I see how the use of a pre-signed "splice" transaction that allows the dedicated user to obtain some of their capital creates an inherent trade-off between the dedicated user's capital efficiency and the casual user's ability to be offline for an extended period of time. > > In order for the use of a pre-signed splice transaction to be safe, the casual user has to check the blockchain and see the splice transaction before it can be spent by the dedicated user (in order to revoke it if needed). As a result, once the dedicated user decides to splice out some channel funds, the dedicated user cannot access those funds until some time *after* the casual user has been online (provided the protocol is trust-free). > > Given this observation, what if the protocol were changed so that, instead of pre-signing a splice transaction, the casual user always checks in with the dedicated user whenever they check the blockchain? At such a check-in, if the dedicated user wants to splice out some channel funds, they send the casual user a splice transaction which splices out some of the funds to the dedicated user without requiring a to_self delay. The casual user then signs the splice transaction and returns the signature as part of the check-in. > > This approach has a couple potential advantages: > 1) It allows the dedicated user to splice out funds as soon as the casual user comes online (rather than sometime after the casual user comes online, as shown above). Therefore, the use of capital is made more efficient. > 2) It allows the splice transaction to pay fees based on the current fee rate, rather than a pre-calculated fee rate. > > It does have some potential disadvantages: > 1) It requires the casual user to stay online long enough to complete the roundtrip of sending a check-in message to the dedicated user, getting the splice message to sign, signing it, and sending the signature back to the dedicated user. > 2) It assumes that the casual user checks the blockchain themselves, rather than using a watchtower service. > 3) It requires the dedicated user to decide at the time of the check-in whether or not to perform the splice, as the splice transaction cannot be revoked. > > In any case, using a check-in and a non-revokable splice transaction appears to have some advantages in terms of capital efficiency. It's also somewhat more compatible with the WF protocol, as the delay for the dedicated user to obtain spliced-out funds is dependent on the actual time until the casual user next comes online, rather than the worst-case delay until the casual user comes online. This could be a big difference if the casual user is typically online every day, but doesn't want the burden of having to be online every day (or every week). I'm interested in your thoughts on this. > > Finally, I understand that the ability to quickly splice out channel funds to improve capital efficiency is critical in the current environment. However, if we eventually get to the point where the blockchain is highly-contested and fees are high, it may no longer be worth paying the fees to put a splice transaction on-chain unless a large amount of capital is at stake for a long period of time. > > Regards, > John > > > > > Sent with Proton Mail <https://proton.me/> secure email. > > ------- Original Message ------- > On Monday, October 24th, 2022 at 2:50 AM, Bastien TEINTURIER < > bastien at acinq.fr> wrote: > > Hi John, > > > My understanding of the current Lightning protocol is that users specify > a to_self_delay safety parameter which is typically about 2 weeks and that > they pay for routing, but not for their partner's cost-of-capital. Is that > correct? > > > > If it is, then when a dedicated user (DLU) partners with a casual user > (CLU), the DLU can only move liquidity to another Lightning channel by > either: > > 1) getting the CLU to sign a cooperative close transaction that enables > (or directly implements) the desired movement of funds, or > > 2) putting a non-cooperative close transaction on-chain and waiting > approximately 2 weeks (based on the to_self_delay parameter set by the CLU) > before moving the liquidity. > > That's correct, but that's something we intend to change to let LSPs > re-allocate their liquidity more frequently and more efficiently. > > We don't have a fully specified proposal yet, but by leveraging a > mechanism similar to splicing [1], mobile users would pre-sign a > transaction that keeps the channel open, but lets the LSP get their > balance (or part of it) out non-interactively. This would be used by > LSPs if the user isn't using their channel actively enough and the LSP > is low on available liquidity for other, more active users. > > This transaction would need to be revokable and must be delayed, since > we still need the user to be able to punish malicious LSPs, but ideally > (from the LSP's point of view) that delay should be at most 1 week, which > forces users to regularly check the blockchain (which isn't ideal). > > It really is a trade-off to be able to lower the fees LSPs make users > pay for liquidity, because LSPs know they can move it cheaply when it > becomes necessary. I can see a future where users chose their trade-off: > pay more to be able to go offline for longer periods or pay less but > check the blockchain regularly. The same LSP could offer both features, > if they're able to price them correctly (which isn't trivial). > > > My intuition is that in the long run, the cost of bitcoin capital will > be very low, as it is an inherently deflationary monetary unit (and thus > its value should increase with time). If this is correct, the long term > cost-of-capital charges should be very low. > > I'm not convinced by that...even though the value of capital increases > with time, liquidity providers will compete to earn more return on their > locked capital. If one liquidity provider is able to use their capital > more efficiently than another, they will be able to offer lower prices > to their customers to a point that isn't economically viable for the > other, less efficient liquidity provider? > > Since lightning doesn't allow any form of fractional reserve, the total > available capital needs to be split between all existing users of the > system, which is very inconvenient when trying to onboard a high number > of new users. > > This is very theoretical though, I have absolutely no idea how those > dynamics will actually play out, but it will be interesting to watch it > unfold. > > Cheers, > Bastien > > [1] https://github.com/lightning/bolts/pull/863 > > Le mer. 12 oct. 2022 à 02:11, jlspc <jlspc at protonmail.com> a écrit : > >> >> Hey Bastien, >> >> Thanks for your reply. >> >> Responses are in-line below: >> >> > Hey John, >> > >> > Thanks for sharing, this is very interesting. >> > >> > There is a good insight here that we can remove the intermediate >> > HTLC-timeout transaction for outgoing payments because we are the >> > origin of that payment (and thus don't need to quickly claim the >> > HTLC on-chain to then relay that failure to a matching incoming HTLC). >> > >> > More generally, you have perfectly identified that most of the >> > complexity of today's transactions come from the need to ensure that >> > a failing/malicious downstream channel doesn't negatively impact >> > honest upstream channels when relaying payments, and that some of this >> > complexity can be lifted when nodes don't relay payments. >> >> Thanks! >> >> > However, my main criticism of your proposal is that liquidity isn't free. >> > While your improvements are great from the CLU's point of view, I'm not >> > sure they're acceptable for the DLU. The main (probably only) job of an >> > LSP (DLU in your terminology) is to efficiently allocate their liquidity. >> > In order to do so, they must be able to quickly move liquidity from where >> > it's unused to where it may be better used. That means closely watching >> > the demand for block space and doing on-chain transactions when fees are >> > low (to open/close channels, splice funds in/out [1], make peer swaps [2], >> > etc). With your proposal, DLUs won't be able to quickly move liquidity >> > around, so the only way to make up for this is to charge the CLU for the >> > loss of expected revenue. I'm afraid that the amount DLUs would need to >> > charge CLUs will be prohibitively expensive for most CLUs. >> > >> > I'm curious to get your feedback on that point. >> >> I really appreciate your insight here. I'm just an interested observer who doesn't have experience with creating and deploying Lightning nodes, so I'm sure you have a better understanding of the current costs and trade-offs than I do. >> >> My understanding of the current Lightning protocol is that users specify a to_self_delay safety parameter which is typically about 2 weeks and that they pay for routing, but not for their partner's cost-of-capital. Is that correct? >> >> If it is, then when a dedicated user (DLU) partners with a casual user (CLU), the DLU can only move liquidity to another Lightning channel by either: >> 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements) the desired movement of funds, or >> 2) putting a non-cooperative close transaction on-chain and waiting approximately 2 weeks (based on the to_self_delay parameter set by the CLU) before moving the liquidity. >> >> In contrast, with the Watchtower-Free (WF) protocol, the DLU could only move liquidity to another Lightning channel by either: >> 1) getting the CLU to sign a cooperative close transaction that enables (or directly implements), the desired movement of funds, or >> 2) putting a non-cooperative close transaction on-chain and waiting approximately 1-3 months (based on the I_L parameter set by the CLU) before moving the liquidity. >> In case 1), it would make sense for the DLU to refund the remaining portion of CLU's cost-of-capital pre-payment to the CLU, as that capital is now being made available to the DLU. This was not proposed in the paper, but it should probably be added. >> >> With this change (namely refunding the remainder of the cost-of-capital pre-payment), it seems like the only disadvantage of the WF protocol to the DLU is the larger delay (1-3 months vs. 2 weeks). Do you feel increasing the delay from 2 weeks to 1 month is prohibitive? >> >> My intuition is that in the long run, the cost of bitcoin capital will be very low, as it is an inherently deflationary monetary unit (and thus its value should increase with time). If this is correct, the long term cost-of-capital charges should be very low. >> >> What are your thoughts on this? >> >> Thanks, >> John >> >> > Thanks again for sharing, and for the inherited IDs [3] proposal as well! >> > >> > Bastien >> > >> > [1] <a href="https://github.com/lightning/bolts/pull/863">https://github.com/lightning/bolts/pull/863</a> >> > [2] <a href="https://www.peerswap.dev/">https://www.peerswap.dev/</a> >> > [3] <a href="https://github.com/JohnLaw2/btc-iids">https://github.com/JohnLaw2/btc-iids</a> >> >> >> Sent with Proton Mail <https://proton.me/> secure email. >> >> >> >