PTau¶
- class ptau.PTau(ptau_file=None, working_dir='./')¶
Manages creating and contributing to a powers of tau ceremony.
- Parameters:
ptau_file (str, optional) – Path to a previously generated powers of tau ceremony file.
working_dir (str, optional) – Path that all given file paths are relative to. Defaults to the current directory
- beacon(output_file=None, public_entropy='0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f', iter=10)¶
Finalize phase 1 of the powers of tau ceremony.
- Parameters:
output_file (str, optional) – Path of where the ptau file should be outputted to.
public_entropy (str, optional) – Public entropy to use in the beacon. Defaults to 0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f
iter (int) – Specifies how many iterations to use in the beacon.
- cleanup()¶
Deletes old/intermediate powers of tau files
- contribute(name='', entropy='', output_file=None)¶
Contributes to the powers of tau ceremony
- Parameters:
name (str, optional) – Name of the contribution.
entropy (str, optional) – Random text to use as entropy in the contribution. Defaults to random lowercase letters.
output_file (str, optional) – Path of where the ptau file should be outputted to.
- contribute_challenge(challenge, output_file, entropy, curve='bn128')¶
Contribute to a challenge and produce a response.
- Parameters:
output_file (str, optional) – Path of where the response file should be outputted to.
entropy (str) – Random text to serve as entropy to the contribution
curve (str, optional) – Specifies which cryptographic curve to use. Defaults to the bn128 curve.
- export_challenge(output_file)¶
Export a challenge that can be sent to third party software.
- Parameters:
output_file (str, optional) – Path of where the challenge file should be outputted to.
- import_response(response, output_file=None)¶
Import a response.
- Parameters:
response (str, optional) – Path to response file to use as input.
output_file (str, optional) – Path of where the response file should be outputted to.
- prep_phase2(output_file=None)¶
Prepare for phase 2 of the powers of tau ceremony.
- Parameters:
output_file (str, optional) – Path of where the ptau file should be outputted to.
- start(curve='bn128', constraints='12')¶
Initializes a powers of tau ceremony
- Parameters:
curve (str, optional) – Curve to use in the powers of tau ceremony. Defaults to the bn128 curve.
constraints (str, optional) – The number of constraints supported by the powers of tau ceremony raised to the power of 2.
- verify()¶
Verfies the power of tau ceremony is valid.