-
Notifications
You must be signed in to change notification settings - Fork 29
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
[frost] backup scheme #171
Conversation
46d40ff
to
02db328
Compare
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.
- Given a vector of shares we should have a function that tries to reconstruct the main secret.
- Given a vector of share images should try and reconstruct the public polynomial and therefore give us the ability to check the id in the encoding.
036eded
to
11671e8
Compare
I've also taken this as a good time to create a separate module for polynomials I made the Two things of interest: We lose sight of which signer indexes exist internally, and also Secondly, I am wondering if we want to go further and remove storing the FROST Perhaps we could do something like accumulate these tweaks internally until |
c2e204e
to
91805f0
Compare
Cool.
Yes this is the way to go.
We shouldn't store on disk but we should have a separate public key field in memory.
I think the current API is good. |
.non_zero() | ||
.expect("points must lie at unique indexes to interpolate") | ||
.invert(); | ||
let b_m = s!(-x_m * a_m).mark_zero(); |
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.
I think we have the /
operator for division now if you want to use it.
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.
This was resolved but you didn't use it? Maybe it's because you can't call invert on non-zero thingies. I didn't think of that. I like that it was made explicit then!
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.
I didn't use it here because simplest form in the product was /
here you'd have to do something like
let a_m_denom = s!(x_j - x_m)
.non_zero()
.expect("points must lie at unique indicies to interpolate");
let a_m = s!(1 / a_m_denom);
91805f0
to
b6223bf
Compare
c774ef2
to
9ec3b3d
Compare
Added some of the suggested functions Changed threshold to take two characters (max threshold 1024). Added a panic to encode if the secret share is not valid with respect to the point polynomial. I'd like to squash this mess of commits before merging (something like: 1 commit for |
d022b4b
to
0fc0acf
Compare
- single iteration for interpolation - improve secrecy markings - remove unncessary normalization - less clones when calculating basis poly
0fc0acf
to
3e5e9f8
Compare
670f86c
to
b99b587
Compare
One thing I haven't implemented here is having an |
545367a
to
913b072
Compare
Added There's a duplicated Reminder that I'd like to squash these commits after any approval. |
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.
Left every nit I can find. Looks really really god.
One thing I haven't implemented here is having an EncodableFrostKey that doesnt serialize the tweaked public key
Please do this and we'll be done here. It should be called EncodedFrostKey
.
feeb035
to
066fffd
Compare
Please check what i've done with I've removed the serde and bincode stuff from |
I was just exploring a test that randomly deletes Sure the checksum is invalid, but i'd think for bech32 to be useful we want to see the corrected decoding suggestion(s)? Edit: It's on the stabilization roadmap rust-bitcoin/rust-bech32#95 |
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.
LGTM. Thanks.
I fixed up one thing. The decode/deserialize impls for EncodedFrostKey
should not allow zero as the first coefficient.
feature = "bincode", | ||
derive(crate::fun::bincode::Encode, crate::fun::bincode::Decode), | ||
bincode(crate = "crate::fun::bincode",) | ||
)] |
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.
This should have custom decode and deserialize implementations that just try and decode to Vec<Point<..,Zero>>
and check that the first coef is not zero.
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.
(update: I did this)
Explanation and justification of scheme in module documentation.
This draft scheme currently includes the ability for the share index to either be a small integer or a scalar.
share_backup
feature and bech32 dependency correctlyfrostsnap-cli backup and restore (separate PR)