Skip to content
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

[cryptography/bls12381] Add Partial Multi-Signature Verification #429

Open
patrick-ogrady opened this issue Jan 31, 2025 · 0 comments
Open
Assignees

Comments

@patrick-ogrady
Copy link
Contributor

patrick-ogrady commented Jan 31, 2025

When rewarding participants in threshold-based consensus, it is necessary to agree on some set of observed partial signatures (usually by including said participation in a block). Recall, it is not possible to determine who has participated in a recovered threshold signature.

To reduce the bandwidth this process consumes, we can aggregate the partial signatures into a BLS Multi-Signature that can be verified by deriving the PublicKey of each signer by evaluating the group polynomial at the index of their share:

/// Evaluates the polynomial at the specified value.
pub fn evaluate(&self, i: u32) -> Eval<C> {
// Reference: https://github.com/celo-org/celo-threshold-bls-rs/blob/a714310be76620e10e8797d6637df64011926430/crates/threshold-bls/src/poly.rs#L111-L129
// We add +1 because we must never evaluate the polynomial at its first point
// otherwise it reveals the "secret" value after a reshare (where the constant
// term is set to be the secret of the previous dealing).
let mut xi = Scalar::zero();
xi.set_int(i + 1);
// Use Horner's method to evaluate the polynomial
let res = self.0.iter().rev().fold(C::zero(), |mut sum, coeff| {
sum.mul(&xi);
sum.add(coeff);
sum
});
Eval {
value: res,
index: i,
}
}

When we verify a single partial signature, we already use this evaluation technique and this PR is really about extending it:

pub fn partial_verify_message(
public: &poly::Public,
namespace: Option<&[u8]>,
message: &[u8],
partial: &PartialSignature,
) -> Result<(), Error> {
let public = public.evaluate(partial.index);
verify_message(&public.value, namespace, message, &partial.value)
}

Credit to @StephenButtolph for the suggestion 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Backlog
Development

No branches or pull requests

1 participant