-
Notifications
You must be signed in to change notification settings - Fork 512
More conservative cltv_expiry_delta
recommendations
#785
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -744,7 +744,7 @@ almost arbitrary fees), `S` should be small during normal operation; although, | |
given that block times are irregular, empty blocks still occur, fees may vary | ||
greatly, and the fees cannot be bumped on HTLC transactions, `S=12` should be | ||
considered a minimum. `S` is also the parameter that may vary the most under | ||
attack, so a higher value may be desirable when non negligible amounts are at | ||
attack, so a higher value may be desirable when non-negligible amounts are at | ||
risk. The grace period `G` can be low (1 or 2), as nodes are required to timeout | ||
or fulfill as soon as possible; but if `G` is too low it increases the risk of | ||
unnecessary channel closure due to networking delays. | ||
|
@@ -766,7 +766,7 @@ There are four values that need be derived: | |
4. the minimum `cltv_expiry` accepted for terminal payments: the | ||
worst case for the terminal node C is `2R+G+S` blocks (as, again, steps | ||
1-3 above don't apply). The default in [BOLT #11](11-payment-encoding.md) is | ||
9, which is less conservative than the 18 that this calculation suggests. | ||
18, which matches this calculation. | ||
This comment was marked as abuse.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this is more an implementation concern than a spec concern, and all implementations naturally did it the other way around (sending a higher value than what the spec recommends to accommodate for such things). |
||
|
||
#### Requirements | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -140,7 +140,7 @@ Currently defined tagged fields are: | |
* `n` (19): `data_length` 53. 33-byte public key of the payee node | ||
* `h` (23): `data_length` 52. 256-bit description of purpose of payment (SHA256). This is used to commit to an associated description that is over 639 bytes, but the transport mechanism for the description in that case is transport specific and not defined here. | ||
* `x` (6): `data_length` variable. `expiry` time in seconds (big-endian). Default is 3600 (1 hour) if not specified. | ||
* `c` (24): `data_length` variable. `min_final_cltv_expiry` to use for the last HTLC in the route. Default is 9 if not specified. | ||
* `c` (24): `data_length` variable. `min_final_cltv_expiry` to use for the last HTLC in the route. Default is 18 if not specified. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. doesn't this need to be conditioned on the context of sender/receiver? i.e., the default is 9 when receiving but 18 when sending? it is also worth asking whether making this distinction is necessary, or just changing to always set explicit values is good enough until we remove the behavior that assumes a CLTV when none is present There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
This is what's done in eb946f0: the receiver now MUST explicitly specify this value, and the sender should use 18 if it's not specified (backwards-compatibility). We want the value |
||
* `f` (9): `data_length` variable, depending on version. Fallback on-chain address: for Bitcoin, this starts with a 5-bit `version` and contains a witness program or P2PKH or P2SH address. | ||
* `r` (3): `data_length` variable. One or more entries containing extra routing information for a private route; there may be more than one `r` field | ||
* `pubkey` (264 bits) | ||
|
This comment was marked as abuse.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Of course, but that doesn't make these recommendations obsolete, on the contrary! It will need to be coupled with other techniques (e.g. limiting your exposure in the number of channels with nodes you don't trust) but in any case, you'll want high enough deltas.