Skip to content

Conversation

@shubhamkmr04
Copy link
Contributor

Description

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

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @shubhamkmr04, 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 introduces significant enhancements to the embedded LND node management within the application. The core focus is on enabling seamless channel migration between devices, providing users with greater flexibility and control over their Lightning Network funds. Additionally, it expands the application's compatibility by integrating Esplora as an alternative blockchain backend and extending support to the Testnet4 network, offering more choices for how users connect to the Bitcoin blockchain. These changes are accompanied by an LND version upgrade and various UI adjustments to support the new functionalities.

Highlights

  • LND Upgrade: The embedded LND node has been upgraded to version v0.20.0-beta-zeus-esplora, bringing new RPC methods, updated message structures, and deprecations in the protobuf definitions.
  • Channel Migration Feature: Introduced a new feature allowing users to export their channel database to another device and import it, facilitating wallet migration while keeping channels intact. This includes UI for exporting, importing, and a locked wallet state during migration with appropriate warnings.
  • Esplora Blockchain Backend Support: Users can now choose Esplora as an alternative blockchain backend to Neutrino for embedded LND nodes. This includes new settings for Esplora URLs (Mainnet, Testnet, Testnet4) and a UI to switch between backends, with automatic deletion of Neutrino files when switching to Esplora.
  • Testnet4 Network Support: Added explicit support for the Testnet4 network, including new locale strings, updated network detection logic, and specific Neutrino peer configurations for Testnet4.
  • SQLite Database Backend for New Wallets: New embedded LND wallets will now default to using SQLite as their database backend. The UI has been updated to reflect whether a wallet uses SQLite or BoltDB, and the 'compactDb' setting is now hidden for SQLite wallets.
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
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 significant new features, including support for Testnet4, the ability to switch between Neutrino and Esplora blockchain backends, and a channel migration tool. The refactoring of network and backend configuration is well-structured, and the channel migration feature incorporates appropriate safety measures like a locked wallet state and app restarts. Overall, the changes enhance the wallet's flexibility and user experience.

Comment on lines 148 to 153
getChannelDbPath = async (
lndDir: string,
isTestnet: boolean,
isSqlite: boolean
) => {
const network = isTestnet ? 'testnet' : 'mainnet';
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The getChannelDbPath function currently determines the network folder based on a generic isTestnet boolean. However, the underlying LND configuration (as seen in utils/LndMobileUtils.ts) differentiates between testnet (Testnet3) and testnet4 for folder structures. Using isTestnet ? 'testnet' : 'mainnet' will incorrectly map Testnet4 to the testnet folder, potentially leading to issues with locating or restoring channel backups for Testnet4 nodes. It's crucial to use the specific network string from SettingsStore.embeddedLndNetwork to ensure the correct path is constructed.

Suggested change
getChannelDbPath = async (
lndDir: string,
isTestnet: boolean,
isSqlite: boolean
) => {
const network = isTestnet ? 'testnet' : 'mainnet';
getChannelDbPath = async (
lndDir: string,
network: string,
isSqlite: boolean
) => {
const networkPath = network.toLowerCase();

Comment on lines 188 to 191
const dbPath = await this.getChannelDbPath(
getLndDir(),
isTestnet,
isSqlite
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The call to getChannelDbPath needs to be updated to pass the actual network string (SettingsStore.embeddedLndNetwork) instead of a boolean isTestnet. This aligns with the updated signature and logic of getChannelDbPath to correctly identify the network folder for channel backups.

Suggested change
const dbPath = await this.getChannelDbPath(
getLndDir(),
isTestnet,
isSqlite
const dbPath = await this.getChannelDbPath(
getLndDir(),
this.props.SettingsStore.embeddedLndNetwork || 'mainnet',
isSqlite
);

Comment on lines 307 to 310
const lndDir = this.props.SettingsStore.lndDir || 'lnd';
const isTestnet = this.props.NodeInfoStore!.nodeInfo.isTestNet;
Copy link
Contributor

Choose a reason for hiding this comment

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

high

The isTestnet variable here is derived from NodeInfoStore!.nodeInfo.isTestNet, which is true for both Testnet3 and Testnet4. However, the destination folder is determined using isTestnet ? 'testnet' : 'mainnet'. This will incorrectly place Testnet4 backups into the testnet folder, leading to a mismatch with the actual LND directory structure (which uses testnet4 for Testnet4). This could prevent successful restoration of channel backups for Testnet4 nodes.

Suggested change
const lndDir = this.props.SettingsStore.lndDir || 'lnd';
const isTestnet = this.props.NodeInfoStore!.nodeInfo.isTestNet;
const networkPath = this.props.SettingsStore.embeddedLndNetwork?.toLowerCase() || 'mainnet';
const destFolder = `${rootPath}/${lndDir}/data/graph/${networkPath}`;

Comment on lines 208 to 210
const backupFileName = `zeus-channels-${
isTestnet ? 'testnet' : 'mainnet'
}-${Date.now()}.${extension}`;
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The backup file name should accurately reflect the specific network (e.g., 'testnet3' or 'testnet4') rather than a generic 'testnet' if isTestnet is true. This ensures clarity and avoids potential confusion or overwrites if different testnets have distinct backup files.

Suggested change
const backupFileName = `zeus-channels-${
isTestnet ? 'testnet' : 'mainnet'
}-${Date.now()}.${extension}`;
const backupFileName = `zeus-channels-${
this.props.SettingsStore.embeddedLndNetwork?.toLowerCase() || 'mainnet'
}-${Date.now()}.${extension}`;

@shubhamkmr04 shubhamkmr04 changed the title feat(Backup): Allow users to move to other device while keep the channels intact feat(Channel backup): Allow users to move to other device while keep the channels intact Jan 26, 2026
@kaloudis kaloudis added this to the v0.13.0 milestone Jan 26, 2026
@shubhamkmr04 shubhamkmr04 force-pushed the shubham/channel-backups branch from 2f3672d to d3221aa Compare January 27, 2026 07:18
@shubhamkmr04 shubhamkmr04 force-pushed the shubham/channel-backups branch from ef3f36a to 6b0e365 Compare January 27, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants