A quick look at zero-knowledge proofs

(bernsteinbear.com)

23 points | by evakhoury 2 days ago

1 comments

  • _alphageek 12 minutes ago
    Amazing article. Will save to explain ZKP to others.

    One tiny correction

    random.randrange(100) gives 300 possible commitments(3 colors for hundred nonces) After seeing a couple of revealed edges, the verifier can figure out the palette and brute-force all 300 combinations, effectively opening every commitment.

    It can be mitigated if we use 128 bits of randomness, e.g. secrets.token_bytes(16).

    Also I would use sha256 instead of hash. Python hash is not considered secure as it does not have proper collision resistance.