This repository contains the implementation of multiple flavours of time-lock puzzles:
- Delegated Generic Multiple Instance Time-Lock Puzzle
- Generic Multiple Instance Time-Lock Puzzle
- Multiple Instance Time-Lock Puzzle by Abadi & Kiayias
- Original Time-Lock Puzzle by Rivest, Shamir & Wagner
Create virtual env:
python3 -m venv .venv
Activate virtual env:
source .venv/bin/activate
Install pip-tools:
pip install pip-tools
Run pip-sync:
pip-sync
Install requirements:
pip install -r requirements.txt
Install dev requirements:
pip install -r requirements-dev.txt
Install editable package:
pip install -e .
Project uses pip-tools
to manage dependencies.
Dependencies are listed in pyproject.toml
under [project]
-> dependencies
and [project.optional-dependencies]
-> dev
.
To update dependencies, change pyproject.toml and run the pip-compile
commands listed in the requirements files.
Includes tests for all implemented puzzles. Run with
pytest
benchmark_squarings.py
- Find how many squarings a CPU can do in 1 second
benchmark_puzzles.py
- Find the run time of each algorithm for all puzzles
benchmark_tlp_solve_single.py
- Find the run time of solving a single TLP; useful in making sure the benchmarking is correct