lwwallet: reduce browser wallet public KDF cost#1048
Draft
Roasbeef wants to merge 1 commit into
Draft
Conversation
In this commit, we open browser wallets through a loader configured with independent scrypt profiles. The static public passphrase uses N=16 while the private master key retains btcwallet defaults. This removes nearly all public-only KDF work during create and unlock without changing private-key protection. Native builds keep the existing loader path, and existing browser databases keep their persisted parameters. The temporary fork pin can be removed once btcsuite/btcwallet#1298 merges.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
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
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.
Summary
In this PR, we reduce browser wallet create and unlock time by configuring
independent scrypt profiles for btcwallet's public and private master keys.
The fixed
lwwalletpublic passphrase protects public wallet metadata, so itscreation profile uses
N=16. The user-supplied private passphrase keepsbtcwallet's default
N=262144profile.The change is limited to the WASM wallet bootstrap. Native builds retain their
existing loader path, existing browser databases retain their persisted KDF
parameters, and only newly created browser wallets receive the faster public
profile.
The latest five-run browser benchmark with
lightninglabs/wavelength-sdk#53measured:Technical Notes
This PR temporarily replaces
github.com/btcsuite/btcwalletwith the exactfork commit from
btcsuite/btcwallet#1298. The replace directive and forkchecksums can be removed once that PR merges and Wavelength advances to the
upstream commit.
The private KDF is selected explicitly rather than relying on an implicit
default. This keeps the security boundary visible in the call site.
Steps to Test
For the browser benchmark:
Related Issues and Pull Requests