Add an experimental +100 offset to the 0FC feature bit
What changed, and why it matters
This commit moves an experimental Lightning network feature bit from position 41 to position 141 (a +100 offset) while keeping the same user-facing names. It appears to be a protocol-compatibility change to avoid clashing with the official BOLTs feature bit while testing. There is no direct evidence in the commit of a security vulnerability being fixed.
Treat as a normal protocol-compatibility update. Reviewers should verify that the +100 offset correctly avoids collisions with other experimental or reserved feature bits and that the renamed staging feature does not break interoperability with nodes expecting the old bit 41. No immediate security response is indicated by the diff alone.
Security signals we found
Feature bit relocation to avoid conflict with a BOLTs-reserved bit
No cryptographic, parsing, or memory-safety code changed
No bounds checks or validation logic modified
Experimental/staging naming suggests pre-standard behavior
Evidence from the diff
The patch redefines AnchorZeroFeeCommitments as AnchorZeroFeeCommitmentsStaging at feature bit 141 instead of 41, adding +100 to the BOLTs PR’s proposed 40/41 bits. The macro-generated accessor names (set_anchor_zero_fee_commitments_optional, supports_anchor_zero_fee_commitments, etc.) remain unchanged, so the public API is preserved. The feature is moved to byte 17 in the feature-bit arrays for InitContext, NodeContext, and ChannelTypeContext. This is a staged/experimental feature bit relocation, not a logic change.
Changed components
lightning-types/src/features.rsFeature bit definitions for InitContext, NodeContext, ChannelTypeContextChannelTypeFeatures::anchors_zero_fee_commitments constructorInspect captured patch +31 / −19
diff --git a/lightning-types/src/features.rs b/lightning-types/src/features.rs
index fda36b2..b35cba4 100644
--- a/lightning-types/src/features.rs
+++ b/lightning-types/src/features.rs
@@ -162,13 +162,17 @@ mod sealed {
// Byte 4
Quiescence | OnionMessages,
// Byte 5
- ProvideStorage | ChannelType | SCIDPrivacy | AnchorZeroFeeCommitments,
+ ProvideStorage | ChannelType | SCIDPrivacy,
// Byte 6
ZeroConf,
// Byte 7
Trampoline | SimpleClose | Splice,
- // Byte 8 - 130
- ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
+ // Byte 8 - 16
+ ,,,,,,,,,
+ // Byte 17
+ AnchorZeroFeeCommitmentsStaging,
+ // Byte 18 - 130
+ ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// Byte 131
HtlcHold,
]
@@ -187,13 +191,17 @@ mod sealed {
// Byte 4
Quiescence | OnionMessages,
// Byte 5
- ProvideStorage | ChannelType | SCIDPrivacy | AnchorZeroFeeCommitments,
+ ProvideStorage | ChannelType | SCIDPrivacy,
// Byte 6
ZeroConf | Keysend,
// Byte 7
Trampoline | SimpleClose | Splice,
- // Byte 8 - 31
- ,,,,,,,,,,,,,,,,,,,,,,,,
+ // Byte 8 - 16
+ ,,,,,,,,,
+ // Byte 17
+ AnchorZeroFeeCommitmentsStaging,
+ // Byte 18 - 31
+ ,,,,,,,,,,,,,,
// Byte 32
DnsResolver,
// Byte 33 - 130
@@ -256,9 +264,13 @@ mod sealed {
// Byte 4
,
// Byte 5
- SCIDPrivacy | AnchorZeroFeeCommitments,
+ SCIDPrivacy,
// Byte 6
ZeroConf,
+ // Byte 7 - 16
+ ,,,,,,,,,,
+ // Byte 17
+ AnchorZeroFeeCommitmentsStaging,
]);
/// Defines a feature with the given bits for the specified [`Context`]s. The generated trait is
@@ -594,17 +606,6 @@ mod sealed {
supports_onion_messages,
requires_onion_messages
);
- define_feature!(
- 41,
- AnchorZeroFeeCommitments,
- [InitContext, NodeContext, ChannelTypeContext],
- "Feature flags for `option_zero_fee_commitments`.",
- set_anchor_zero_fee_commitments_optional,
- set_anchor_zero_fee_commitments_required,
- clear_anchor_zero_fee_commitments,
- supports_anchor_zero_fee_commitments,
- requires_anchor_zero_fee_commitments
- );
define_feature!(
43,
ProvideStorage,
@@ -698,6 +699,17 @@ mod sealed {
// By default, allocate enough bytes to cover up to Splice. Update this as new features are
// added which we expect to appear commonly across contexts.
pub(super) const MIN_FEATURES_ALLOCATION_BYTES: usize = (63 + 7) / 8;
+ define_feature!(
+ 141, // The BOLTs PR uses feature bit 40/41, so add +100 for the experimental bit
+ AnchorZeroFeeCommitmentsStaging,
+ [InitContext, NodeContext, ChannelTypeContext],
+ "Feature flags for `option_zero_fee_commitments`.",
+ set_anchor_zero_fee_commitments_optional,
+ set_anchor_zero_fee_commitments_required,
+ clear_anchor_zero_fee_commitments,
+ supports_anchor_zero_fee_commitments,
+ requires_anchor_zero_fee_commitments
+ );
define_feature!(
259,
DnsResolver,
@@ -1074,7 +1086,7 @@ impl ChannelTypeFeatures {
/// Constructs a ChannelTypeFeatures with zero fee commitment anchors support.
pub fn anchors_zero_fee_commitments() -> Self {
let mut ret = Self::empty();
- <sealed::ChannelTypeContext as sealed::AnchorZeroFeeCommitments>::set_required_bit(
+ <sealed::ChannelTypeContext as sealed::AnchorZeroFeeCommitmentsStaging>::set_required_bit(
&mut ret,
);
ret
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.