Skip to main content

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

Project description

Build PyPI PyPI - Format GitHub

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

Chia Proof of Space

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 by 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, 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.22.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

chiapos-0.12.22-cp38-cp38-win_amd64.whl (185.5 kB view details)

Uploaded CPython 3.8Windows x86-64

chiapos-0.12.22-cp38-cp38-manylinux2010_x86_64.whl (191.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.12+ x86-64

chiapos-0.12.22-cp38-cp38-macosx_10_14_x86_64.whl (173.8 kB view details)

Uploaded CPython 3.8macOS 10.14+ x86-64

chiapos-0.12.22-cp37-cp37m-win_amd64.whl (185.9 kB view details)

Uploaded CPython 3.7mWindows x86-64

chiapos-0.12.22-cp37-cp37m-manylinux2010_x86_64.whl (192.7 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.12+ x86-64

chiapos-0.12.22-cp37-cp37m-macosx_10_14_x86_64.whl (172.9 kB view details)

Uploaded CPython 3.7mmacOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: chiapos-0.12.22.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.22.tar.gz
Algorithm Hash digest
SHA256 618085cb24c1505b2be727f146c4f7bfc07e6759f54a8e53e2c662129a944209
MD5 3eb07ddf11012b5ae015370254daa20b
BLAKE2b-256 9c60b70b28a7572efd0ffd090f77ac43b9a1688802ededd1d8696dbb3bd0ba80

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.22-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 185.5 kB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.22-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 92557e6cff8c12c0c5f39783a418ec69c9d652ed40eda60d0f8c5c9617be8a15
MD5 ce712ef49dd29ca8219a544196186d4f
BLAKE2b-256 f828c85a59edcba00a9e5808bf740993b0719399e15ce0396aa830282099ce1a

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for chiapos-0.12.22-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1c4dacdac4734120545a0623624803583e37981648768650dffe16c006a3d7c8
MD5 3022900b3ee4b1cdc59a9fc0c0619429
BLAKE2b-256 f6915b937a5e37691219126498bdd17f001f1ae5b2aa63ba601fdb0dab112fd8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.22-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 173.8 kB
  • Tags: CPython 3.8, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.22-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b617a9f8eca34fb0079ce3e19984b6e0e856730d91290b0bd6c7925204b46ba4
MD5 44916ab52098f04f59e9b4601e446529
BLAKE2b-256 74fb3ac10ab553d8f9eeaff4249ee452a2be275fa3e1c7ea6452c2b235010e7a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.22-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 185.9 kB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.22-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 3be0849c366a0e0f1fe9b0e29c75f8bd5d4a428504c18407ecf6951a96cf024e
MD5 dc8bab4a131b6826bf4d6a29cf412e2b
BLAKE2b-256 0322370103637f24008b1ddd94ea4295d72d86b9aa2a5963fb6436a10456d1ca

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for chiapos-0.12.22-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 1030b92c6590fb0136da384718a1ca21f3e661e2c2ee0f28041bfa9e58ee6ed2
MD5 85fb512e0394b9677c7eca47054a0bda
BLAKE2b-256 f8d8732738e980ca84c859531168843dda5be652d04a5cc2a84f4b97aa611a7c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.22-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 172.9 kB
  • Tags: CPython 3.7m, macOS 10.14+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.46.1 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.22-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 8c796cb3f9e3202f630e3ff1c73ed101f07e15524d6384796920d0d11073fa15
MD5 4b6658b64710c92516e2f00a944940cb
BLAKE2b-256 8c0414f6263697a6073dc63771c59e5c01f57df9c5db9625b6ce06b2bd08618a

See more details on using hashes here.

Supported by

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