mutiny-node icon indicating copy to clipboard operation
mutiny-node copied to clipboard

Support BIP-39 passphrase

Open benthecarman opened this issue 1 year ago • 5 comments

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 avatar Apr 24 '23 18:04 benthecarman

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.

AbhinavMir avatar Jun 04 '23 09:06 AbhinavMir

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

benthecarman avatar Jun 04 '23 09:06 benthecarman

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

AbhinavMir avatar Jun 20 '23 13:06 AbhinavMir

https://github.com/MutinyWallet/mutiny-node/blob/3e8a0d114f7c59738137371fa3a8cfaed637e5e0/mutiny-core/src/keymanager.rs#L257

this test should break if you have a bip39 passphrase set

benthecarman avatar Jun 20 '23 16:06 benthecarman

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

AbhinavMir avatar Feb 11 '24 22:02 AbhinavMir