You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Things that were unclear/ambiguous to me during this assignment:
The inclusion of the public key in the polynomial.
and
Check whether the address is included in the polynomial. To do this, you will have to make sure the evaluation of polynomial at address is 0.
made it sound ambiguous whether it was the public key or the hash that was part of the polynomial. It's the hash.
This can be done by hashing the input value and asserting the evaluation of the polynomial at that hashed value to be zero
What is the "input value" here? It's the hash of the address..
Check that the hash of the polynomial is the same as the public polynomial hash provided
Does not mention which hashing algorithm and value was used. It's std::hash::pedersen(polynomial)[0]
the evaluation of the polynomial at that hashed value to be zero
Does not mention how the polynomial variable relates to the actual polynomial, i.e. that polynomial represents the coefficients: p[0] + p[1] * x + p[2] * x * x.
For some reason running assert(std::hash::blake2s(signature) == nullifier); caused a panic for me, splitting it up in two lines worked
let hash = std::hash::blake2s(signature);
assert(hash == nullifier);
This is resolved in newer versions (>= 0.10.0), but ecrecover module requires < 0.10.
The README could have included a hint to use https://github.com/colinnielsen/ecrecover-noirecrecover::secp256k1::PubKey::from_unified and ecrecover. std::ecdsa_secp256k1::verify_signature exists as well, but it doesn't use the unified pub key, and doesn't have an easy way of getting the hash/ethereum address.
Things that were unclear/ambiguous to me during this assignment:
and
made it sound ambiguous whether it was the public key or the hash that was part of the polynomial. It's the hash.
What is the "input value" here? It's the hash of the address..
Does not mention which hashing algorithm and value was used. It's
std::hash::pedersen(polynomial)[0]Does not mention how the
polynomialvariable relates to the actual polynomial, i.e. thatpolynomialrepresents the coefficients:p[0] + p[1] * x + p[2] * x * x.For some reason running
assert(std::hash::blake2s(signature) == nullifier);caused a panic for me, splitting it up in two lines workedThis is resolved in newer versions (>= 0.10.0), but
ecrecovermodule requires < 0.10.The
READMEcould have included a hint to use https://github.com/colinnielsen/ecrecover-noirecrecover::secp256k1::PubKey::from_unifiedandecrecover.std::ecdsa_secp256k1::verify_signatureexists as well, but it doesn't use the unified pub key, and doesn't have an easy way of getting the hash/ethereum address.I still don't know what
hashed_messageactually corresponds to. I'm guessing this would have to be created in the ethereum contract (or be some kind of constant). It's also not specified here https://github.com/ZKCamp/stealthdrop-assignment/blob/b402eec08e59d68c9c85d3a39613f82e57441ae8/utils/populate.ts#L71C7-L71C7I'll submit a PR if you want me to update these.