-
Notifications
You must be signed in to change notification settings - Fork 41
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
Simplify signature #620
Simplify signature #620
Conversation
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 👍
I think this is a breaking change as previous multi-signature will not be compatible with the new format. This means that we will probably have to re-genesis the certificate chains of the Mithril networks. Also all the SPOs will have to recompile their node. It is probably a good time to update the PROTOCOL_VERSION
(and maybe enforce versions compatibility)? Let's wait before we merge it, WDYT?
|
||
// If there is no reg_party, then we simply received a signature from a non-registered | ||
// party, and we can ignore the request. | ||
if let Some((vk, stake)) = clerk.get_reg_party(&signature.signer_index) { |
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.
if let Some((vk, stake)) = clerk.get_reg_party(&signature.signer_index) { | |
let (vk, stake) = clerk.get_reg_party(&signature.signer_index).ok_or_else(|| ProtocolError::UnregisteredParty)? |
This should avoid to create the if let
and would return an error instead of Ok(())
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 the changes look good, the only change I should request is to update the size bench results in the readme. Since we exclude pk and stake from StmSig, we have no longer the size as 176 bytes for a single sig with 1 winning ticket.
We should update the related line as follows:
Note that the size of an individual signature with one valid index is **72 bytes** and increases linearly in the length of valid indices (where an index is 8 bytes).
Good catch. But I count 64 bytes + linear increase. 48 from sigma + 8 from the signer index + 8 from at least one index. Do you get the same? |
Yes, I got the same. I wrote 72 bytes because if we create a signature it must include at least one winning index. So, 72 bytes = sigma + signer index + winning index @iquerejeta |
The extra 8 bytes coming from the number of indexes are included in serialized version of StmSig. @iquerejeta |
Right! good catch. |
1f0487a
to
1a37204
Compare
Co-authored-by: Jean-Philippe Raynaud <jp.raynaud@gmail.com>
6a462c2
to
6c9de9b
Compare
Content
This PR removes the verification key and the stake from the signature. These values are no longer required, as individual signatures no longer contain the merkle paths (it is now responsibility of the aggregator to include these values in the certificate). This required some changes in the multi_signer and single_signer, as these folders were verifying single signatures.
Now, in order to verify aggregate signatures, they include not only the individual signatures but also the corresponding
RegParty
, to be able to verify the batched membership proof (batched merkle path).Pre-submit checklist
Issue(s)
This PR closes #619 .