3

I recently learned about how the lightning network works, and one particular thing that I found interesting is that, to prevent fraud, the output for each commitment transaction contains a clause for the revocation secret. If a bad actor broadcasts a prior state of the payment channel to the blockchain, the other party can use the revocation secret within 24 hours to claim all the money held by the multi-sig address.

My question is, how does the bitcoin blockchain know how to "count" 24 hours? Is there anything programmed in the blockchain for tracking time (e.g. UNIX time)?

1 Answer 1

3

The Lightning Network's timeout to broadcast a justice transaction is measured in blocks, not a specific time. As the Bitcoin network regulates its block interval to approximately 10 minutes, setting a timeout of 144 blocks will give the Lightning user about 24h to react, give or take.

The Bitcoin network itself is not really aware of time, however, every block has a timestamp that generally must be within a couple hours of the actual time for other nodes to accept it. While blocks could have inaccurate timestamps theoretically, most blocks tend to be labeled fairly accurately.

There is another way to specify timelocks in transactions that is not height based, but refers to actual time. For that use, the set time is considered to have passed when the median timestamp of the last 11 blocks exceeds it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.