Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 47 additions & 0 deletions Developer/CODE_STANDARDS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Code Standards

Code style and quality expectations for contributions to DevNet. This is the
detail behind the one-line summary in [CONTRIBUTING.md](CONTRIBUTING.md#code-standards);
see that file first for the general contribution flow.

## Python (`dincli/`, `tests/`, service files)

- Plain **PEP 8**. There is no `[tool.ruff]` config committed in
`pyproject.toml` — `.ruff_cache` is a local artifact, not enforced CI
config — so use judgment and keep style consistent with the surrounding
file rather than relying on a linter to catch it.
- Python **>= 3.12** (see [DEVELOPMENT_SETUP.md](DEVELOPMENT_SETUP.md)).
- Tests mock chain/IPFS state via `monkeypatch` and `typer.testing.CliRunner`
rather than hitting a live network — follow the existing patterns in
`tests/test_dintoken.py` and `tests/test_ipfs_config.py` for new tests.
- New CLI behavior should have a test that invokes the actual registered
Typer command (via `CliRunner`), not just the underlying function —
otherwise a wiring bug (wrong command path, wrong option name) can pass
review undetected.

## Solidity (`foundry/src/`)

- `solc 0.8.28`, `via_ir = true` (see `foundry/foundry.toml`). Build and test
with `forge build` / `forge test` before opening a PR.
- NatSpec (`///`, `@notice`, `@dev`, `@param`, `@return`) throughout —
existing contracts are heavily annotated; match that density for new
public/external functions.
- Prefer **custom errors** over `require(condition, "string")`. Revert
strings are the larger contributor to contract size, and several
contracts (`DINTaskCoordinator`, `DINTaskAuditor`) are close enough to
the EIP-170 runtime-size limit that this isn't a style preference — see
the **Contract size budget** section in
[CONTRIBUTING.md](CONTRIBUTING.md#submitting-prs) for the enforced
margins and the gate script that checks them.
- Every deployable contract's bundled ABI under `dincli/abis/` must be
regenerated in the same PR that changes its interface — see
**Submitting PRs** in [CONTRIBUTING.md](CONTRIBUTING.md#submitting-prs)
for the exact command.

## General

- Keep commits focused and PRs scoped to one change; unrelated cleanup
belongs in its own PR.
- Don't add abstractions, fallbacks, or validation for cases the current
code can't hit — see what's actually enforced by the type/contract
boundary before adding a guard for it.
5 changes: 2 additions & 3 deletions Developer/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ git checkout develop

# Install dependencies and set up dincli in editable mode
pip install -e .

# See full setup guide
/Developer/DEVELOPMENT_SETUP.md
```

See [DEVELOPMENT_SETUP.md](DEVELOPMENT_SETUP.md) for the full setup guide (Python version, Foundry, running tests).

Create a feature branch, commit your changes, and open a pull request to `develop`.

Every PR is reviewed and merged by someone other than its author. [MAINTAINING.md](MAINTAINING.md) describes how review, merging, and issue/task closure work.
Expand Down
52 changes: 50 additions & 2 deletions Developer/DEVELOPMENT_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,62 @@ This file is the minimal setup entrypoint for contributors working on DevNet.

**Prerequisite:** [Wallet Setup](../Documentation/public/guides/wallet-setup.md) — for development, use demo mode or `ETH_PRIVATE_KEY_<n>` in `.env`. Never commit real keys.

## Requirements

- Python **>= 3.12**
- [Foundry](https://book.getfoundry.sh/getting-started/installation) (`forge`, `anvil`) — the primary Solidity toolchain
- Node.js + npm — only needed inside `foundry/` (for `npm ci`, see below) and if you're also touching the secondary `hardhat/` toolchain

## Local Python Setup

```bash
git checkout develop
pip install -e .
pip install -e ".[test]"
```

The `[test]` extra installs `pytest` and `torch`, which the unit test suite
needs even outside the ML/DP service code.

Run the unit test suite the same way CI's Python job does — `-m "not
integration"` excludes `tests/dincli/`'s integration harness, which needs a
live Hardhat node, IPFS daemon, and Docker, and which otherwise autouse-starts
and restarts local chain/IPFS processes as a side effect of being collected:

```bash
pytest -m "not integration" -q # run all unit tests
pytest tests/test_dintoken.py -k test_name -m "not integration" # run a single test
```

If you are working on the ML or DP service code, make sure your environment also contains the training dependencies used by the current model services, including PyTorch and the test runner you intend to use.
To run the full integration suite instead (with its prerequisites and a
disposable environment), see the
[dincli testing guide](../Documentation/technical/testing/dincli-testing-guide.md).

## Foundry (Solidity) Setup

Install Foundry if you don't have it yet:

```bash
curl -L https://foundry.paradigm.xyz | bash
foundryup
```

Then build and test the contracts:

```bash
cd foundry && npm ci && forge build && forge test
```

`npm ci` must run before `forge test` — `Upgrades.validateImplementation` shells
out over FFI to `npx @openzeppelin/upgrades-core`, and without
`foundry/node_modules` already populated from the committed lockfile, the
parallel test run can race fetching that package. See [CLAUDE.md](../CLAUDE.md)
for the full explanation and the Hardhat (secondary toolchain) commands.

## Testing Reference

Deeper, feature-specific testing guides live under
[Documentation/technical/testing/](../Documentation/technical/testing/), including
the general [dincli testing guide](../Documentation/technical/testing/dincli-testing-guide.md).

## Where To Start

Expand Down
6 changes: 2 additions & 4 deletions Developer/GOOD_FIRST_ISSUES.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,12 @@ Core components:

## Open Issues

### 0. Starter Task: Differential Privacy & Responsible AI Review
### 0. Starter Task: Differential Privacy & Responsible AI Review — ✅ Completed

**Difficulty:** Beginner (review/analysis, not implementation)
**Area:** Privacy-Preserving Federated Learning / AI Governance
**Detailed issue:** [issues/dp-governance-review-starter-task.md](issues/dp-governance-review-starter-task.md)
**Status:** ✅ Done. Completed by @walkonwayvs in [PR #89](https://github.com/InfiniteZeroFoundation/DevNet/pull/89). The review is at [Documentation/technical/audits/dp-mechanism-review.md](../Documentation/technical/audits/dp-mechanism-review.md), and its open findings are tracked in [#279](https://github.com/InfiniteZeroFoundation/DevNet/issues/279). It stays listed here as an example of the work.

A self-contained, no-coding-required entry point for contributors coming from an AI governance / responsible-AI / policy background rather than deep systems engineering. Review the three DP mechanisms already implemented for client model updates and assess them from a "what privacy claims can we honestly make" angle. Good first step before taking on implementation work in issue #1 below.
This starter task (reviewing the three DP mechanisms implemented for client model updates from a "what privacy claims can we honestly make" angle) was completed in [PR #89](https://github.com/InfiniteZeroFoundation/DevNet/pull/89); the findings live at [Documentation/technical/audits/dp-mechanism-review.md](../Documentation/technical/audits/dp-mechanism-review.md). For a similar beginner-friendly review/analysis entry point, check issues tagged [`good first issue`](https://github.com/InfiniteZeroFoundation/DevNet/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22).

### 1. Differential Privacy Improvements

Expand Down
2 changes: 1 addition & 1 deletion Developer/design/whitepaper-summary.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DIN White Paper — Summary & Implementation Mapping

> **Source:** [Decentralized Intelligence Network (DIN)](https://github.com/InfiniteZeroFoundation/White-Paper/blob/main/Decentralized%20Intelligence%20Network%20(DIN).pdf.zip), Abraham Nash (23 pp., zip published Jun 2026).
> **Source:** [Decentralized Intelligence Network (DIN)](https://github.com/InfiniteZeroFoundation/White-Paper/blob/main/Decentralized%20Intelligence%20Network%20%28DIN%29.pdf), Abraham Nash (23 pp., published as a PDF Jun 2026).
> **Purpose of this document:** working summary of the white paper for aligning ROADMAP.md, `Documentation/`, and `issues/` with the canonical protocol design. Section references (§) are to the white paper.

---
Expand Down
9 changes: 5 additions & 4 deletions Documentation/public/cli-reference.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# DIN CLI — Common Reference

The DIN CLI (`dincli`) is the primary command-line interface for interacting with the Decentralized Intelligence Network. It supports all participant roles: Clients, Auditors, Model Owners, Aggregators, and DAO administrators.
The DIN CLI (`dincli`) is the primary command-line interface for interacting with the Decentralized Intelligence Network. It supports all participant roles: Clients, Auditors, Model Owners, Aggregators, and the DIN-Representative.

---

Expand All @@ -10,7 +10,7 @@ These flags can be prepended to any command:

| Option | Description |
|---|---|
| `--network <network>` | Override the default network (`local`, `sepolia_devnet`, `sepolia_op_devnet`, `mainnet`) |
| `--network <network>` | Override the default network (`local`, `sepolia_op_devnet`) |
| `--help` | Display help for any command |

**Check CLI version:**
Expand All @@ -35,14 +35,15 @@ The `system` command group manages configuration, wallet connections, and genera
dincli system init
```

**Set the default network:** (`local`, `sepolia_devnet`, `sepolia_op_devnet`, `mainnet`)
**Set the default network:** (`local`, `sepolia_op_devnet`)

```bash
dincli system configure-network --network <network>
```

> [!NOTE]
> Use `sepolia_op_devnet` for devnet. Testnet and Mainnet support will be rolled out in a future release.
> `sepolia_op_devnet` is the live DevNet. `local` is for a self-hosted
> `anvil` chain. `mainnet` is not available yet.

**Set the log level** (`debug`, `info`, `warning`, `error`, `critical`):

Expand Down
45 changes: 27 additions & 18 deletions Documentation/public/getting-started.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
# Model_0 — Infinite Zero Network Protocol
# Model_0 — InfiniteZero Network Protocol

> [!TIP]
> Hit an error or get stuck anywhere in this guide? Post it in the
> [DevNet 2.0 pre-launch discussion](https://github.com/InfiniteZeroFoundation/DevNet/discussions/102).

Welcome to the onboarding guide for **Model_0** on the Infinite Zero Network.
Welcome to the onboarding guide for **Model_0** on the InfiniteZero Network.

Planning a different model or dataset? Read [What can I train on DIN?](what-can-be-trained.md) to understand the tested reference, custom-service path, and practical limits.

Infinite Zero Network devnet has been launched as `sepolia-op-devnet`.
InfiniteZero Network devnet has been launched as `sepolia_op_devnet`.

Model_0 is the first active model registered on the Infinite Zero Network and serves as the pioneer deployment of Infinite Zero's model-specific smart contracts.
Model_0 is the first active model registered on the InfiniteZero Network and serves as the pioneer deployment of InfiniteZero's model-specific smart contracts.

The Infinite Zero Network coordinates decentralized AI training, auditing, aggregation, and validation through Ethereum smart contracts, off-chain distributed compute, and decentralized storage.
The InfiniteZero Network coordinates decentralized AI training, auditing, aggregation, and validation through Ethereum smart contracts, off-chain distributed compute, and decentralized storage.

---

Expand All @@ -36,11 +36,11 @@ This process enables decentralized, verifiable, and scalable collaborative AI tr

---

# 🌐 What is `sepolia-op-devnet`?
# 🌐 What is `sepolia_op_devnet`?

To simplify onboarding, we refer to our devnet as:

> **`sepolia-op-devnet` = Optimism Sepolia testnet + DIN deployed contracts**
> **`sepolia_op_devnet` = Optimism Sepolia testnet + DIN deployed contracts**

So when you see:

Expand All @@ -58,14 +58,23 @@ It means:

# Current Status

* ✅ Global Iteration 1 completed
* 🔄 Global Iteration 2 in progress
> [!NOTE]
> This guide documents Model_0's protocol flow as implemented on the
> `develop` branch, which can be ahead of what is actually deployed on the
> live `sepolia_op_devnet` network — including which Global Iteration is
> open and whether aggregator/auditor steps use the commit-then-reveal flow
> described below (added after the initial devnet deployment). Always
> confirm the live state yourself before acting:
>
> ```bash
> dincli task gi show-state 0
> ```

---

# 🔐 Security Model

The Infinite Zero Network is secured by Ethereum smart contracts deployed on Sepolia OP Devnet.
The InfiniteZero Network is secured by Ethereum smart contracts deployed on Sepolia OP Devnet.

Ethereum acts as the source of truth for:

Expand All @@ -89,13 +98,13 @@ Ethereum acts as the source of truth for:

### Core guarantee

The system is **fully verifiable end-to-end**:
The system is **verifiable end-to-end**:

- Ethereum enforces correctness, coordination, and finality
- IPFS ensures reproducible and distributed data availability
- Off-chain compute enables scalable ML execution

> 💡 Trust is shifted from participants to cryptographic and economic enforcement.
> 💡 Trust is shifted from participants to cryptographic enforcement on-chain. Staking exists to add economic enforcement on top of that, but the reward/slashing economics are still under active development — see "Current Devnet Scope" further down this guide — so treat "economic enforcement" as a protocol goal, not yet a fully live guarantee.

# 📦 Data Availability Layer (IPFS via Filebase)

Expand Down Expand Up @@ -131,7 +140,7 @@ Participants may operate as one or more of the following roles simultaneously:

This system does not use mining or Proof-of-Work.

Instead, it uses a role-based validation model coordinated through Ethereum smart contracts on `sepolia-op-devnet`.
Instead, it uses a role-based validation model coordinated through Ethereum smart contracts on `sepolia_op_devnet`.

* Clients train and submit local model updates
* Auditors independently evaluate the submitted local models and approve (or reject) them.
Expand All @@ -145,7 +154,7 @@ Instead, it uses a role-based validation model coordinated through Ethereum smar

# 💻 System Requirements

Participating in Model_0 on the Infinite Zero Network is lightweight and does not require specialized hardware.
Participating in Model_0 on the InfiniteZero Network is lightweight and does not require specialized hardware.

### Minimum Requirements

Expand Down Expand Up @@ -187,7 +196,7 @@ Economic and reward distribution mechanisms are still under active development a
* Coordination
* Community support

https://t.me/+I4Tl7foCVwwwM2Vk
https://t.me/+h46VS3AnO384ZGI8

### Signal

Expand All @@ -203,7 +212,7 @@ https://signal.group/#CjQKICVqJ0Ri3KGCZOsf8A3dhmg8GC_vc1MBmBrq0JV7lIr6EhBCOwElVH

## Faucet Access (Sepolia Optimism)

To participate in the Infinite Zero Network devnet, you will need Sepolia Optimism ETH for transaction fees.
To participate in the InfiniteZero Network devnet, you will need Sepolia Optimism ETH for transaction fees.

You can request testnet tokens from the following official faucets:

Expand All @@ -213,7 +222,7 @@ You can request testnet tokens from the following official faucets:
* [ETHGlobal OP Sepolia Faucet](https://ethglobal.com/faucet/op-sepolia-11155420)
* [Alchemy Optimism Sepolia Faucet](https://www.alchemy.com/faucets/optimism-sepolia)

If you are unable to obtain funds through the faucets above, you may also request Sepolia Optimism ETH through the Infinite Zero Foundation Telegram and Signal community groups.
If you are unable to obtain funds through the faucets above, you may also request Sepolia Optimism ETH through the InfiniteZero Foundation Telegram and Signal community groups.

---

Expand Down Expand Up @@ -604,4 +613,4 @@ dincli client lms show-models 0

---

> 🚀 You are now ready to participate in **Model_0** and contribute to decentralized AI on the Infinite Zero Network.
> 🚀 You are now ready to participate in **Model_0** and contribute to decentralized AI on the InfiniteZero Network.
12 changes: 9 additions & 3 deletions Documentation/public/manifest.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ For example:
```

> [!NOTE]
> If the manifest file is absent when the genesis setup (`dincli task model-owner create-genesis`) runs, it is automatically created with default values from the default manifest CID (`bafybeibbhrefnamky7vmgcrhfx4ptxb3bdemh5dtnvwfkpualoganvnuve`).
> The manifest file must already exist at this path before running
> `dincli model-owner model create-genesis-model` — it exits with an error if
> the file is missing, it is not created automatically. To create it from a
> default template, run `dincli model-owner task cache-default-artifacts`
> first; that only works where the configured network has a `default_manifest`
> CID set (currently just `local` — `sepolia_op_devnet` and `mainnet` have no
> default to cache from, so you must supply your own manifest file there).

---

Expand All @@ -39,7 +45,7 @@ For example:

| Field | Required | Description |
|---|---|---|
| `Genesis_Model_CID` | Yes | IPFS CID of the genesis model. Set after running `dincli model-owner model create-genesis` |
| `Genesis_Model_CID` | Yes | IPFS CID of the genesis model. Set after running `dincli model-owner model create-genesis-model` |
| `DINTaskCoordinator_Contract` | Yes | Address of the deployed TaskCoordinator contract |
| `DINTaskAuditor_Contract` | Yes | Address of the deployed TaskAuditor contract |
| `dp` | No | Nested Differential Privacy configuration block used by services at runtime. See [Differential Privacy Parameters](#differential-privacy-parameters) below. |
Expand Down Expand Up @@ -155,5 +161,5 @@ Please find the example/template manifest file at [cache_model_0/manifest.json](
Once the model is registered and assigned a model ID, the manifest file should be updated with the `Model ID` field and re-uploaded to IPFS. The following dincli command can be used to update the model CID in the DINModelRegistry contract:

```bash
dincli task model-owner update-manifest <model_id> [--modelCID <model_cid>] [--manifestpath <manifest_path>]
dincli task model-owner update-manifest-request <model_id> [--manifestCID <manifest_cid>] [--manifestpath <manifest_path>]
```
2 changes: 1 addition & 1 deletion Documentation/public/roles/clients.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Clients contribute to the DIN network by training local models on their own data
> | Placeholder | Description | Example |
> |---|---|---|
> | `<CACHE_DIR>` | The DIN CLI cache directory | `~/.cache/dincli` |
> | `<network>` | The active network name | `local`, `sepolia_devnet`, `sepolia_op_devnet`, `mainnet` |
> | `<network>` | The active network name | `local`, `sepolia_op_devnet` |
> | `<model_id>` | The ID of the model you are participating in | `0` |
> | `<account_address>` | Your Ethereum wallet address | `0xAbC...123` |
>
Expand Down
Loading
Loading