Prime Network is a protocol for decentralized, incentivized compute orchestration. The compute resources across multiple providers are organized under various “domains” (logical groupings of compute workloads), and within each domain are compute pools that are allocating compute to a specific effort (e.g., distributed synthetic data generation run, large transformer model training run, etc). Staking (with slashing) and rewards for provided compute are used to manage cryptoeconomic incentives.
- Decentralized Providers and Nodes: In the protocol, individual Providers stake to register their computing resources (represented by Nodes) in the network.
- Roles:
- Federator: Can set high-level parameters and create “domains.”
- Validator: Maintains the quality of the network by whitelisting and validating providers/nodes and their work.
- Provider: Supplies compute resources by staking and adding nodes.
- Compute Manager: Creates compute pools and manages their lifecycle, invites nodes to contribute compute, has the ability to remove or blacklist underperforming nodes or providers from the pool they manage.
- Domains: Group compute tasks or workloads within a logical boundary. Each domain may have specialized validation logic and operational parameters.
- Compute Pools: Aggregates nodes from various providers for specific tasks, tracks active node time intervals, and calculates rewards.
- Role Management: Implements
FEDERATOR_ROLE
andVALIDATOR_ROLE
for controlling who can create domains, whitelist providers, etc. - Registration: Providers can register with a stake, and compute nodes can be added with a valid signature.
- Domain Creation: Federator can create domains in DomainRegistry.
- Locking & Unbonding: When providers stake, the stake is held until the unbonding period completes.
- Slashing: Provides a mechanism to penalize malicious stakers by partially or fully removing their stake.
- Provider/Node Records: Keeps details about providers (e.g., whitelisted status) and their nodes (compute capacity, active/inactive state, validation, etc.).
- Node Status Updates: Works in tandem with ComputePool when nodes join or leave a pool.
- Domain Metadata: Each domain has a unique ID, name, validation logic, and optional parameters URI.
- Management: Allows the Federator role to update domain parameters or validation logic as needed.
- Pool Lifecycle: Pools can be created (linked to a domain), started, and ended.
- Node Work Tracking: Maintains join/leave records for each node, enabling reward distribution to be computed.
- Blacklisting: Pool creators can remove or blacklist providers/nodes if necessary.
- Reward Calculation: Based on each node’s active time in a compute pool, multiplied by a configured reward rate.
- Claiming: Providers (on behalf of their nodes) can claim their accrued rewards.
A typical usage flow might look like this:
- Federator deploys or configures all module contracts:
PrimeNetwork
,ComputeRegistry
,StakeManager
,DomainRegistry
,ComputePool
, etc. - Federator sets a minimum stake requirement in
PrimeNetwork
. - Provider stakes and registers via
PrimeNetwork
. - Provider adds compute nodes, which are then validated/whitelisted by a Validator.
- Federator creates a new domain in
DomainRegistry
. - Provider (acting as a participant) creates a
ComputePool
and invites nodes to join. - Provider can leave a pool (or be blacklisted) at any time, triggering node status updates in
ComputeRegistry
. - RewardsDistributor calculates and disperses rewards to providers for the compute time they contributed.
curl -L https://foundry.paradigm.xyz | bash
foundryup
forge build --via-ir
forge test --via-ir -vvv
# start a local chain
anvil
# in a new terminal
./deploy.sh