Skip to content

Readme could be clearer #1

Description

@0xPhaze

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-noir ecrecover::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.

  • I still don't know what hashed_message actually 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-L71C7

I'll submit a PR if you want me to update these.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions