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

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. setup.py adds a dependency on pybind11 by invoking git to check out the pybind submodules. 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.14.tar.gz (1.2 MB view details)

Uploaded Source

Built Distributions

chiapos-0.12.14-cp38-cp38-win_amd64.whl (189.8 kB view details)

Uploaded CPython 3.8 Windows x86-64

chiapos-0.12.14-cp38-cp38-manylinux2010_x86_64.whl (190.9 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

chiapos-0.12.14-cp38-cp38-macosx_10_14_x86_64.whl (179.2 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

chiapos-0.12.14-cp37-cp37m-win_amd64.whl (190.1 kB view details)

Uploaded CPython 3.7m Windows x86-64

chiapos-0.12.14-cp37-cp37m-manylinux2010_x86_64.whl (191.3 kB view details)

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

chiapos-0.12.14-cp37-cp37m-macosx_10_14_x86_64.whl (178.4 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: chiapos-0.12.14.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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14.tar.gz
Algorithm Hash digest
SHA256 d9cbe87df17c6a155eeb596eb6d82d925e6ab6973217888160e77a353bdf899a
MD5 3c61f7a22c2294695fca6eac4c0de02b
BLAKE2b-256 7c3d31ae1407518eaa8f726b96038446a43da2b05c070bb71db8d67721bb74dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 189.8 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 70154c590b7732c14597b3b617dc01102d9220ff4a5ec6c6e0fd01ccb2ecdcff
MD5 099c189a48adbb6f447d7be7cdd47a77
BLAKE2b-256 c1eec369b944351d3e9ca79afd93096df24b569e37200fe36a032b42876c90bd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 190.9 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 5d1ed846a2d92719db9f69b26af27190d80e151080fbad31e51e3370e166e9fa
MD5 3d652233d193b65ab5a6d98fa9a32cc7
BLAKE2b-256 3e8e754dde959111a013e91f1c1fdc662460bc393292cac6c2f105a55b5cf9d6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 179.2 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 476e82326ebf52107c6e2c3a6daa96760d821f61c6d99692732cd5e3230efb65
MD5 c6ea2d6fff3a3fc50d3e3d3601908d96
BLAKE2b-256 6ae1243e3c54d9b3d9b02ed7dcfcea3109733debf0d9a633972ba8082a19b055

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 190.1 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 9364f8f2f5729d84bc2da2575301f58098fa3f457e718b17d42603803af7ba34
MD5 fb09e192df300ff05065da77c4ac6c0e
BLAKE2b-256 70282a32f7b1aaa4b6ed63164af0dc635417b497067c5a4ce32c7e9aa1abac4b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 191.3 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c2bab4ee8d93ee729971ce3e204e87de21e477ede5aef4685e5432cfede95b3f
MD5 4907a4d91d7890157009ee1042123795
BLAKE2b-256 3ed74717ea5494c808388fd0847365614e171d0ed25ac932e5e21c6740dc0578

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.14-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 178.4 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.0 CPython/3.7.7

File hashes

Hashes for chiapos-0.12.14-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 f2840dd1045be8ff9ac5ece2e1d18d0c6e8a03e553a47709cf6cacba2124dba5
MD5 6d5379cd691711fecbdeeb7d2de98832
BLAKE2b-256 72af8f1ce3ba3df8860f7b332d633a354ada5657d72ce613d9d077dfcfa6ca51

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