Proof of Portfolio
A decentralized framework for verifiable, private performance metrics using Zero-Knowledge Proofs.
Proof of Portfolio (PoP) is a framework that enables Validators to generate verifiable attestations of private portfolio performance. The system provides tooling for the original data owners (Miners) and consumers (Signal Purchasers) to cryptographically verify these attestations—ensuring both data inclusion and correctness of calculated metrics—all without the validator ever exposing the underlying private data.
This is achieved by combining Merkle trees to commit to a history of portfolio data and Noir, a DSL for creating and verifying zero-knowledge proofs.
Table of Contents
Core Concepts
The PoP system establishes trust through a validator-centric attestation model. It assumes a validator already has access to a set of private miner data. The tooling then facilitates a cryptographic process built on two key principles:
-
Merkle Trees: A validator takes a miner's private portfolio history (checkpoints, positions, orders) and builds a Merkle tree from it. The resulting Merkle Root is made public. This root acts as a secure, tamper-proof fingerprint of the miner's entire dataset.
-
Zero-Knowledge Proofs (ZKPs): Using circuits written in Noir, the validator generates a proof that specific performance metrics were calculated correctly over the private data corresponding to the public Merkle root.
This combination allows for verifiable, private computation. Miners and signal purchasers can trust the publicly-stated performance metrics because:
- They can cryptographically verify their data was included in the calculation (by comparing their own data's Merkle root to the one the validator published).
- They can cryptographically verify the calculation itself was performed correctly (via the ZK proof).
The miner's sensitive financial data remains confidential throughout the entire process.
Project Structure
The repository is organized into two main directories:
circuits/: Contains all the Noir source code. The core logic for financial calculations (Sharpe ratio, returns, etc.) and the main circuit for verifying a miner's data against their Merkle root are defined here.src/: Contains the Python source code for the CLI, miner and validator logic, and demonstration scripts.
Installation
The project is managed with Python and requires the nargo toolchain for interacting with Noir circuits.
Automatically
uv add proof-of-portfolio
or
pip install proof-of-portfolio
Manually
1. Prerequisites
Ensure you have Noir/Nargo installed.
2. Standard Installation
Clone the repository and install the package in editable mode. This will install the pop command-line tool and all necessary Python dependencies.
git clone https://github.com/inference-labs-inc/proof-of-portfolio.git
cd proof-of-portfolio
pip install -e .
3. Installer Script (Optional)
An install.sh script is provided for convenience, which can help automate dependency setup.
./install.sh
Usage Workflow
The pop command-line interface provides tools for all participants in the ecosystem. The primary workflow is validator-driven.
1. Validator: Generating Proofs
Validators use the PoP toolkit to attest to the performance of miner data they possess.
First, a validator might use analyse-data to split a large file of all miner data into a standardized directory structure.
pop analyse-data --path validator_checkpoint.json --output ./miner_data/
Next, the validator processes each miner's data to generate a score and a Merkle root.
# Process a single miner's data
pop validate --path ./miner_data/5H.../data.json
# Process all miners in a directory
pop validate-all --path ./miner_data/
This produces a score.json file for each miner, containing the calculated metrics and the public Merkle root that commits to the data used.
2. Miner: Verifying Inclusion
After a validator publishes a Merkle root, a miner can independently verify that their data was included and processed correctly without tampering.
The miner runs the generate-tree command on their own private data.
# Miner provides the path to their own data file
pop generate-tree --path ./path/to/my_private_data.json
This command outputs a Merkle root. The miner can then compare this root to the one published by the validator. If they match, the miner has cryptographic proof that the validator used their exact data.
Utility Commands
-
generate-test-data: Creates a randomizedvalidator_checkpoint.json-style file for testing.pop generate-test-data --num-miners 5 --output-file test_data.json
-
save-tree: A helper utility to save atree.jsonfile to a different location.
Demos
The CLI includes a demo mode for testing purposes.
pop demo --help
main: Runs a comprehensive end-to-end test, including ZKP generation and verification with Barretenberg.
Example:
pop demo main --hotkey 5H...
Development
The project is under active development. Contributions are welcome. Please refer to the source code and circuits for detailed implementation information.
Metadata
Release files for proof-of-portfolio 0.0.172
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| proof_of_portfolio-0.0.172.tar.gz | 23.4 MB | Without provenance | Details for proof_of_portfolio-0.0.172.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| proof_of_portfolio-0.0.172-py3-none-any.whl | Python 3 | none | any | Details for proof_of_portfolio-0.0.172-py3-none-any.whl |
Total release size: 46.9 MB
Release files / proof_of_portfolio-0.0.172.tar.gz
| Download URL | proof_of_portfolio-0.0.172.tar.gz |
|---|---|
| Size | 23.4 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
365b8df8b6ca3080e574c455ccb7c3aa7847ea8317b77c58abf34bca3accbc42
|
|
BLAKE2b-256 checksum How to use checksums |
a6907b883624bdd9022abf84fdd5e92cb8216113350813f8ade28f7fe131bfa1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / proof_of_portfolio-0.0.172-py3-none-any.whl
| Download URL | proof_of_portfolio-0.0.172-py3-none-any.whl |
|---|---|
| Size | 23.4 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c126f43dc8d8cf665dd7017d17038e60e7eff4b0eb8e89a440b3b11a2f5adefe
|
|
BLAKE2b-256 checksum How to use checksums |
1a44974168712439deeb796294298de462fd359b0efec1a56bf4c3db2d246b02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for proof-of-portfolio 0.0.172
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.