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.1b2.tar.gz (1.3 MB view details)

Uploaded Source

Built Distributions

chiapos-0.1b2-cp38-cp38-win_amd64.whl (226.0 kB view details)

Uploaded CPython 3.8 Windows x86-64

chiapos-0.1b2-cp38-cp38-manylinux2014_aarch64.whl (196.3 kB view details)

Uploaded CPython 3.8

chiapos-0.1b2-cp38-cp38-manylinux2010_x86_64.whl (214.4 kB view details)

Uploaded CPython 3.8 manylinux: glibc 2.12+ x86-64

chiapos-0.1b2-cp38-cp38-macosx_10_14_x86_64.whl (193.0 kB view details)

Uploaded CPython 3.8 macOS 10.14+ x86-64

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

Uploaded CPython 3.7m Windows x86-64

chiapos-0.1b2-cp37-cp37m-manylinux2010_x86_64.whl (216.0 kB view details)

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

chiapos-0.1b2-cp37-cp37m-macosx_10_14_x86_64.whl (192.3 kB view details)

Uploaded CPython 3.7m macOS 10.14+ x86-64

File details

Details for the file chiapos-0.1b2.tar.gz.

File metadata

  • Download URL: chiapos-0.1b2.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.1b2.tar.gz
Algorithm Hash digest
SHA256 096b867131de74240420b51ca10d0ecae93a702d7972c52e676419d59203080f
MD5 0e8cd00fa7f497bcee9b50501bded711
BLAKE2b-256 461e853164b882434990b55c33dd445b100d46d7631189469204ef62ca283f22

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 226.0 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.1b2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 374488723cbe2a80921877f2db19f08e3bb8902797db9454c40830fae121522c
MD5 195b68f4d518327fbcdcf21fe46cd664
BLAKE2b-256 6889fb87ce6329c8eb14f580f93652f562efc3991e78e0a731d1cafb51f858f6

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp38-cp38-manylinux2014_aarch64.whl
  • Upload date:
  • Size: 196.3 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.1b2-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 797dec822d69b08191fd26d5ad238bff9ea110af7731b3b1b41fa60e49f41468
MD5 5016509bf5e5012cc8f438137f110c81
BLAKE2b-256 60708d49431606374b506f2ef44a40990edd292b1bf4ee7d096fa4a1570fc5fc

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp38-cp38-manylinux2010_x86_64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp38-cp38-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 214.4 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.1b2-cp38-cp38-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 d65d8b81ea428d50119eb8f8b879788b61cbfdea5d66523570757a0bf8bfa6c3
MD5 5b9208b9bffc2ae4e0f7d48aa6f80a81
BLAKE2b-256 d39ddd8b1a7da634c554ea065ee3e711064b68d2b208b9fd88ffe697661cbbae

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp38-cp38-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp38-cp38-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 193.0 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.1b2-cp38-cp38-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 e619287d9b357640b7c451a7175828def988365549c6623b38c4bc12e3137b31
MD5 4d23ba2fc925a123497fa2a8bb94adef
BLAKE2b-256 8f4fb5a383de5677abee2a54981d66b1a7b798a6516f4aa8ec7dd3e7380a51d8

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: chiapos-0.1b2-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.1b2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 1afe987715f28d945436d6be9d5e47e3e3ed1da7765bb33676a8d84ce0ec5c5e
MD5 433b157dcc7afbc5f043c28c2368a827
BLAKE2b-256 10af3fa34a3554696fc8eedc994043f7d3f5a3ff32a154338143fd69274c7ff9

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp37-cp37m-manylinux2010_x86_64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp37-cp37m-manylinux2010_x86_64.whl
  • Upload date:
  • Size: 216.0 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.1b2-cp37-cp37m-manylinux2010_x86_64.whl
Algorithm Hash digest
SHA256 36f218855aaea62d1f6c35e7e4f8ebe64320f70a098e29b9be75a5d3d5a4e48c
MD5 844fef77656f518b81faf2ca8c3701c7
BLAKE2b-256 8d686b8ef0335568e9b15db600213011c7119fd809fe5b6d379607c2f61639b9

See more details on using hashes here.

File details

Details for the file chiapos-0.1b2-cp37-cp37m-macosx_10_14_x86_64.whl.

File metadata

  • Download URL: chiapos-0.1b2-cp37-cp37m-macosx_10_14_x86_64.whl
  • Upload date:
  • Size: 192.3 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.1b2-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm Hash digest
SHA256 b84aa1d484a4cb09da3f2e842908737ae20689eed886895031548018163c69b9
MD5 454cb6b091bd93e7bd3906844356ef01
BLAKE2b-256 21660bf7dfca51ba597458503d955bd1b136962e906f3e4a71f1f3bdddfea763

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