Skip to content

Conversation

@hieblmi
Copy link
Collaborator

@hieblmi hieblmi commented Nov 11, 2025

This PR introduces a openchannel subcommand to static addresses.

It provides the same experience as lncli openchannel.
Exmples:

Open a channel with all available deposits:

loop static openchannel --fundmax --sat_per_vbyte XXX --private ...

Open a channel with specified local funding amount, coin-selected from available deposits under fee and dust considerations.

loop static openchannel --local_amt XXX --sat_per_vbyte YYY --private ...

Open a channel from two deposits AAA and BBB while taking their combined value(fundmax) as funding amount and considering fees and dust limit.

loop static openchannel --utxo AAA --utxo BBB --fundmax --sat_per_vbyte YYY --private ...

Open a channel from two deposits AAA and BBB while taking a specified amount(local_amt) as funding amount and considering fees and dust limit.

loop static openchannel --utxo AAA --utxo BBB --local_amt --sat_per_vbyte YYY --private ...

TODOs:

  • Integration tests

@gemini-code-assist
Copy link

Summary of Changes

Hello @hieblmi, 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 significantly extends the functionality of static addresses by enabling them to be used as a source for funding Lightning channels. It introduces a new openchannel command that integrates a robust PSBT-based funding flow with lnd, offering flexible options for selecting deposits. This enhancement allows users to seamlessly convert their static address funds into channel liquidity, thereby increasing the utility and versatility of static addresses within the Lightning ecosystem.

Highlights

  • New openchannel subcommand: Introduced a new openchannel subcommand under loop static which allows users to fund Lightning channels directly from their static address deposits.
  • Flexible Channel Funding Options: The new command supports various funding options, including fundmax to use all available deposits, local_amt for a specified amount, and explicit UTXO selection, mirroring the experience of lncli openchannel.
  • PSBT-based Funding Flow: The channel funding process leverages a Partially Signed Bitcoin Transaction (PSBT) flow, enabling secure and collaborative transaction construction with lnd.
  • New Deposit States: Added new deposit states, opening_channel and channel_published, to track the lifecycle of deposits used for channel funding.
  • Code Refactoring and Reusability: Common utility functions related to PSBTs, Musig2 sessions, and outpoint handling have been refactored into a new staticutil package, improving code organization and reusability across static address features.
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

@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 new openchannel subcommand for static addresses, allowing users to fund channels from their deposits. The implementation is comprehensive, covering the command-line interface, RPC definitions, daemon logic, and documentation.

My review focuses on the new cmd/loop/openchannel.go file, where I've identified a few issues related to context handling, input validation, and error wrapping. These are important for ensuring the robustness and maintainability of the new command.

The refactoring to move utility functions into a staticutil package is a great improvement for code organization and reuse. The protocol changes to use PSBT for withdrawals are also a solid enhancement.

Overall, this is a well-structured PR that adds significant functionality. Addressing the feedback will further improve its quality.

@hieblmi hieblmi force-pushed the static-open-channel branch 3 times, most recently from 03081e1 to f9b49dc Compare November 11, 2025 20:45
@hieblmi hieblmi force-pushed the static-open-channel branch from f9b49dc to 9d37fca Compare November 12, 2025 10:24
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