Skip to content

fix(rgb): settle RGB on justice sweeps and color both views - #43

Open
ABallarini wants to merge 1 commit into
RGB-Tools:rgbfrom
ABallarini:fix/penalty-transaction
Open

ABallarini wants to merge 1 commit into
RGB-Tools:rgbfrom
ABallarini:fix/penalty-transaction

Conversation

@ABallarini

Copy link
Copy Markdown

Summary

Justice (penalty) sweeps now carry the channel's RGB state transition, so the RGB assigned to the revoked commitment settles for the honest peer instead of being burned. Every node also colors both commitment views of each state, so whichever commitment is broadcast, both nodes hold its allocation.

  • color_claim: colors only the revoked vouts the justice actually spends; inputs grouped by spent txid, so justice packages spanning several revoked transactions are handled.
  • color_commitment/color_closing: rgb-lib errors map to ChannelError::close instead of panicking; all channel.rs call sites handle the result (?, logged abort, or logged skip).
  • Runtime ldk_data_dir threaded through the monitor into OnchainTxHandler (never serialized) so the justice path can locate the {txid}_transfer_info files.
  • Per-commitment blinding: commitment seals are witness-relative, so a shared blinding made the two sibling commitments of one state produce content-identical transitions (same OpId) and let consignment generation pick the never-broadcast witness. The blinding is now derived from the uncolored commitment txid, identically on both nodes.

Verified end-to-end by RGB-Tools/rgb-lightning-node#172.

Documentation: https://hackmd.io/@6IaNVzsDRAeobScrx7A32A/rk4MN39sMx

@ABallarini
ABallarini force-pushed the fix/penalty-transaction branch from e3c74f8 to 16e3faf Compare October 14, 2026 11:05
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.

1 participant