danrr / Generic-MITLP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Generic-MITLP

This repository contains the implementation of multiple flavours of time-lock puzzles:

Installation

Create virtual env:

 python3 -m venv .venv         

Activate virtual env:

source .venv/bin/activate

Using pip-tools

Install pip-tools:

pip install pip-tools

Run pip-sync:

pip-sync

Alternatively, you can install requirements manually.

Install requirements:

pip install -r requirements.txt

Install dev requirements:

pip install -r requirements-dev.txt

Development

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.

Testing

Includes tests for all implemented puzzles. Run with

pytest

Benchmarks

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

About


Languages

Language:Python 95.2%Language:Solidity 4.8%