Skip to content

Draft: Added splicing plumbing - #736

Open
ihordiachenko wants to merge 8 commits into
mainfrom
feature/splicing_support
Open

Draft: Added splicing plumbing#736
ihordiachenko wants to merge 8 commits into
mainfrom
feature/splicing_support

Conversation

@ihordiachenko

@ihordiachenko ihordiachenko commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

Rationale

This PR prepares Greenlight for splicing support without waiting for the VLS side of things. This establishes the CLN API, binding, persistence, and policy boundaries needed for later signer integration.

What Changed

  • Added low-level CLN splice RPC plumbing and v26.06 bindings.
  • Persisted splice sessions, wallet PSBT context, authorization metadata, and outpoint indexes.
  • Captured relevant CLN response facts and linked PSBTs to splice sessions.
  • Added a signer policy resolver that validates known invariants and fails closed at the missing VLS proof boundary.
  • Added trace and regtest coverage for policy decisions and signer rejections.

Trade-offs

  • Splices are exposed via experimental-splicing Cargo feature but cannot complete until VLS provides the required signing proofs.

Handling PBSTs

Greenlight links each splice PSBT to its splice session during SpliceInit and records whether funding and signing were authorized. The signer rejects it unless the link and signing approval are present. Unrelated PSBTs remain outside splice handling and follow the existing signer policy.

@ihordiachenko
ihordiachenko force-pushed the feature/splicing_support branch 2 times, most recently from 8489f30 to dbf8e9b Compare July 21, 2026 15:22
@ihordiachenko
ihordiachenko force-pushed the feature/splicing_support branch from dbf8e9b to 6de2272 Compare July 21, 2026 23:41
@ihordiachenko
ihordiachenko force-pushed the feature/splicing_support branch from 6de2272 to 2b9b71d Compare July 22, 2026 00:53
@ihordiachenko
ihordiachenko marked this pull request as ready for review July 22, 2026 13:19
@ihordiachenko
ihordiachenko requested a review from cdecker July 22, 2026 21:08
) -> clnpb.DecodeResponse:
if description is not None:
raise ValueError("CLN's Decode RPC does not accept a description")
return self.decode(bolt11)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ISSUE] Shouldn't we rather remove the decodepay method, or are we keeping it for backwards compatibility?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was meant for backward compatibility. It was removed in CLN and the updated python bindings, but I wasn't sure if anyone depends on it. But if you are ok with removing it, let's do it

Comment thread libs/gl-client/src/persist.rs Outdated
@@ -1,4 +1,18 @@
mod canonical;
#[allow(dead_code)]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ISSUE] Is this dead-code or should it be a cfg(experimental-splicing) guard?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was genuine dead-code, but it's removed now

Comment thread libs/gl-client/src/persist/splice.rs Outdated
@@ -0,0 +1,2406 @@
use super::canonical::canonical_json_bytes;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ISSUE] This file feels very LLM-generated to be honest, which is fine, but LLMs tend to just open code anything, and this feels like it could be much more concise if we didn't reimplement the PSBT serialization / deserialization ourselves. It'd be a win for maintainability.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point. I refactored this to use the rust-psbt crate instead. It’s part of the rust-bitcoin project, which we already depend on in GL.

Also, after the initial discussion with the VLS team, we decided not to expose the raw splice session state from GL. That should let us trim some of the redundant splice-state fields once the final design settles.

Comment thread libs/gl-client/src/persist/splice.rs Outdated
}

#[derive(Clone, Debug, PartialEq, Eq, Serialize, Deserialize)]
pub struct NormalizedRpcAuth {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[ISSUE] Having some trouble understanding the RpcAuth related things in the splice persistence stuff. What is this for?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea was to keep explicit receipts for user intents for policy evaluation/audit breadcrumbs. But upon second look, it's too much fluff with little gain. Removed

@cdecker

cdecker commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Sorry for the [ISSUE] prefixes in the comments, I'm trying out some new tooling to help with reviews (tuicr a CLI review tool).

@ihordiachenko ihordiachenko changed the title Added splicing plumbing Draft: Added splicing plumbing Aug 10, 2026
@ihordiachenko
ihordiachenko force-pushed the feature/splicing_support branch from 59a5c30 to b543a5b Compare August 11, 2026 17:39
@ihordiachenko
ihordiachenko force-pushed the feature/splicing_support branch from b543a5b to 4b3fa1b Compare August 11, 2026 18:14
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.

2 participants