-
Notifications
You must be signed in to change notification settings - Fork 122
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
Add BLS aggregation features to CryptoUtils
module
#1666
Add BLS aggregation features to CryptoUtils
module
#1666
Conversation
Benchmark for 44b06feClick to view benchmark
|
} | ||
|
||
#[trace_resources(log=signatures.len())] | ||
fn bls12381_g2_signature_aggregate( |
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 see that we can also aggregate public keys, is this something that we should add? Would any of the integrators we know of have a use for 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.
According to Supra, they will need only the basic BLS functionality introduced here: #1661
When researching the BLS I found that signature aggregation is more of a use in terms of Oracles.
eg.
https://www.researchgate.net/publication/350462947_Trusted_Blockchain_Oracle_Scheme_Based_on_Aggregate_Signature
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.
Looks good, just a few minor comments.
e5650ff
to
69d1642
Compare
This is to make sure public key count matches message count. Take vector of tuples (public key and message) as argument.
Do not take aggregation into account. Just sum up the costs per size for all messages.
34ee3d8
to
3d404ce
Compare
It does not work for WASM and no_std
3d404ce
to
eca021b
Compare
Summary
This PR adds following API methods to
CryptoUtils
:bls12381_g2_signature_aggregate()
Aggregate given BLS12-381 G2 signatures into single one
bls12381_v1_aggregate_verify()
Perform BLS12-381 G2 aggregated signature verification of multiple messages, where each is signed with different key
bls12381_v1_fast_aggregate_verify()
Performs BLS12-381 G2 aggregated signature verification of single message signed with different keys
Details
Proposed API was inspired by:
blst
crate APITODO: Costing
Testing
bls12381
(inradix-engine-common
) module implementationCryptoUtils
module usingCryptoScrypto
test blueprint