Skip to content

Commit 417c626

Browse files
committed
More conservative cltv_expiry_delta recommendations
Many channels use a value below 6, which is really insecure (there are more than 2k such channels on mainnet). While less risky, there are more than 7k channels with a value below 12. This indicates that the spec should probably make the risks a bit more clear to help guide node operators.
1 parent 9e8e29a commit 417c626

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

02-peer-protocol.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -740,16 +740,19 @@ the longest possible time to redeem it on-chain:
740740
Thus, the worst case is `3R+2G+2S`, assuming `R` is at least 1. Note that the
741741
chances of three reorganizations in which the other node wins all of them is
742742
low for `R` of 2 or more. Since high fees are used (and HTLC spends can use
743-
almost arbitrary fees), `S` should be small; although, given that block times are
744-
irregular and empty blocks still occur, `S=2` should be considered a
745-
minimum. Similarly, the grace period `G` can be low (1 or 2), as nodes are
746-
required to timeout or fulfill as soon as possible; but if `G` is too low it increases the
747-
risk of unnecessary channel closure due to networking delays.
743+
almost arbitrary fees), `S` should be small during normal operation; although,
744+
given that block times are irregular, empty blocks still occur, and fees may
745+
vary greatly, `S=2` should be considered a minimum. `S` is also the parameter
746+
that may vary the most under attack, so a higher value may be desirable when
747+
non negligible amounts are engaged. The grace period `G` can be low (1 or 2),
748+
as nodes are required to timeout or fulfill as soon as possible; but if `G` is
749+
too low it increases the risk of unnecessary channel closure due to networking
750+
delays.
748751

749752
There are four values that need be derived:
750753

751754
1. the `cltv_expiry_delta` for channels, `3R+2G+2S`: if in doubt, a
752-
`cltv_expiry_delta` of 12 is reasonable (R=2, G=1, S=2).
755+
`cltv_expiry_delta` of at least 12 is reasonable (R=2, G=1, S=2).
753756

754757
2. the deadline for offered HTLCs: the deadline after which the channel has to be failed
755758
and timed out on-chain. This is `G` blocks after the HTLC's

0 commit comments

Comments
 (0)