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

Uploaded Source

Built Distributions

chiapos-0.12.21-cp38-cp38-win_amd64.whl (185.3 kB view details)

Uploaded CPython 3.8 Windows x86-64

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

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

chiapos-0.12.21-cp38-cp38-macosx_10_14_x86_64.whl (173.6 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

chiapos-0.12.21-cp37-cp37m-win_amd64.whl (185.7 kB view details)

Uploaded CPython 3.7m Windows x86-64

chiapos-0.12.21-cp37-cp37m-manylinux2010_x86_64.whl (192.2 kB view details)

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

chiapos-0.12.21-cp37-cp37m-macosx_10_14_x86_64.whl (172.6 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

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

File metadata

  • Download URL: chiapos-0.12.21.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.21.tar.gz
Algorithm Hash digest
SHA256 e8d727dbecabc32640abb7aa44560a973ce2f8f2b1127d1f88d5afd4a5a1cf4f
MD5 c020e833363ed018e89a7e35df0b0256
BLAKE2b-256 5be42d021ad7d82b09b605ebe13c3845b730467ddaffb6a81c4b725b24fdfa58

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 185.3 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.21-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 7ab485447ee1ad9352aae1791b6754e87611d2c2573791f6262c1ef3e7845689
MD5 be4f7ff0b4448ad4689747a8f05a9968
BLAKE2b-256 d5d41e95ce43098b65702560a55bd2fa583a9e3fb3febfa454910d0302f66f99

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-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.21-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 13e866ede643efa4a7ff4717ae4a9fd3253a0a061af984942e4b34f3c9cc1a5c
MD5 e7a042c1599204e7881882acefe2c906
BLAKE2b-256 8b2649540c39d50e0b496775095ccad7ea943d614da81badc45b72a5ae9a4f81

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 173.6 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.21-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 eb646e63420ffe05ce49f7457db12aa34ce5860cb800f433b6ce19536560b274
MD5 e41120f4e3d635893ae93c2409d199ac
BLAKE2b-256 d1b9d9a8593a722b324f132d249933697ffbfa36c46aef38686ed5a58b60783b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 185.7 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.21-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2081fb47ad3120051c46a789b3643d7861cf012928acb3ad12ec6e1c35f222d0
MD5 0e210abd186a2c75a4bbd9888db06e3c
BLAKE2b-256 03c749954295f10471fb310bb80d9c82e9d1e3b5a5f1818e5b7e67cd33e869c5

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 192.2 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.21-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 c136ae51184b39e63c3bf07b0b37d541c838c7c74968731e5a1af62c6d2df473
MD5 8c9a8635f3e4e42b2a4d4139cda4dc53
BLAKE2b-256 4f0d52ca653609582adace2e4559bb382cb2ab872271b9f74865dadd55aeef5f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: chiapos-0.12.21-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 172.6 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.21-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 c691862dcdcae1e212084877342c5f4982aac6eff4803b9362ff3ddc89bae91c
MD5 a316a55dd35177b9085eeae29d2b4213
BLAKE2b-256 292d8d72d1410fc0822ce1e3beaa48fdc632a4baf8acca5437a363225f8e3851

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