filecoin-project / bls-signatures

BLS Signatures in Rust
Other
72 stars 43 forks source link

How to aggregate two overlapping multi-signatures ? #59

Open TimotheAlbouy opened 1 year ago

TimotheAlbouy commented 1 year ago

Hello,

I want to merge two multi-signatures whose sets of signatories intersect.

For instance, we have two sets of signatories $A = \{s_1, s_2\}$ and $B = \{s_2, s_3\}$, which respectively produced multi-signatures $\sigma_A$ and $\sigma_B$.

According to this Crypto Stack Exchange post, these two multi-signatures can be merged if we use the aggregated public key $pk = pk_1 + 2 pk_2 + pk_3$.

But how would this translate into code?

let pub_keys = vec![pub_key_1, pub_key_2, pub_key_2, pub_key_3];
let messages = vec![message_1, message_2, message_3];
let valid = bls_signatures::verify(&agg_multisig, &messages, &pub_keys);
TimotheAlbouy commented 1 year ago

UPDATE: the final code does not yield valid = true. Does this mean that this crate does not allow to merge 2 overlapping multi-signatures?