1
0
mirror of https://github.com/lightning/bolts.git synced 2024-11-19 01:50:03 +01:00

BOLT 9: assume var_onion_optin.

Advertized as supported by all but 6 nodes (and those can no longer
route payments since people only send the modern onion these days)

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2024-04-09 05:48:14 +09:30 committed by neil saitug
parent c48b4e3b27
commit e042c615ef
4 changed files with 14 additions and 14 deletions

View File

@ -742,7 +742,7 @@ affect the channel operation).
The currently defined basic types are: The currently defined basic types are:
- `option_static_remotekey` (bit 12) - `option_static_remotekey` (bit 12)
- `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12) - `option_anchors` and `option_static_remotekey` (bits 22 and 12)
Each basic type has the following variations allowed: Each basic type has the following variations allowed:
- `option_scid_alias` (bit 46) - `option_scid_alias` (bit 46)
@ -968,8 +968,8 @@ Both peers:
- if `channel_type` was present in both `open_channel` and `accept_channel`: - if `channel_type` was present in both `open_channel` and `accept_channel`:
- This is the `channel_type` (they must be equal, required above) - This is the `channel_type` (they must be equal, required above)
- otherwise: - otherwise:
- if `option_anchors_zero_fee_htlc_tx` was negotiated: - if `option_anchors` was negotiated:
- the `channel_type` is `option_anchors_zero_fee_htlc_tx` and `option_static_remotekey` (bits 22 and 12) - the `channel_type` is `option_anchors` and `option_static_remotekey` (bits 22 and 12)
- otherwise: - otherwise:
- the `channel_type` is `option_static_remotekey` (bit 12) - the `channel_type` is `option_static_remotekey` (bit 12)
- MUST use that `channel_type` for all commitment transactions. - MUST use that `channel_type` for all commitment transactions.
@ -989,15 +989,15 @@ The recipient:
#### Rationale #### Rationale
We decide on We decide on
`option_anchors_zero_fee_htlc_tx` at this point when we first have to generate `option_anchors` at this point when we first have to generate
the commitment transaction. The feature bits that were communicated in the the commitment transaction. The feature bits that were communicated in the
`init` message exchange for the current connection determine the channel `init` message exchange for the current connection determine the channel
commitment format for the total lifetime of the channel. Even if a later commitment format for the total lifetime of the channel. Even if a later
reconnection does not negotiate this parameter, this channel will continue to reconnection does not negotiate this parameter, this channel will continue to
use `option_static_remotekey` or use `option_static_remotekey` or
`option_anchors_zero_fee_htlc_tx`; we don't support "downgrading". `option_anchors`; we don't support "downgrading".
`option_anchors_zero_fee_htlc_tx` is considered superior to `option_anchors` is considered superior to
`option_static_remotekey`, and the superior one is favored if more than one `option_static_remotekey`, and the superior one is favored if more than one
is negotiated. is negotiated.

View File

@ -427,13 +427,13 @@ Note the reference to the "base fee" for a commitment transaction in the require
#### Requirements #### Requirements
The fee for an HTLC-timeout transaction: The fee for an HTLC-timeout transaction:
- If `option_anchors_zero_fee_htlc_tx` applies: - If `option_anchors` applies:
1. MUST be 0. 1. MUST be 0.
- Otherwise, MUST be calculated to match: - Otherwise, MUST be calculated to match:
1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down). 1. Multiply `feerate_per_kw` by 663 and divide by 1000 (rounding down).
The fee for an HTLC-success transaction: The fee for an HTLC-success transaction:
- If `option_anchors_zero_fee_htlc_tx` applies: - If `option_anchors` applies:
1. MUST be 0. 1. MUST be 0.
- Otherwise, MUST be calculated to match: - Otherwise, MUST be calculated to match:
1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down). 1. Multiply `feerate_per_kw` by 703 and divide by 1000 (rounding down).
@ -2172,7 +2172,7 @@ before subtraction of:
] ]
``` ```
# Appendix G: Commitment and HTLC Transaction Test Vectors (anchors_zero_fee_htlc_tx) # Appendix G: Commitment and HTLC Transaction Test Vectors (anchors_zero)
The anchor test vectors are based on the test cases as defined in appendix C. The anchor test vectors are based on the test cases as defined in appendix C.
Note that in appendix C, `to_local_msat` and `to_remote_msat` are balances Note that in appendix C, `to_local_msat` and `to_remote_msat` are balances

View File

@ -597,7 +597,7 @@ HTLC signatures received from the peer, as this allows HTLC transactions to be c
other transactions. The local signature MUST use `SIGHASH_ALL`, otherwise other transactions. The local signature MUST use `SIGHASH_ALL`, otherwise
anyone can attach additional inputs and outputs to the tx. anyone can attach additional inputs and outputs to the tx.
If `option_anchors_zero_fee_htlc_tx` applies, then the HTLC-timeout and If `option_anchors` applies, then the HTLC-timeout and
HTLC-success transactions are signed with the input and output having the same HTLC-success transactions are signed with the input and output having the same
value. This means they have a zero fee and MUST be combined with other inputs value. This means they have a zero fee and MUST be combined with other inputs
to arrive at a reasonable fee. to arrive at a reasonable fee.
@ -606,7 +606,7 @@ to arrive at a reasonable fee.
A node which broadcasts an HTLC-success or HTLC-timeout transaction for a A node which broadcasts an HTLC-success or HTLC-timeout transaction for a
commitment transaction: commitment transaction:
1. if `option_anchors_zero_fee_htlc_tx` applies: 1. if `option_anchors` applies:
- MUST combine it with inputs contributing sufficient fee to ensure timely - MUST combine it with inputs contributing sufficient fee to ensure timely
inclusion in a block. inclusion in a block.
- MAY combine it with other transactions. - MAY combine it with other transactions.

View File

@ -36,14 +36,14 @@ The Context column decodes as follows:
| 3 | `initial_routing_sync` | Sending node needs a complete routing information dump | I | | [BOLT #7][bolt07-sync] | | 3 | `initial_routing_sync` | Sending node needs a complete routing information dump | I | | [BOLT #7][bolt07-sync] |
| 4/5 | `option_upfront_shutdown_script` | Commits to a shutdown scriptpubkey when opening channel | IN | | [BOLT #2][bolt02-open] | | 4/5 | `option_upfront_shutdown_script` | Commits to a shutdown scriptpubkey when opening channel | IN | | [BOLT #2][bolt02-open] |
| 6/7 | `gossip_queries` | More sophisticated gossip control | IN | | [BOLT #7][bolt07-query] | | 6/7 | `gossip_queries` | More sophisticated gossip control | IN | | [BOLT #7][bolt07-query] |
| 8/9 | `var_onion_optin` | Requires/supports variable-length routing onion payloads | IN9 | | [Routing Onion Specification][bolt04] | | 8/9 | `var_onion_optin` | ASSUMED | | | |
| 10/11 | `gossip_queries_ex` | Gossip queries can include additional information | IN | `gossip_queries` | [BOLT #7][bolt07-query] | | 10/11 | `gossip_queries_ex` | Gossip queries can include additional information | IN | `gossip_queries` | [BOLT #7][bolt07-query] |
| 12/13 | `option_static_remotekey` | ASSUMED | | | | | 12/13 | `option_static_remotekey` | ASSUMED | | | |
| 14/15 | `payment_secret` | Node supports `payment_secret` field | IN9 | `var_onion_optin` | [Routing Onion Specification][bolt04] | | 14/15 | `payment_secret` | Node supports `payment_secret` field | IN9 | | [Routing Onion Specification][bolt04] |
| 16/17 | `basic_mpp` | Node can receive basic multi-part payments | IN9 | `payment_secret` | [BOLT #4][bolt04-mpp] | | 16/17 | `basic_mpp` | Node can receive basic multi-part payments | IN9 | `payment_secret` | [BOLT #4][bolt04-mpp] |
| 18/19 | `option_support_large_channel` | Can create large channels | IN | | [BOLT #2](02-peer-protocol.md#the-open_channel-message) | | 18/19 | `option_support_large_channel` | Can create large channels | IN | | [BOLT #2](02-peer-protocol.md#the-open_channel-message) |
| 22/23 | `option_anchors` | Anchor commitment type with zero fee HTLC transactions | IN | | [BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful] | | 22/23 | `option_anchors` | Anchor commitment type with zero fee HTLC transactions | IN | | [BOLT #3][bolt03-htlc-tx], [lightning-dev][ml-sighash-single-harmful] |
| 24/25 | `option_route_blinding` | Node supports blinded paths | IN9 | `var_onion_optin` | [BOLT #4](bolt04-route-blinding) | | 24/25 | `option_route_blinding` | Node supports blinded paths | IN9 | | [BOLT #4](bolt04-route-blinding) |
| 26/27 | `option_shutdown_anysegwit` | Future segwit versions allowed in `shutdown` | IN | | [BOLT #2][bolt02-shutdown] | | 26/27 | `option_shutdown_anysegwit` | Future segwit versions allowed in `shutdown` | IN | | [BOLT #2][bolt02-shutdown] |
| 28/29 | `option_dual_fund` | Use v2 of channel open, enables dual funding | IN | | [BOLT #2](02-peer-protocol.md) | | 28/29 | `option_dual_fund` | Use v2 of channel open, enables dual funding | IN | | [BOLT #2](02-peer-protocol.md) |
| 38/39 | `option_onion_messages` | Can forward onion messages | IN | | [BOLT #7](04-onion-routing.md#onion-messages) | | 38/39 | `option_onion_messages` | Can forward onion messages | IN | | [BOLT #7](04-onion-routing.md#onion-messages) |