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] Add Multi-Signature Scheme #446

Open
patrick-ogrady opened this issue Feb 3, 2025 · 0 comments
Open

[cryptography] Add Multi-Signature Scheme #446

patrick-ogrady opened this issue Feb 3, 2025 · 0 comments
Labels
research More work required

Comments

@patrick-ogrady
Copy link
Contributor

To provide first-class support for multi-signatures, we should consider implementing a dedicated Scheme (like we did for batch verification with BatchScheme):

/// Interface that commonware crates rely on for batched cryptographic operations.
pub trait BatchScheme {
/// Create a new batch scheme.
fn new() -> Self;
/// Append item to the batch.
///
/// The message should not be hashed prior to calling this function. If a particular scheme
/// requires a payload to be hashed before it is signed, it will be done internally.
///
/// A namespace should be used to prevent replay attacks. It will be prepended to the message so
/// that a signature meant for one context cannot be used unexpectedly in another (i.e. signing
/// a message on the network layer can't accidentally spend funds on the execution layer). See
/// [union_unique](commonware_utils::union_unique) for details.
fn add(
&mut self,
namespace: Option<&[u8]>,
message: &[u8],
public_key: &PublicKey,
signature: &Signature,
) -> bool;
/// Verify all items added to the batch.
///
/// Returns `true` if all items are valid, `false` otherwise.
///
/// # Why Randomness?
///
/// When performing batch verification, it is often important to add some randomness
/// to prevent an attacker from constructing a malicious batch of signatures that pass
/// batch verification but are invalid individually. Abstractly, think of this as
/// there existing two valid signatures (`c_1` and `c_2`) and an attacker proposing
/// (`c_1 + d` and `c_2 - d`).
///
/// You can read more about this [here](https://ethresear.ch/t/security-of-bls-batch-verification/10748#the-importance-of-randomness-4).
fn verify<R: RngCore + CryptoRng>(self, rng: &mut R) -> bool;
}

The delta from BatchScheme would be pretty small (during add we wouldn't provide signature and instead would provide an aggregate signature during verify).

@patrick-ogrady patrick-ogrady added the research More work required label Feb 3, 2025
@github-project-automation github-project-automation bot moved this to Backlog in Tracker Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
research More work required
Projects
Status: Backlog
Development

No branches or pull requests

1 participant