This repository provides a public reference implementation of the new Proof of Space (“PoSpace”) format, as defined in CHIP-48. It includes:
lib/pos/— core Proof of Space header‑only library (<pos/...>)lib/common/— header‑only utilities (<common/...>)lib/fse/— vendored FSE compression librarytools/src/plotter/— example C++ plotter executable using the abovetools/src/solver/- solver benchmarking and testingtools/src/prover/- finding proofs given challenges
- Header‑only, C++20 PoSpace core (
ProofCore, hashing, parameters, validator, etc.) - Example plotter tool demonstrating the plot pipeline and writing a plot
- Solver tool for benchmarking solve times on CPUs.
- A C++20‑capable compiler
- CMake ≥ 3.15
make(or your preferred build tool)- A Unix‑style shell (Linux/macOS) or PowerShell/Bash on Windows
-
Clone the repo:
git clone https://github.com/Chia-Network/pos2-chip.git
cd pos2-chip -
Build
Option A: Use the helper script
./build-release.sh
Option B: Use CMake directly
First, build with
Releasemode to enable optimizations:cmake -B build -DCMAKE_BUILD_TYPE=Release .Next, compile:
Linux:
cmake --build build -j$(nproc)macOS:
cmake --build build -j$(sysctl -n hw.logicalcpu)
From the root of your build directory, invoke the plotter executable:
./build/src/tools/plotter/plotter <k>
By default it uses the sample plot ID and parameters defined in tools/plotter/src/main.cpp. To customize, edit that file or supply your own main() implementation.
strength influences the effective plot filter. Higher strength, means that your plot will be accessed less frequently for responding to challenges.
To use k=28:
./build/src/tools/plotter/plotter test 28 2To use k=28 and sub_k=20
./build/plotter 28 20Run the solver executable with one of the two modes:
Coming soon.
./build/solver benchmark <k-size>Where <k-size> is an integer value for the solver’s k parameter (e.g. 28).
Example:
./build/solver benchmark 32Outputs timing and performance metrics for reconstructing proofs.
Reads the plot, prints its parameters, and runs the a chaining test for getting and solving for a full proof.
Note
Currently the solver does not accept a challenge to choose a proof from the plot. Coming soon (TM).
./build/solver prove <plot-file>Where <plot-file> is the path to a plot file to test.
Example:
./build/solver prove /path/to/plot.binNote
Plot files are changing frequently, so use the plotter to generate a new plot to then test it.
To build the tests, set the option -DCP_BUILD_TESTS=ON when configuring.
Example:
cmake -B build -DCP_BUILD_TESTS=ON .Or you can use the run-tests.sh script
./run-tests.shSee the run-tests.sh script for more documentation.
Note
Building tests is enabled by default when building from CI.