A couple questions about sequence number: [combined summary]



Individual post summaries: Click here to read the original discussion on the lightning-dev mailing list

Published on: 2015-08-10T19:08:38+00:00


Summary:

The relative lock time (RCLTV) is used in Lightning, a payment channel network built on top of Bitcoin, to prevent channels from expiring automatically. RCLTV allows channels to stay open until there is a need to reclaim funds from a permanently offline hub. Channels can potentially remain active indefinitely through rebalancing of funds via users having multiple channels and being paid negative fees to move funds back to channels low on liquidity. In Lightning, the sequence number field of the transaction format is used to achieve relative lock-time. BIP 68 specifies a new consensus rule that mandates a required minimum age for each input, allowing for the implementation of relative lock-times. The sequence number of the spending transaction must meet certain criteria to determine when a script pathway takes effect. For example, if a script pathway should only take effect 30 days after confirmation of the parent, the sequence number of the spending transaction must be equal to MAX_INT - 4320 (= 144 * 30).A user named Jeremy Rubin raises concerns about the use of sequence numbers in Lightning. He questions the potential race conditions and how they are addressed in terms of blockchain height. He also highlights the issue of using sequence numbers to select the right transaction, which could leak information about the number of LN transactions and make it meterable by external parties such as miners. He suggests incrementing the sequence number by a random amount to alleviate reliable metering.Another user, Jorge Timón, expresses his opinion that the "number inversion" to preserve old nSequence semantics may not be worth it. He suggests simplifying the documentation by renaming nSequence to nMaturity and "check sequence verify" to "verify input maturity," but notes that this may not be the appropriate thread to discuss it.Mark Friedenbach provides clarification on the use of sequence numbers in Lightning. He explains how BIP 68 enables the achievement of relative lock-times and confirms that Lightning uses these relative lock-times with sequence numbers to introduce confirmation delays. He also addresses the concerns raised by Jeremy Rubin, providing further details on how sequence numbers are used and suggesting that incrementing by a random amount could alleviate reliable metering.Overall, the discussion revolves around the use of sequence numbers in Lightning, their role in achieving relative lock-times, potential race conditions, leakage of information about LN transactions, and possible solutions to address these concerns.


Updated on: 2023-07-31T18:12:17.216570+00:00