5 releases
| 0.2.6 | Sep 13, 2025 |
|---|---|
| 0.2.5 | Sep 4, 2025 |
| 0.2.4 | Sep 2, 2025 |
| 0.2.3 | Sep 2, 2025 |
| 0.0.1 | Jun 11, 2024 |
#6 in #avs
233 downloads per month
50KB
741 lines
OpenRank SDK
A command-line SDK for interacting with the OpenRank AVS (Actively Validated Service) - a decentralized trust and reputation system that runs PageRank-style algorithms in Trusted Execution Environments (TEEs).
What is OpenRank?
OpenRank is a decentralized system for computing trust scores and reputation rankings using the EigenTrust algorithm (a variant of PageRank). It operates within Trusted Execution Environments to ensure computational integrity and provides censorship-resistant, verifiable trust computations.
The system works with:
- Trust data: Relationships between entities with trust weights
- Seed data: Initial trust scores for bootstrapping the algorithm
- Score computation: Running EigenTrust to generate final trust scores
Installation
Build the SDK from source:
cd sdk
cargo build --release
The binary will be available at target/release/openrank.
Commands
Initialisation
Initialise the workspace with example datasets and .env file:
openrank init ./my-workspace
This command will create a folder with following structure:
- trust/
- seed/
- .env
.env file contains a placeholder for your mnemonic phrase:
MNEMONIC="add your mnemonic phrase here"
Operations
compute-request
Submit a computation request using trust and seed data from local folders.
openrank compute-request <TRUST_FOLDER_PATH> <SEED_FOLDER_PATH>
Arguments:
TRUST_FOLDER_PATH- Path to folder containing trust CSV filesSEED_FOLDER_PATH- Path to folder containing seed CSV files
Example:
openrank compute-request ./trust_data ./seed_data
compute-watch
Monitor and watch for computation results by compute ID.
openrank compute-watch <COMPUTE_ID> [--out-dir <OUT_DIR>]
Arguments:
COMPUTE_ID- The computation ID to monitor
Options:
--out-dir <OUT_DIR>- Output directory for results (optional)
Example:
openrank compute-watch abc123 --out-dir ./results
download-scores
Download computed scores for a specific computation.
openrank download-scores <COMPUTE_ID> [--out-dir <OUT_DIR>]
Arguments:
COMPUTE_ID- The computation ID to download scores for
Options:
--out-dir <OUT_DIR>- Output directory for downloaded scores (optional)
Example:
openrank download-scores abc123 --out-dir ./scores
Local Operations
compute-local
Run OpenRank computation locally using trust and seed CSV files.
openrank compute-local <TRUST_PATH> <SEED_PATH> [OUTPUT_PATH]
Arguments:
TRUST_PATH- Path to trust CSV fileSEED_PATH- Path to seed CSV fileOUTPUT_PATH- Output path for computed scores (optional)
CSV Format:
- Trust CSV:
from_id,to_id,trust_weight - Seed CSV:
peer_id,score
Example:
openrank compute-local trust.csv seed.csv scores.csv
verify-local
Verify computed scores against trust and seed data locally.
openrank verify-local <TRUST_PATH> <SEED_PATH> <SCORES_PATH>
Arguments:
TRUST_PATH- Path to trust CSV fileSEED_PATH- Path to seed CSV fileSCORES_PATH- Path to scores CSV file to verify
Example:
openrank verify-local trust.csv seed.csv computed_scores.csv
Data Formats
Trust CSV Format
from_id,to_id,trust_weight
alice,bob,0.8
bob,charlie,0.6
charlie,alice,0.9
Seed CSV Format
peer_id,score
alice,1.0
bob,0.5
charlie,0.3
Scores CSV Format
peer_id,score
alice,0.45
bob,0.32
charlie,0.23
Or use AWS credential files and profiles as per standard AWS CLI configuration.
Examples
Complete Local Workflow
-
Prepare your data files:
echo "alice,bob,0.8" > trust.csv echo "bob,charlie,0.6" >> trust.csv echo "alice,1.0" > seed.csv echo "bob,0.5" >> seed.csv -
Run local computation:
openrank compute-local trust.csv seed.csv scores.csv -
Verify the results:
openrank verify-local trust.csv seed.csv scores.csv
Distributed Computation Workflow
-
Submit computation request:
openrank compute-request ./trust_folder ./seed_folder -
Monitor computation:
openrank compute-watch <compute_id> --out-dir ./results -
Download results:
openrank download-scores <compute_id> --out-dir ./final_scores
Algorithm Details
OpenRank implements the EigenTrust algorithm with the following key features:
- Pre-trust weighting: Uses a 0.5 weight for seed trust values
- Convergence threshold: Stops iteration when delta < 0.01
- Reachability filtering: Only includes peers reachable from seed nodes
- Normalization: Ensures trust distributions sum to 1.0
The algorithm iteratively computes trust scores until convergence, providing a robust measure of reputation in decentralized networks.
Getting Help
openrank --help
openrank <command> --help
For more information about the OpenRank system and TEE deployment, see the main project documentation.
Dependencies
~113MB
~2M SLoC