Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this community
Anybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
The Lightning Network Whitepaper describes the concept of Revocable Sequence Maturity Contracts (RSMC), which allows a commitment transaction to be revoked during a predefined delay after the channel gets closed unilaterally. As I understand, this means the channel closer (aka the node who published the transaction) must wait for the delay before claiming his/her invested money and, in the meantime, the counterparty can verify the blockchain to see if the closer published the most recent commitment transaction. If the closer published an old transaction, the counterparty can punish him/her by taking all the money in the channel. BOLT#3 defines this delay as the
to_self_delay variable in a commitment transaction output. However, some aspects about the RSMC implementation remain unclear to me:
- Who defines
to_self_delay? How does the LN ensure the delay is enough for the counterparty to punish a malicious user?
- Can the delay change for each commitment transaction? E.g. can two parties decide to decrease the delay if they trust each other more after some transactions?
Thanks in advance.
According to the protocol specification at BOLT 2 the
open_channel messages suggest
it further says
to_self_delayis the number of blocks that the other node’s to-self outputs must be delayed, using
OP_CHECKSEQUENCEVERIFYdelays; this is how long it will have to wait in case of breakdown before redeeming its own funds.
The sending node SHOULD (…) set to_self_delay sufficient to ensure the sender can irreversibly spend a commitment transaction output, in case of misbehavior by the receiver.
The receiving node MUST fail the channel if (…) the
to_self_delayis unreasonably large.
Similarly without the specifications about size is the
In practice your lightning implementation should have a config value that lets you choose what blocktime you will find comfortable and if someone tries to open a channel and one party is not comfortable with the value of the others the channel will not be opened in the first place.