-
Notifications
You must be signed in to change notification settings - Fork 2
feat: add client for handling ldk-node backups #8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ovitrif
wants to merge
23
commits into
master
Choose a base branch
from
fix/key-namespace
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+3,419
−1,173
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
Author
|
Drafted to fix keyspace for ldk APIs |
The seed was truncated to 32 bytes before being passed to Xpriv::new_master, while ldk-node uses the full 64-byte BIP39 seed. This caused all LDK-namespaced APIs to operate on a different key space than ldk-node's actual VSS data. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
pwltr
reviewed
Feb 10, 2026
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
jvsena42
reviewed
Feb 11, 2026
|
Thanks for doing the release as well, will test now on iOS end |
pwltr
suggested changes
Feb 11, 2026
pwltr
suggested changes
Feb 11, 2026
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
35c9878 to
1edacc9
Compare
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Context
The app's VSS client was using a truncated 32-byte seed for all key derivation, while ldk-node uses the full 64-byte BIP39 seed. This made it impossible to read ldk-node's VSS data from the app layer. Additionally, ldk-node uses a namespaced key format (
obf("primary#secondary")#obf("key")) that the flat-key APIs couldn't address.Changes
Dual key derivation
The client derives two independent key sets during initialization:
store/get/delete/list_keys/list): derived from the truncated 32-byte seed, preserving backward compatibility with existing app backupsLdkVssClient): derived from the full 64-byte seed, matching ldk-node's internal key derivationLNURL auth is derived from the app seed path (truncated 32-byte), maintaining the same server identity as v0.4.0.
Dedicated LDK client with
LdkNamespaceenumDecoupled LDK operations into a standalone
LdkVssClient(ldk_client.rs), completely separate from the app backupVssClient. Each has its own global singleton, initialization, and shutdown:vss_new_ldk_client_with_lnurl_auth()/vss_shutdown_ldk_client()vss_ldk_get(),vss_ldk_store(),vss_ldk_delete(),vss_ldk_list_keys(),vss_ldk_list_all_keys()All accept a type-safe
LdkNamespaceenum (defined in Rust, generated for Kotlin/Swift by UniFFI):This ensures the LDK client uses only ldk-node's key derivation chain (full 64-byte seed →
m/877'→ HKDF) with no coupling to the app client's truncated-seed derivation.CI
Aligns the Gradle publish workflow with bitkit-core's pattern.
QA Notes
cargo testpasses (19/19)