Skip to content

feat: Add client_info to LSPS1, LSPS7, and Flow requests#3810

Merged
kaloudis merged 1 commit intoZeusLN:masterfrom
kaloudis:client_info
Mar 9, 2026
Merged

feat: Add client_info to LSPS1, LSPS7, and Flow requests#3810
kaloudis merged 1 commit intoZeusLN:masterfrom
kaloudis:client_info

Conversation

@kaloudis
Copy link
Copy Markdown
Contributor

@kaloudis kaloudis commented Mar 8, 2026

Description

Summary

  • Adds client_info to LSPS1, LSPS7, and Flow (JIT) channel requests, identifying the client application and node implementation to the LSP
  • New ClientInfoUtils helper builds the payload from the current app version and backend type
  • Strips v/V prefix from version strings for consistency

Spec

Implements the client_info common schema proposed in lightning/blips#69.

Rationale

LSPs currently have no standardized way to know which client applications or node implementations are using their services. Previously, we worked around this by overloading the token field, but this conflicts with its intended purpose (discount codes, API keys). A dedicated client_info object cleanly separates client identification from authentication, enabling better debugging and analytics.

Changes

  • utils/ClientInfoUtils.ts — New helper that builds a client_info object:
    • app: always "ZEUS"
    • app_version: from package.json, v prefix stripped
    • node: mapped from implementation (embedded-lnd/lnd/lightning-node-connect"LND", cln-rest"Core Lightning")
    • node_version: from node info, v prefix stripped
  • stores/LSPStore.ts — Sends client_info in:
    • lsps1CreateOrderREST() — JSON body
    • lsps1CreateOrderCustomMessage() — JSON-RPC params
    • lsps7CreateOrderCustomMessage() — JSON-RPC params
    • getZeroConfInvoice() (Flow /proposal) — JSON body
  • utils/ClientInfoUtils.test.ts — 20 tests covering version prefix stripping, backend name mapping, missing fields, unknown backends, and payload shapes for all three interfaces

Example payload

{
    "client_info": {
        "app": "ZEUS",
        "app_version": "0.13.0-prealpha",
        "node": "LND",
        "node_version": "0.18.4-beta"
    }
}

PR Type

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Configuration change
  • Locales update
  • Quality assurance
  • Other

Checklist

  • I’ve run yarn run tsc and made sure my code compiles correctly
  • I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • I’ve run yarn run prettier and made sure my code is formatted correctly
  • I’ve run yarn run test and made sure all of the tests pass

Testing

If you modified or added a utility file, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms (please specify OS version and phone model/VM):

  • Android
  • iOS

I have tested this PR with the following types of nodes (please specify node version and API version where appropriate):

  • Embedded LND
  • LND (REST)
  • LND (Lightning Node Connect)
  • Core Lightning (CLNRest)
  • Nostr Wallet Connect
  • LndHub

Locales

  • I’ve added new locale text that requires translations
  • I’m aware that new translations should be made on the ZEUS Transfix page and not directly to this repo

Third Party Dependencies and Packages

  • Contributors will need to run yarn after this PR is merged in
  • 3rd party dependencies have been modified:
    • verify that package.json and yarn.lock have been properly updated
    • verify that dependencies are installed for both iOS and Android platforms

Other:

  • Changes were made that require an update to the README
  • Changes were made that require an update to onboarding

@kaloudis kaloudis added this to the v0.13.0 milestone Mar 8, 2026
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request standardizes how client applications and node implementations identify themselves to Lightning Service Providers (LSPs). By introducing a dedicated client_info object, it resolves the previous issue of overloading the token field for identification, leading to clearer communication, improved debugging capabilities, and better analytics for LSPs. This change aligns with the proposed client_info common schema, enhancing the overall robustness and interoperability of the system.

Highlights

  • Standardized Client Identification: Introduced a client_info object to LSPS1, LSPS7, and Flow (JIT) channel requests, providing standardized client application and node implementation details to LSPs.
  • New Utility Helper: Developed a new ClientInfoUtils helper to construct the client_info payload, including the application name ("ZEUS"), app version, node type (e.g., "LND", "Core Lightning"), and node version.
  • Version String Normalization: Implemented logic to strip 'v' or 'V' prefixes from version strings for consistency across both application and node versions.
  • LSP Request Integration: Integrated the client_info object into various LSP request methods within LSPStore.ts to ensure its inclusion in relevant communications.
  • Comprehensive Unit Testing: Added comprehensive unit tests for the ClientInfoUtils to validate version stripping, node mapping, and payload structure.
Changelog
  • stores/LSPStore.ts
    • Imported getClientInfo from ClientInfoUtils.
    • Added a private getClientInfo method to retrieve client and node information.
    • Included the client_info object in the JSON body for lsps1CreateOrderREST and getZeroConfInvoice (Flow /proposal) requests.
    • Included the client_info object in the JSON-RPC parameters for lsps1CreateOrderCustomMessage and lsps7CreateOrderCustomMessage requests.
  • utils/ClientInfoUtils.test.ts
    • Added a new file containing unit tests for stripVersionPrefix and getClientInfo functions.
    • Tests cover various scenarios including version prefix stripping, node implementation mapping, handling missing information, and verifying the structure of the client_info payload for different LSP request types.
  • utils/ClientInfoUtils.ts
    • Added a new utility file.
    • Defined the ClientInfo interface for the client identification payload.
    • Implemented stripVersionPrefix to remove leading 'v' or 'V' from version strings.
    • Implemented getClientInfo to construct the client_info object, mapping backend implementations to standardized node names and including application and node versions.
Activity
  • No human activity has been recorded for this pull request yet.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a client_info payload to LSP requests, which is a valuable feature for analytics and debugging on the LSP side. The implementation is well-structured with a dedicated utility module and comprehensive tests. My review includes a suggestion for a minor logic refinement in ClientInfoUtils.ts to ensure node_version is only sent when node is also present, which will improve the consistency of the generated payload.

Comment thread utils/ClientInfoUtils.ts
@kaloudis kaloudis added the Flow label Mar 8, 2026
@kaloudis kaloudis marked this pull request as ready for review March 8, 2026 18:21
@kaloudis kaloudis merged commit 53c940e into ZeusLN:master Mar 9, 2026
4 checks passed
@kaloudis kaloudis deleted the client_info branch March 9, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant