dsrvlabs / czg-keremony

JavaScript-based client to participate in Ethereum KZG Ceremony
https://dsrv.com
MIT License
13 stars 4 forks source link

Enhance random source #15

Open kim201212 opened 1 year ago

kim201212 commented 1 year ago

Random Spec.

Generating randomness

The randomness that each participant contributes to a set of Powers of Tau is in the form of an integer in the range (1, bls.r).

The participant MUST generate 4 different secrets from a cryptographically-secure pseudo-random number generator (CSPRNG) of their choosing.

Each secret MUST meet the following requirements:

Furthermore, each secret SHOULD meet the following requirements:

KeyGen

A good method for meeting the above requirements would be to make use of the KeyGen function offered by all compliant BLS libraries. This function takes in a seed of at least 32 bytes and returns a uniformly sampled integer of $\mathbb{F}_r$.

Task

rootwarp commented 1 year ago

@kim201212 Please describe the spec of the random source. It could be helpful to debug together.

rootwarp commented 1 year ago

@kim201212 I know you have already done this issue, but what do you think expanding this issue by doing below?

https://github.com/dsrvlabs/czg-keremony/blob/f49341086590fed830d4b141c3785611c208a9f8/index.js#L142-L146

kim201212 commented 1 year ago

@kim201212 I know you have already done this issue, but what do you think expanding this issue by doing below?

https://github.com/dsrvlabs/czg-keremony/blob/f49341086590fed830d4b141c3785611c208a9f8/index.js#L142-L146

That's a great idea!