AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Low 35 Bitcoin

lsps-types: echo valid_until verbatim and send the LSPS0 datetime format

Public commit record

What the developer wrote

Authored by Peter Neuroth

85/100 · Strong
lsps-types: echo valid_until verbatim and send the LSPS0 datetime format

bLIP-52, "2. Request JIT Channel":

Clients MUST copy it verbatim from an entry of
`opening_fee_params_menu` from a result of a `lsps2.get_info` call.

bLIP-50, LSPS0.datetime:

Particular points of time in the modern era (a "datetime") MUST be
encoded as a JSON string containing the [ISO 8601][] format
`"YYYY-MM-DDThh:mm:ss.uuuZ"`.
These are always in the UTC timezone.

`DateTime` was serialized by chrono, which writes as many fractional
digits as needed: a spec-conforming "2023-02-23T08:47:30.000Z" from an
LSP came back from the client as "2023-02-23T08:47:30Z", and
"...30.5112Z" as "...30.511200Z". That only worked because the in-tree
service checks its promise against the parsed value; an LSP that
checks the string it sent would reject the client. The service itself
sent whole seconds without the milliseconds.

`DateTime` now keeps the string it was deserialized from and serializes
it back unchanged. A datetime built from a chrono value is truncated to
milliseconds and serialized as `YYYY-MM-DDThh:mm:ss.uuuZ`. Equality,
ordering and hashing still only compare the point in time. Parsing is
unchanged. `DateTime` is no longer `Copy`.

The service builds the `valid_until` it sends from the policy plugin's
value this way and computes the promise over the truncated value, so
the promise still verifies on what the client echoes.

Behavior change: the client echoes `valid_until` exactly as received;
the service sends `valid_until` with millisecond precision in the
LSPS0 format.

Changelog-Fixed: lsps-plugin: the LSPS2 client now copies `opening_fee_params` verbatim (including `valid_until`), and the service sends `valid_until` in the LSPS0 datetime format.
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Explains rationale or failure mode
The short version

What changed, and why it matters

This commit fixes a protocol-compatibility bug in Core Lightning's LSPS (Lightning Service Provider Specification) support. When a client received an opening-fee offer from a service provider, it was accidentally changing the exact timestamp text before echoing it back. Some strict providers would then reject the client's reply because the timestamp no longer matched. The fix makes the client preserve the original timestamp text exactly, and makes the service send timestamps in the precise format the spec requires. There is no direct theft-of-funds or remote-code-execution vulnerability here, but the bug could cause legitimate JIT-channel requests to fail.

Recommended action

Treat as a recommended bug-fix patch for anyone running the LSPS plugin or LSPS2 client. It improves interoperability and prevents spurious JIT-channel rejections. No emergency response is warranted; review and include in the next maintenance release.

Security signals we found

01

Protocol compliance fix for LSPS0 datetime serialization

02

Client-side echo of opening_fee_params now verbatim per bLIP-52

03

Service-side promise computed over truncated spec-format datetime

04

Potential denial-of-service/interoperability failure for JIT channel opening

05

No memory safety, cryptographic bypass, or authorization bypass observed

Risk score

Why this scored 35/100

Our methodology →
Potential impact 8/30
Exploitability 5/25
Stealth signal 4/15
Affected reach 6/15
Confidence 8/10
Evidence quality 4/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.