Skip to content
This repository has been archived by the owner on Feb 3, 2025. It is now read-only.

Support BIP-39 passphrase #403

Open
benthecarman opened this issue Apr 24, 2023 · 5 comments
Open

Support BIP-39 passphrase #403

benthecarman opened this issue Apr 24, 2023 · 5 comments
Labels
good first issue Good for newcomers

Comments

@benthecarman
Copy link
Collaborator

benthecarman commented Apr 24, 2023

Currently we just hard coded an empty string as the passphrase, we could allow the user to set this.

This will need to be correctly set when creating the keys manager, bdk, wallet, and auth manager.

A good follow on would be to unify some logic so we aren't having this duplicate code in multiple places.

@benthecarman benthecarman added the good first issue Good for newcomers label Apr 24, 2023
@AbhinavMir
Copy link

Happy to take this on. Can you point out to where this takes place? I tried looking at keygenerator but just want to be sure.

@benthecarman
Copy link
Collaborator Author

benthecarman commented Jun 4, 2023

Happy to take this on. Can you point out to where this takes place? I tried looking at keygenerator but just want to be sure.

There's a few places where we call mnemonic.to_seed(""). You'll want to switch out the "" to a parameter and find everywhere we call it and make sure we use that bip39 passphrase. It should probably be an optional string and we can just default to the empty string if it is None

Here's one place
https://github.com/MutinyWallet/mutiny-node/blob/master/mutiny-core/src/lib.rs#L127

@AbhinavMir
Copy link

Sorry for the delay, had some work come up. How can I test this? Any unit tests in place I could use?

@benthecarman
Copy link
Collaborator Author

async fn derive_pubkey_child_from_seed() {

this test should break if you have a bip39 passphrase set

@AbhinavMir
Copy link

I thought I had a PR raised for this, but I must've forgot! Fixing this now!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants