Skip to content
commit-reveal Source  →

Educators, students, and reviewers learning commit-reveal

Teaching cryptography

A readable, zero-dependency reference you can teach from.

The whole library is small enough to read top to bottom in an afternoon. secp256k1 is the textbook affine implementation; the Schnorr proof is the textbook Fiat–Shamir transformation. Nothing is hidden behind a native binding.

The problem

Most crypto libraries are either too large to read or delegate the interesting parts to compiled code. To learn how a commitment or a Schnorr proof actually works, you need source you can follow line by line — with no dependency you have to trust on faith.

How commit-reveal does it

  1. 01 Read commit_reveal/core.py to see H(value ‖ salt) and the timing-safe reveal in plain Python.
  2. 02 Read commit_reveal/zkp.py for secp256k1 point arithmetic and the Fiat–Shamir Schnorr proof.
  3. 03 Run the quickstart snippets and inspect the intermediate values — commitment, salt, proof transcript.
  4. 04 Because there are no runtime dependencies, there is nothing off-page to explain away.

The code

# Every step is inspectable — nothing is compiled away.
scheme = CommitRevealScheme()
commitment, salt = scheme.commit("lesson-1")
print(commitment.hex(), salt.hex())            # look at the bytes
assert scheme.reveal("lesson-1", salt, commitment)

Why zero dependencies is a security property