Author: Mark Friedenbach 2015-08-10 15:58:36
Published on: 2015-08-10T15:58:36+00:00
In a discussion on the Lightning-dev mailing list, a clarification was made regarding the use of sequence numbers in the Lightning Network implementation by Rusty. BIP 68 is used to specify a new consensus rule that allows the sequence number field to mandate a required minimum age for each input, achieving a relative lock-time. This means that Lightning uses relative lock-times rather than an increment-on-each-transaction sequence number in the traditional sense. The sequence number field can be used to achieve a confirmation delay of a certain number of blocks after its parent block. For instance, if you want a script pathway to only take effect 30 days after confirmation of the parent, you can set the sequence number of the spending transaction (the child) to be equal to MAX_INT - 4320 (=144*30). In bidirectional payment channels, this value is incremented or decremented each time the payment channel switches direction, regardless of the number of off-chain transactions that have elapsed in between. Jeremy Rubin raised two questions regarding the use of sequence numbers in Lightning. Firstly, he asked about race conditions and how they are addressed with respect to blockchain height. Secondly, he questioned how using sequence numbers to select the right transaction to include could leak information about the number of LN transactions that took place, potentially making it meterable by external parties such as miners.
Updated on: 2023-05-23T19:06:21.575639+00:00