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
- 01 Read commit_reveal/core.py to see H(value ‖ salt) and the timing-safe reveal in plain Python.
- 02 Read commit_reveal/zkp.py for secp256k1 point arithmetic and the Fiat–Shamir Schnorr proof.
- 03 Run the quickstart snippets and inspect the intermediate values — commitment, salt, proof transcript.
- 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) More use cases
Anti-MEV & fair ordering
Front-runners cannot react to orders they cannot yet see.
Verifiable on-chain AI
Independent agents answer without copying each other.
Sealed-bid auctions
No bidder can peek at another’s bid before the deadline.
Fair-launch randomness
Uniform, unmanipulable randomness with no trusted oracle.
Hidden ballots & market resolution
Vote or resolve in secret, prove the reveal is honest.