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

feat: use 128 bits of randomness for blinding factors #155

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

matthewkeil
Copy link
Member

There were several exchanges about the perf implications vs security tradeoffs of 64 vs 128 bits of randomness for the blinding factor of verifyMultipleAggregateSignatures and aggregateWithRandomness. You can find parts of that discussion on these two ethresearch posts.

This is the original post by Vitalik that set the 64-bit value:
https://ethresear.ch/t/fast-verification-of-multiple-bls-signatures/5407/6

Here is the thread were it was discussed:
https://ethresear.ch/t/security-of-bls-batch-verification/10748/7

There were more discussions on the private Lodestar <> Research telegram as well. Those pertinent messages are below:

Screenshot 2024-10-22 at 8 20 49 PM

Performance Testing Results

                                                           64 bits           128 bits
                                                        =============     ==============
aggregateWithRandomness
  ✓ aggregateWithRandomness - 1 sets                    152.9080 us/op    232.0550 us/op
  ✓ aggregateWithRandomness - 16 sets                     1.4847 ms/op      1.7781 ms/op
  ✓ aggregateWithRandomness - 128 sets                    7.9076 ms/op      7.9060 ms/op
  ✓ aggregateWithRandomness - 256 sets                   15.3735 ms/op     16.0832 ms/op
  ✓ aggregateWithRandomness - 512 sets                   30.4996 ms/op     30.7407 ms/op
  ✓ aggregateWithRandomness - 1024 sets                  62.6190 ms/op     64.8119 ms/op
  ✓ aggregateWithRandomness - 2048 sets                 125.0660 ms/op    125.5888 ms/op
  ✓ aggregateWithRandomness - 16000 sets                878.6092 ms/op    906.3493 ms/op
  ✓ aggregateWithRandomness - 100000 sets                 5.4259  s/op      5.5569  s/op
  ✓ aggregateWithRandomness - 200000 sets                10.9956  s/op     11.0219  s/op
verifyMultipleAggregateSignatures same message
  ✓ Same message - 1 sets                               773.3730 us/op    848.0510 us/op
  ✓ Same message - 8 sets                                 1.4562 ms/op      1.6816 ms/op
  ✓ Same message - 32 sets                                2.7797 ms/op      2.9791 ms/op
  ✓ Same message - 128 sets                               8.4415 ms/op      8.8811 ms/op
  ✓ Same message - 256 sets                              16.5267 ms/op     16.7729 ms/op
  ✓ Same message - 512 sets                              32.0515 ms/op     32.1655 ms/op
  ✓ Same message - 1024 sets                             62.7327 ms/op     65.6105 ms/op
  ✓ Same message - 2048 sets                            130.9331 ms/op    129.4787 ms/op
  ✓ Same message - 16000 sets                           896.6377 ms/op    895.7857 ms/op
  ✓ Same message - 100000 sets                            5.4855  s/op      5.5008  s/op
  ✓ Same message - 200000 sets                           11.0122  s/op     10.9886  s/op
verifyMultipleAggregateSignatures
  ✓ verifyMultipleAggregateSignatures - 1 sets          937.1170 us/op    999.6820 us/op
  ✓ verifyMultipleAggregateSignatures - 8 sets            1.4355 ms/op      1.5259 ms/op
  ✓ verifyMultipleAggregateSignatures - 32 sets           3.7716 ms/op      3.9609 ms/op
  ✓ verifyMultipleAggregateSignatures - 128 sets         12.7219 ms/op     13.3319 ms/op
  ✓ verifyMultipleAggregateSignatures - 256 sets         24.0479 ms/op     25.3813 ms/op
  ✓ verifyMultipleAggregateSignatures - 512 sets         48.4746 ms/op     50.3668 ms/op
  ✓ verifyMultipleAggregateSignatures - 1024 sets        96.7417 ms/op     102.714 ms/op
  ✓ verifyMultipleAggregateSignatures - 2048 sets       189.2175 ms/op    205.2370 ms/op
  ✓ verifyMultipleAggregateSignatures - 16000 sets        1.3807  s/op      1.4500  s/op
  ✓ verifyMultipleAggregateSignatures - 100000 sets       8.8178  s/op      9.1515  s/op
  ✓ verifyMultipleAggregateSignatures - 200000 sets      17.1833  s/op     18.0676  s/op

@matthewkeil matthewkeil requested a review from a team as a code owner October 22, 2024 13:22
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.

1 participant