Skip to content

Updations in Wallet and Channel recovery section#3886

Open
kushagra0902 wants to merge 2 commits intoZeusLN:masterfrom
kushagra0902:recoveryFixes
Open

Updations in Wallet and Channel recovery section#3886
kushagra0902 wants to merge 2 commits intoZeusLN:masterfrom
kushagra0902:recoveryFixes

Conversation

@kushagra0902
Copy link
Copy Markdown

@kushagra0902 kushagra0902 commented Mar 25, 2026

Description

Relates to issue: #3843

This PR have commits regarding the following issues and bugs:

  • Hex file format for SCB backup files is added. The implementation involves making a ScbUtils file in /Util that has the logic for parsing of scb strings instead of direct parsing using base64 types.
  • The Section for recovery didn't have a field for aezeed passphrase. The wallets made using them lnd wallets for example) thus cant be restored.
    The changes in this PR do not change any logical/backend handling part of the code, and mainly handle file parsing types and user interface options.

The changes in this PR do not change any logical/backend handling part of the code, and mainly handle file parsing types and user interface options.

This pull request is categorized as a:

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

Checklist

  • [ x] I’ve run yarn run tsc and made sure my code compiles correctly
  • [ x] I’ve run yarn run lint and made sure my code didn’t contain any problematic patterns
  • [ x] I’ve run yarn run prettier and made sure my code is formatted correctly
  • [ x] 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
  • [ x] Yes
  • N/A

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

  • [ x] Android (Nothing Phone 2a, Android 15)
  • 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

  • [ x] 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

WhatsApp Image 2026-03-25 at 11 25 34 PM
WhatsApp Image 2026-03-25 at 11 25 33 PM
]

@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 significantly improves the wallet and channel recovery experience by expanding the supported formats for Static Channel Backups (SCB) to include hex, in addition to Base64. It centralizes SCB parsing logic into a new utility, making the process more robust. Furthermore, the user interface for both SCB input and wallet recovery has been enhanced with a much-needed submit button and a new field for aezeed passphrases, addressing critical usability gaps without altering core backend logic.

Highlights

  • SCB Backup File Format Support: Introduced support for hex file format for SCB (Static Channel Backup) files, alongside the existing Base64 format, enhancing flexibility in channel recovery.
  • Dedicated SCB Parsing Utility: A new utility file, ScbUtils, was created to centralize the logic for parsing SCB strings, allowing for intelligent decoding of both Base64 and hex inputs.
  • Improved SCB Input UI: The UI for SCB input in the channel recovery section was updated to include a dedicated submit button, resolving an issue where users could not easily utilize channel backups.
  • Aezeed Passphrase for Wallet Recovery: Added an input field for the aezeed passphrase in the wallet recovery section, enabling the restoration of wallets created with aezeed passphrases (e.g., lnd 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.

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 significantly enhances the application's channel backup and wallet recovery functionalities. It introduces a new utility function, scbStringToBytes, which intelligently parses Static Channel Backup (SCB) data provided in either Base64 or hex format. This new utility is integrated into the restoreChannelBackups, verifyChanBackup, and initWallet functions, and the user interface and localization files have been updated to reflect this dual format support. Furthermore, the PR adds the capability to specify an aezeed passphrase during wallet recovery, complete with new UI elements. The review comments suggest renaming several parameters and state properties from channelBackupsBase64 to channelBackupsString for better clarity and consistency with the new hex support, and also recommend adding a missing newline at the end of the locales/en.json file.

method: 'RestoreChannelBackups',
options: {
multi_chan_backup: Base64Utils.base64ToBytes(channels_backup_base64)
multi_chan_backup: scbStringToBytes(channels_backup_base64)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The parameter channels_backup_base64 used here is now misleading as it can also be a hex string. For consistency with the changes in lndmobile/wallet.ts (initWallet function), please consider renaming the parameter in the function signature to channelsBackupString.

multi_chan_backup: Base64Utils.base64ToBytes(
channels_backup_base64
)
multi_chan_backup: scbStringToBytes(channels_backup_base64)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

Similar to my other comment, the parameter channels_backup_base64 is misleading now that it supports hex strings. Please consider renaming it to channelsBackupString for clarity and consistency.

"androidNotification.nwcRunningBackground": "Nostr Wallet Connect is running in the background",
"androidNotification.nwcShutdown": "Stop Service"
}
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

It's a common convention to have a single newline at the end of a file. This file is missing one. Please add a newline at the end for consistency with other files in the project and to prevent issues with some development tools.

Suggested change
}
}

marginHorizontal: 20,
marginTop: 10
}}
disabled={!channelBackupsBase64}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

medium

The state property channelBackupsBase64 is now misleading as it can hold a hex string. For consistency with changes in lndmobile/wallet.ts, consider renaming it to channelBackupsString throughout this component.

…s field if the wallet was originally generated using a passphrase, without that it cannot be recovered.
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