Skip to content

Switch to a different BIP39 implementation #399

Closed

Description

@notmandatory

The tiny-bip39 dependency used in the all-keys feature depends on zeroize which appears to only support MSRV 1.51+

https://github.com/iqlusioninc/crates/

This is causing the following error in our CI workflow:

Downloaded zeroize v1.4.0
error: failed to parse manifest at `/home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/zeroize-1.4.0/Cargo.toml`

Caused by:
  feature `resolver` is required

  this Cargo does not support nightly features, but if you
  switch to nightly channel you can add
  `cargo-features = ["resolver"]` to enable this feature
Error: Process completed with exit code 101.

https://github.com/bitcoindevkit/bdk/runs/3101954688?check_suite_focus=true

Activity

  1. added
    bug
    on Jul 19, 2021
  2. notmandatory commented on Jul 19, 2021

    @notmandatory
    ContributorAuthor
  3. afilini commented on Jul 20, 2021

    @afilini
    Contributor

    Can we switch to https://github.com/rust-bitcoin/rust-bip39? it's MSRV is 1.29.

    Yeah I guess it makes sense, I'm gonna reopen this issue to keep track of that

  4. changed the title [-]Build with +1.46.0 toolchain fails for `all-keys` features[/-] [+]Switch to a different BIP39 implementation[/+] on Jul 20, 2021
  5. added
    new feature
    and removed
    bug
    on Jul 20, 2021
  6. notmandatory commented on Jul 20, 2021

    @notmandatory
    ContributorAuthor

    I did a preliminary look at swapping tiny-bip39 with rust-bip39 and the one missing part right now is rust-bip39 doesn't currently implement seed generation from the phrase.

  7. notmandatory commented on Sep 21, 2021

    @notmandatory
    ContributorAuthor

    As commented in bip39.rs, another option is to write our own bip-39 implementation, ideally with no new dependencies.

  8. notmandatory commented on Sep 21, 2021

    @notmandatory
    ContributorAuthor

    I confirmed that using @LLFourn 's PR maciejhirsz/tiny-bip39#29 patched version of tiny-bip39 in bdk I'm able to remove the fix from #400 and build and test the all-keys feature with rust 1.46.0.
    Oops, nevermind. still broken after removing Cargo.lock and doing a cargo clean.

  9. rajarshimaitra commented on Oct 25, 2021

    @rajarshimaitra
    Contributor

    I am willing to work on this.. Does it make sense to implement our own bip39? Should not be too difficult. If yes I can start sketching one.

  10. rajarshimaitra commented on Oct 27, 2021

    @rajarshimaitra
    Contributor

    I looked into rust-bip39 and it seems it should be possible to use that with slight refactoring of our keys.rs module. rust-bip39 does support seed generation from mnemonic phrase, https://github.com/rust-bitcoin/rust-bip39/blob/520e15a6e5b86940dae2d386d90b4b3616491d13/src/lib.rs#L477-L486.

    I am working on the transition. Should not take long.

  11. notmandatory commented on Oct 28, 2021

    @notmandatory
    ContributorAuthor

    Sounds great if we can use rust-bip39 that will be ideal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    module-keysnew feature

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions