-
Notifications
You must be signed in to change notification settings - Fork 338
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
BIP39 implementation #607
BIP39 implementation #607
Changes from all commits
a7ea925
58c85e8
bf456a4
ebcc018
612f205
22ec999
93cd896
5d56110
c12ac39
d57b09f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,11 @@ rocksdb = { version = "0.14", default-features = false, features = ["snappy"], o | |
cc = { version = ">=1.0.64", optional = true } | ||
socks = { version = "0.3", optional = true } | ||
lazy_static = { version = "1.4", optional = true } | ||
pbkdf2 = { version = "0.10", optional = true } | ||
unicode-normalization = { version = "0.1.19", optional = true } | ||
sha2 = { version = "0.10.2", optional = true } | ||
hmac = { version = "0.12.1", optional = true } | ||
Comment on lines
+36
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You may want to use rust-bitcoin for sha256, sha512 and Hmac as they are already implemented in the project. As for pbkdf2, maybe you can consider porting the implementation in rust-bip39 while providing the necessary reference following the crate's library. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried using them but As for porting There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I spoke with @afilini and agreed that it's better if we port
Comment on lines
+38
to
+39
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minimizing dependencies is important, you don't need those two: hmac and sha512 are already implemented in bitcoin_hashes, which is a dependency of BDK (re-exported by rust-bitcoin) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried using them but |
||
|
||
bip39 = { version = "1.0.1", optional = true } | ||
bitcoinconsensus = { version = "0.19.0-3", optional = true } | ||
|
||
# Needed by bdk_blockchain_tests macro | ||
|
@@ -59,8 +62,31 @@ sqlite-bundled = ["sqlite", "rusqlite/bundled"] | |
compact_filters = ["rocksdb", "socks", "lazy_static", "cc"] | ||
key-value-db = ["sled"] | ||
all-keys = ["keys-bip39"] | ||
keys-bip39 = ["bip39"] | ||
rpc = ["bitcoincore-rpc"] | ||
keys-bip39 = ["pbkdf2", "unicode-normalization", "sha2", "hmac"] | ||
|
||
# Languages for BIP39 mnemonics. English is always included by default | ||
japanese = [] | ||
korean = [] | ||
spanish = [] | ||
chinese_simplified = [] | ||
chinese_traditional = [] | ||
french = [] | ||
italian = [] | ||
czech = [] | ||
portuguese = [] | ||
|
||
all-languages = [ | ||
"japanese", | ||
"korean", | ||
"spanish", | ||
"chinese_simplified", | ||
"chinese_traditional", | ||
"french", | ||
"italian", | ||
"czech", | ||
"portuguese", | ||
] | ||
|
||
# We currently provide mulitple implementations of `Blockchain`, all are | ||
# blocking except for the `EsploraBlockchain` which can be either async or | ||
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The MSRV of pbkdf2 is 1.57, ours is 1.56, maybe we should consider implementing our own pbkdf2 as rust-bip39 is doing? @afilini what do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we still planning on having our own implementation of
pbkdf2
? If @atalw , does not mind, I can try pick this up?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is an agreement that
pbkdf2
should be implemented within BDK (refer here). And yeah sure, feel free to implement it. I'm caught up with some other work and can only do it after 2 weeks.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Go for it @evanlinjin !
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @atalw and @vladimirfomene ! I've done the implementation here: #644 . Please let me know what I can improve on!