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

A utility to print the powers of tau from a challenge file #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

weijiekoh
Copy link
Collaborator

This PR introduces a print_powers program that reads a challenge file and outputs the powers of tau stored in it. It is useful for anyone who wants to use these values for purposes such as polynomial commitment libraries.

Usage: 
<challenge_file> <circuit_power> <batch_size> <category_to_extract> <num_to_extract>

<category_to_extract> should be one of:

  • taug1
  • taug2
  • alphag1
  • betag1
  • betag2

For example, this command prints the first 2 TauG2 elements stored in challenge. Note that challenge was generated using a circuit power of 28 and batch size of 256:

phase2-bn254/powersoftau$ ./target/release/print_powers challenge 28 256 taug2 2
G2(x=Fq2(Fq(0x1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed) + Fq(0x198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c2) * u), y=Fq2(Fq(0x12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa) + Fq(0x090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b) * u))
G2(x=Fq2(Fq(0x04c5e74c85a87f008a2feb4b5c8a1e7f9ba9d8eb40eb02e70139c89fb1c505a9) + Fq(0x21a808dad5c50720fb7294745cf4c87812ce0ea76baa7df4e922615d1388f25a) * u), y=Fq2(Fq(0x2d58022915fc6bc90e036e858fbc98055084ac7aff98ccceb0e3fde64bc1a084) + Fq(0x204b66d8e1fadc307c35187a6b813be0b46ba1cd720cd1c4ee5f68d13036b4ba) * u))

Note how in the above example, the first TauG2 element is the generator of the G_2 group as specified in EIP-197.

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