-
Notifications
You must be signed in to change notification settings - Fork 80
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
Make wallet entropy source configurable #14
Conversation
Unfortunately this is currently blocked on dependent projects, since |
That said, BDK seems to work on its own Bip39 implementation (bitcoindevkit/bdk#644), so let's see what unblocks this first. |
e39d80c
to
7266a1e
Compare
A small comment: because you're using 64 bytes when taking the You'd get this interop if instead of 64 bytes for the SeedFile and SeedBytes you use a 32 bytes requirement. You could then also provide the user a 24 word BIP39 backup if they wish to have one, and that would back up their entropy (the 32 bytes and the 24 words being different representations of the same thing). From there you could create the Mnemonic using let mnemonic_from_bytes = Mnemonic::from_entropy_in(Language::English, &seed_bytes).unwrap();
let xprv = mnemonic_from_bytes.into_extended_key().unwrap().into_xprv(Network::Testnet).unwrap();
let ldk_seed: [u8; 32] = xprv.private_key.secret_bytes(); Other small comment: this LdkLite idea is awesome! Really looking forward to play around with it and build a small node! |
Ah, good point. I actually switched to 64 bytes since that is what
Love to hear it! :) |
7266a1e
to
8dda9ad
Compare
8dda9ad
to
fc51b39
Compare
fc51b39
to
4a184f0
Compare
The specifics here are out of my depth, but the objective seems essential to a v1, and there has been no progress on the blocking issue for 6 months. May have to look into alternative routes forward. Using BDK in Swift I had no issues creating the seed for LDK with |
Sure, in particular if there is no movement, I'll probably just add a builder method allowing to specify the seed, e.g.,
I mean the current version already creates a random seed that is persisted to disk. This PR is just meant to give additional options regarding how to generate that seed. |
While reading from a Bip39 mnemonic is still pending due to above mentioned pinning issue, specifying the seed or seed file directly has now been included in #11 already. Closing as "mostly done". |
Closes #12, based on #8, #9, #10, #11.
This PR makes the wallet entropy source configurable. We do this by first sourcing
[u8; 64]
bytes in different ways to setup abip32::ExtendedPrivKey
, whose secret key we then use to source LDK's seed bytes.