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

Example - Centralized Telescope with BLS Signatures #114

Merged
merged 82 commits into from
Jan 23, 2025

Conversation

curiecrypt
Copy link
Collaborator

@curiecrypt curiecrypt commented Dec 18, 2024

Content

This PR introduces an example demonstrating the ALBA Threshold Signature scheme with the following workflow:

Workflow

  1. Define Telescope Parameters:
    • Set nb_elements to 1,000.
    • Configure soundness_param and completeness_param as 128.0.
    • Calculate the prover set size (set_size) as 80% of nb_elements and the lower bound as 20%.
    • Initialize the Telescope with these parameters.
  2. Initialize Signers:
    • Create a list of candidate Signers with randomly generated keys.
  3. Start Registration:
    • Open a new Registration.
    • Select and register a subset of candidate signers, tracking the number of successfully registered signers.
  4. Close Registration:
    • Finalize the registration by computing the checksum of registered keys.
    • Update registered signers with the computed checksum.
  5. Generate Individual Signatures:
    • Select a subset of registered signers.
    • Generate IndividualSignatures for each based on the input message.
  6. Generate ALBA Threshold Signature:
    • Aggregate valid individual signatures to create an AlbaThresholdSignature.
    • Print details of the generated threshold signature if successful.
  7. Verify ALBA Threshold Signature:
    • Validate the generated threshold signature using the Telescope, registration, and input message.
    • Print whether the verification succeeded or failed.

Purpose

This example provides a detailed implementation of the ALBA Threshold Signature workflow, showcasing the integration of Telescope parameters, signer registration, individual signature generation, and threshold signature verification.

Pre-submit checklist

  • Branch
    • Commit sequence broadly makes sense
    • Key commits have useful messages
  • PR
    • No clippy warnings in the CI
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

Issue(s)

Closes #78

@curiecrypt curiecrypt marked this pull request as ready for review December 23, 2024 20:09
Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good work!

Some suggestions here and there to simplify the code (usnig type alias instead of struct, merging impl block potentially...) and make it more efficient (not using maps but sets, batching the verification).

I think the example would improve in clarity if you rename the folder "threshold_signature" "aggregate_signature" as we are only using these signature list (from registered signers) to create a threshold signature in centralized_telescope.rs. Perhaps renaming centralized_telescope.rs "centralized_threshold.rs" also?

examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/threshold_signature/aggregate.rs Outdated Show resolved Hide resolved
examples/threshold_signature/aggregate.rs Outdated Show resolved Hide resolved
examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/centralized_telescope.rs Outdated Show resolved Hide resolved
examples/threshold_signature/signature.rs Outdated Show resolved Hide resolved
examples/threshold_signature/registration.rs Outdated Show resolved Hide resolved
@tolikzinovyev
Copy link
Member

Thanks for working on this @curiecrypt! Do you need my review or @rrtoledo and @djetchev will be enough?

@curiecrypt curiecrypt requested a review from rrtoledo January 21, 2025 18:40
Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

I am not sure why we put tests here as this is an example but could you add asserts in each of these? We could add more tests, but let's do that in a disctint PR.

examples/README.md Outdated Show resolved Hide resolved
examples/README.md Outdated Show resolved Hide resolved
examples/aggregate_signature/signer.rs Show resolved Hide resolved
examples/aggregate_signature/signer.rs Outdated Show resolved Hide resolved
examples/centralized_threshold.rs Outdated Show resolved Hide resolved
examples/centralized_threshold.rs Show resolved Hide resolved
examples/centralized_threshold.rs Show resolved Hide resolved
examples/centralized_threshold.rs Show resolved Hide resolved
curiecrypt and others added 2 commits January 21, 2025 22:51
@curiecrypt curiecrypt requested a review from rrtoledo January 21, 2025 20:10
@curiecrypt curiecrypt requested a review from djetchev January 22, 2025 16:56
Copy link
Collaborator

@djetchev djetchev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Collaborator

@rrtoledo rrtoledo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rrtoledo rrtoledo merged commit e2990b9 into main Jan 23, 2025
1 check passed
@rrtoledo rrtoledo deleted the curiecrypt/example-centralized branch January 23, 2025 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Example - Threshold signature
4 participants