Skip to main content

Chia proof of space plotting, proving, and verifying (wraps C++)

Project description

Chia Proof of Space

Build PyPI PyPI - Format GitHub

Total alerts Language grade: Python Language grade: C/C++

Chia's proof of space is written in C++. Includes a plotter, prover, and verifier. It exclusively runs on 64 bit architectures and is best on CPUs with AES-NI support. Read the Proof of Space document to learn about what proof of space is and how it works.

Expect significant changes around June 30, 2020 that will break the plot file format, move to chacha8, and otherwise improve plotting performance.

C++ Usage Instructions

Compile

# Optional as CMake will install pybind11 src
git submodule update --init --recursive

mkdir -p build && cd build
cmake ../
cmake --build . -- -j 6

Run tests

./RunTests

CLI usage

./ProofOfSpace -k 25 -f "plot.dat" -m "0x1234" generate
./ProofOfSpace -k 25 -f "final-plot.dat" -m "0x4567" -t TMPDIR -2 SECOND_TMPDIR generate
./ProofOfSpace -f "plot.dat" prove <32 byte hex challenge>
./ProofOfSpace -k 25 verify <hex proof> <32 byte hex challenge>
./ProofOfSpace -f "plot.dat" check <iterations>

Benchmark

time ./ProofOfSpace -k 25 generate

Hellman Attacks usage

There is an experimental implementation which implements some of the Hellman Attacks that can provide significant space savings for the final file.

./HellmanAttacks -k 18 -f "plot.dat" -m "0x1234" generate
./HellmanAttacks -f "plot.dat" check <iterations>

Python

Finally, python bindings are provided in the python-bindings directory.

Install

python3 -m venv .venv
. .venv/bin/activate
pip3 install .

Run python tests

Testings uses pytest. Linting uses flake8 and mypy.

py.test ./tests -s -v

ci Building

The primary build process for this repository is to use GitHub Actions to build binary wheels for MacOS, Linux (x64 and aarch64), and Windows and publish them with a source wheel on PyPi. See .github/workflows/build.yml. CMake uses FetchContent to download pybind11. Building is then managed by cibuildwheel. Further installation is then available via pip install chiapos e.g.

Contributing and workflow

Contributions are welcome and more details are available in chia-blockchain's CONTRIBUTING.md.

The master branch is usually the currently released latest version on PyPI. Note that at times chiapos will be ahead of the release version that chia-blockchain requires in it's master/release version in preparation for a new chia-blockchain release. Please branch or fork master and then create a pull request to the master branch. Linear merging is enforced on master and merging requires a completed review. PRs will kick off a GitHub actions ci build and analysis of chiapos at lgtm.com. Please make sure your build is passing and that it does not increase alerts at lgtm.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

chiapos-0.12.23.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

chiapos-0.12.23-cp38-cp38-win_amd64.whl (225.9 kB view details)

Uploaded CPython 3.8 Windows x86-64

chiapos-0.12.23-cp38-cp38-manylinux2014_aarch64.whl (196.2 kB view details)

Uploaded CPython 3.8

chiapos-0.12.23-cp38-cp38-manylinux2010_x86_64.whl (214.2 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

chiapos-0.12.23-cp38-cp38-macosx_10_14_x86_64.whl (193.5 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

chiapos-0.12.23-cp37-cp37m-win_amd64.whl (226.3 kB view details)

Uploaded CPython 3.7m Windows x86-64

chiapos-0.12.23-cp37-cp37m-manylinux2010_x86_64.whl (215.4 kB view details)

Uploaded CPython 3.7m manylinux: glibc 2.12+ x86-64

chiapos-0.12.23-cp37-cp37m-macosx_10_14_x86_64.whl (192.8 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

Details for the file chiapos-0.12.23.tar.gz.

File metadata

  • Download URL: chiapos-0.12.23.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for chiapos-0.12.23.tar.gz
Algorithm Hash digest
SHA256 3f28d711cc652aa1c627bdc9e6a94034946e53a1cfedfeee2fb726f36964c437
MD5 074dace7ee7729dc6921d7321c23e0a1
BLAKE2b-256 a27e0c4750821d82e994050b8156b1b1becf79af3cc854d42f9267622fc0f225

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 225.9 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for chiapos-0.12.23-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 007c4eeed3b335e5ec534bffbc9374f8b2a6313c1847f2b720427bd51547a7f9
MD5 77a3dc355d14027eaff9769784860afb
BLAKE2b-256 3296f5dc9ef692d011c3a28c47fae3a2eb77ba7d4be5442312624f280336e103

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 196.2 kB
  • Tags: CPython 3.8
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.2

File hashes

Hashes for chiapos-0.12.23-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 4ee329a1524bdac1c58dafa7870647f702b5d0f72c1e0373150075d09c28e453
MD5 4517efb1b717a17f867fcdc0b2fc7c65
BLAKE2b-256 d283617f288e8c58618ed6567397f050ca36657ab521280e20a8345262278f16

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 214.2 kB
  • Tags: CPython 3.8, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.23-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 34e83a7dfe2a2444c7780bb82e2d0228a992ea675e7efb4735f0331d7cefd3d4
MD5 40fe9ae2d43a923df9c3e39ff68c0677
BLAKE2b-256 080c104b9c37e5ae33e5a195813c6d7a717e5f2f5ce1b60413721680687ad4d3

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 193.5 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for chiapos-0.12.23-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 ebfe1a39bc987b3f2c3c6bf87efad591f021b5752ea917410d8b27c265db0b66
MD5 43951c84589c2aaff98f80c2f8de28a7
BLAKE2b-256 989568d9fce4cc940842ef0b526e4b75895a37b4bea3f8fc0438f9677e00d3c9

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 226.3 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for chiapos-0.12.23-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 a7c0f5407a45f23a5ae46b3cadb41ed8754098f3b7d2b951f1dc39785d6bba85
MD5 8bfab0312d8b86bc474a9bb69b6f361a
BLAKE2b-256 cc77978efc6a40596968ec0fd5bcde2abf5f55e87fda97ef4d3f995bd039844c

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 215.4 kB
  • Tags: CPython 3.7m, manylinux: glibc 2.12+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.23-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 3fdade052160bc182407c6514955cc7f37e9f449504b174c34bdaf76fd110044
MD5 98404878d6dccbcaa2a81d067d624df2
BLAKE2b-256 acaf5b3aee5c448fce31b1bf2db7b700f354934fedf38ab3164d61c857062163

See more details on using hashes here.

File details

Details for the file chiapos-0.12.23-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: chiapos-0.12.23-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 192.8 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.7.8

File hashes

Hashes for chiapos-0.12.23-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 2d91c9ae7fba6bdf30fd90d5b12267feddda24ed947c7a2ebaaa0e41d66be47d
MD5 5ca6df758add2c42be4b2c9a9b8b89c3
BLAKE2b-256 2cff46e9a355358d7688f60049ac6756cb708f36fd880b494b689666d8c2972c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page