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. Read the Proof of Space document to learn about what proof of space is and how it works.

C++ Usage Instructions

Compile

# Requires cmake 3.14+

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

Static Compilation With glibc

Statically compile ProofOfSpace

mkdir -p build && cd build
cmake -DBUILD_PROOF_OF_SPACE_STATICALLY=ON ../
cmake --build . -- -j 6

Run tests

./RunTests

CLI usage

./ProofOfSpace -k 25 -f "plot.dat" -m "0x1234" create
./ProofOfSpace -k 25 -f "final-plot.dat" -m "0x4567" -t TMPDIR -2 SECOND_TMPDIR create
./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 create

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" create
./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 main 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 main/release version in preparation for a new chia-blockchain release. Please branch or fork main and then create a pull request to the main branch. Linear merging is enforced on main 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-1.0.12b14.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-1.0.12b14-cp311-cp311-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.11Windows x86-64

chiapos-1.0.12b14-cp310-cp310-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.10Windows x86-64

chiapos-1.0.12b14-cp39-cp39-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.9Windows x86-64

chiapos-1.0.12b14-cp38-cp38-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.8Windows x86-64

chiapos-1.0.12b14-cp37-cp37m-win_amd64.whl (1.6 MB view details)

Uploaded CPython 3.7mWindows x86-64

File details

Details for the file chiapos-1.0.12b14.tar.gz.

File metadata

  • Download URL: chiapos-1.0.12b14.tar.gz
  • Upload date:
  • Size: 1.2 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for chiapos-1.0.12b14.tar.gz
Algorithm Hash digest
SHA256 0e7fe35ee71e28251e4e66da1a35363827a8f7225a4a705b2ec916b73d706ef3
MD5 1e40ce0578c2e9e78a970d6ff3bddf7d
BLAKE2b-256 c5df20b2add42aa0ae7a3385911d13307fa4bc63ec73dce894edb9682dbc3089

See more details on using hashes here.

File details

Details for the file chiapos-1.0.12b14-cp311-cp311-win_amd64.whl.

File metadata

File hashes

Hashes for chiapos-1.0.12b14-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3410cb22c5eae6588ab97559a202064b1073561d34fa32ec288beedb6e7b4860
MD5 582392acf7f2ffced8ec80c5994ab74f
BLAKE2b-256 022d3b36170f0c113b452a0e9d07d720cccf73fe35abc25d6a7f6fd922b3f5b1

See more details on using hashes here.

File details

Details for the file chiapos-1.0.12b14-cp310-cp310-win_amd64.whl.

File metadata

File hashes

Hashes for chiapos-1.0.12b14-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 77fa87737acf034d41b549532da5b205e45a399e49d1ac78c8db2fe69c2b184e
MD5 06d59d5b6f4bcdcfc7e5526f41daa326
BLAKE2b-256 0d7a55d84cb4eb37bc8e4cc8caa36e08bafac4e29f890b8290017c06686ac05c

See more details on using hashes here.

File details

Details for the file chiapos-1.0.12b14-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: chiapos-1.0.12b14-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for chiapos-1.0.12b14-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 0fc38a4df588a3bcd49c4ffcb57563169c0990d0785c9306b593a048c8390bc3
MD5 e652b6a600398bdebcb037b597ddcc7d
BLAKE2b-256 ab01ce1b4698f1f43e57ae5bcfffa28930d9d32f3c6b06fecd738351aad2c9b3

See more details on using hashes here.

File details

Details for the file chiapos-1.0.12b14-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: chiapos-1.0.12b14-cp38-cp38-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.8, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for chiapos-1.0.12b14-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 b85c2d3a29c77ba7a04b8c02d65d36c72b57b8ccbd0dde8e06e00b8011d42712
MD5 86ac3e5b6bc598700569145555db2872
BLAKE2b-256 bde6a8b94e0224f82914fcee3eea1308e884689a28a2fa1b5ccc5079e409f0b4

See more details on using hashes here.

File details

Details for the file chiapos-1.0.12b14-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: chiapos-1.0.12b14-cp37-cp37m-win_amd64.whl
  • Upload date:
  • Size: 1.6 MB
  • Tags: CPython 3.7m, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for chiapos-1.0.12b14-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 2b19aa8478621dd557a4de04481650156ac832a7541b58ffff5e07c93862cbaf
MD5 41cb8bcbcc8d7993042c64d3086d43f3
BLAKE2b-256 567112c68bd329f3aeb4d717e90c5e6b8788dfb62595ca1808998600ac290edb

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