-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add Proof of Work #74
Comments
The constraints version is fairly easy, right? Just check the output of |
Yes, should be. Just some constraints for CRH + constraints to enforce |
@tsunrise, @alexchmit pointed out that for PoW it does not suffice to use a CRH. Rather we have to use something that is RO like. I think for this we would have to create a "Cryptographic Hash Function" primitive that achieves these properties. Then you can instantiate it with the existing Blake2s and Poseidon implementations. I imagine the interface is going to be fairly simple: pub trait CryptoHash {
type Parameters;
type Input;
type Output;
fn setup(&mut rng) -> Self::Parameters;
fn hash(params: &Self::Parameters, input: &Self::Input) -> Self::Output;
} Similarly for the gadget version. |
Got it, will send a PR here later. Thanks! |
Looks that arkworks does not have the implementation of proof of work (even the simplest one). We can probably add one here (use the one similar to
libiop
? )We can use existing
CRH
trait to make it generic. Also, we will need to write the constraints. (For now all CRH has its constraints written, so we just need to wrap it.)"one line algo"
For a message
M
and difficultyk
, the prover will bruteforce a nonceN
such that the lastk
bits of the output ofH(M || N)
are zero.The text was updated successfully, but these errors were encountered: