-
Notifications
You must be signed in to change notification settings - Fork 86
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
Shares converted to mnemonic form intermittently fail to recombine #27
Comments
For BIP39 mnemonics, it's probably better to use https://github.com/rust-bitcoin/rust-bip39. |
Sure, but this code still doesn't appear to work as demonstrated by the test case. EDIT |
Actually, I'm not sure how BIP39 could even be used in place of the test case I have provided here. The only API exposed by this crate to serialize a SLIP-0039 share involves taking the mnemonic representation of the share. The Share struct, while public, doesn't offer any functions to convert to a vector or slice of u8 in the fixed format specified in slip0039. Are you suggesting that to_mnemonic is deprecated and we should be manually serializing the Share struct and then sending it though your rust-bip39 crate? Why not just update to_mnemonic to use rust-bip39? |
Oh sorry I missed that you were talking about the SSS feature of this crate. I'm sorry to say that I have actually never looked at it. I took over maintenance from the previous maintainer of this crate. Tbh I spent some time in the past thinking about refactoring a lot of stuff in here and the shamir stuff would be one of the first things to go as it's really not required to build a bitcoin wallet. |
Just FYI this crate is linked as an implementation of SLIP-0039 from: https://github.com/satoshilabs/slips/blob/master/slip-0039.md. I agree it would be nice to pull SSS & SLIP-0039 out of the bitcoin_wallet crate and into its own home. It's much cleaner that way and a separate concern. |
I think the license of this project allows you to do that if you would like
:)
…On Mon, Mar 15, 2021 at 6:00 PM David ***@***.***> wrote:
Just FYI this crate is linked as an implementation of SLIP-0039 from:
https://github.com/satoshilabs/slips/blob/master/slip-0039.md. I agree it
would be nice to pull SSS & SLIP-0039 out of the bitcoin_wallet crate and
into its own home. It's much cleaner that way and a separate concern.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#27 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAGQLXGMWDD2WZJWW5RJ45DTDZDLRANCNFSM4XROUNWQ>
.
|
Roughly half the time shares are generated and converted to their mnemonic representation, they recombine yielding an incorrect result. Here's some sample code to demonstrate the issue:
The
sss_roundtrip_internal
test never fails, however, thesss_roundtrip_mnemonic
test fails intermittently.Here is some example output (6 success, 3 failure):
I've been poking around a little. I notice the
to_mnemonic
function is not actually tested insss.rs
. Thefrom_mnemonic
function is tested to correctly parse the TREZOR test vectors, and a roundtrip is tested using the internalShare
representation, however there does not appear to be any code that tests converting shares to their mnemonic form. This leads me to suspect an issue with the encoding process. I started combing the code to see if anything jumps out, but would love some help (:The text was updated successfully, but these errors were encountered: