Skip to content

Fix plain channel interoperability with stock LDK - #36

Open
bitwalt wants to merge 1 commit into
RGB-Tools:rgbfrom
bitwalt:rgb-stock-ldk-interop
Open

Fix plain channel interoperability with stock LDK#36
bitwalt wants to merge 1 commit into
RGB-Tools:rgbfrom
bitwalt:rgb-stock-ldk-interop

Conversation

@bitwalt

@bitwalt bitwalt commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes #35.

Plain channels currently carry RGB-specific transaction and wire changes even when no RGB asset is present, which makes them incompatible with stock LDK peers.

Changes

  • add the RGB OP_RETURN commitment weight only for colored channels
  • encode rgb_payment as an optional odd TLV so stock peers can ignore it
  • omit RGB fields from plain channel announcements and updates while continuing to read the extended RGB forms

RGB channels retain their existing commitment weight and wire fields.

The colored fee helper remains in rgb_utils, and FundingScope passes whether the channel is colored into SpecTxBuilder. get_next_commitment_stats and commitment construction therefore use the same fee calculation.

Validation

RGB-Tools/rgb-lightning-node#149 exercises the changes against a stock ldk-node peer:

  • private channels opened from either side pay in both directions and close cooperatively
  • a public channel opened by stock LDK remains announced, ready, and usable
  • an RGB channel offered to stock LDK never becomes ready

Local validation: cargo check -p lightning --features electrum and git diff --check.

Compatibility

This changes the wire and commitment transaction encoding used by deployed nodes. Fixed and unfixed peers should not operate the same channels across the upgrade; a release carrying this needs a coordinated upgrade. Persisted channel state itself is unchanged.

@bitwalt
bitwalt force-pushed the rgb-stock-ldk-interop branch from 58dba6f to fc3d233 Compare August 12, 2026 21:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Plain channels are not wire-compatible with upstream LDK

1 participant