Skip to content

Commit 66c9375

Browse files
committed
Handoff: Spec: Mission Language + Observer Protocol — Refactoring Approach (16 files)
1 parent abc06e2 commit 66c9375

19 files changed

Lines changed: 2999 additions & 190 deletions

File tree

BRS.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,17 @@
3535

3636
## 1. Executive Summary
3737

38-
The **Open World Model (OWM)** is an open-source, federated ensemble of AI models that collectively builds, maintains, and continuously updates a comprehensive model of the real world — encompassing geography, science, code, language, and live data streams. The system runs on a permissionless, decentralized network of GPU-equipped nodes. Node operators are compensated in Bitcoin via the Lightning Network for their compute and data contributions. Model versioning and integrity are anchored to the Bitcoin blockchain via **OpenTimestamps**. The project is well-versed in software engineering and Git, enabling it to autonomously analyze, improve, and generate pull requests for GitHub repositories. The treasury is controlled by a Bitcoin multisig wallet; technical governance follows a rough-consensus model.
38+
The **Open World Model (OWM)** is not a model of the world — it is a **distributed AI** formed from many different AI models that work together as a single conglomerate. It is an open-source, federated ensemble that collectively builds, maintains, and continuously updates this conglomerate, with diverse capabilities encompassing geography, science, code, language, and live data streams. The system runs on a permissionless, decentralized network of GPU-equipped nodes. Node operators are compensated in Bitcoin via the Lightning Network for their compute and data contributions. Model versioning and integrity are anchored to the Bitcoin blockchain via **OpenTimestamps**. The project is well-versed in software engineering and Git, enabling it to autonomously analyze, improve, and generate pull requests for GitHub repositories. The treasury is controlled by a Bitcoin multisig wallet; technical governance follows a rough-consensus model.
3939

4040
Node participation is secured by two complementary Bitcoin-native mechanisms: **Proof-of-Work (PoW)** — nodes may optionally contribute hashrate to the OWM-operated Stratum v2 Bitcoin mining pool, with mining revenue split between the miner and the treasury; and **Proof-of-Stake (PoS)** — all joining nodes must open a Lightning payment channel to the treasury of a minimum size determined by their hardware tier, locking in a financial commitment that can be force-closed upon verified misbehavior.
4141

4242
---
4343

4444
## 2. Business Context & Problem Statement
4545

46-
### 2.1 Current State of World Models
46+
### 2.1 Current State of Large-Scale AI
4747

48-
Existing large-scale AI world models (e.g., large language models, knowledge graphs) are:
48+
Existing large-scale AI systems (e.g., large language models, knowledge graphs) are:
4949

5050
- **Centralized**: Controlled by a small number of corporations with opaque governance.
5151
- **Expensive to run**: Requiring massive proprietary data centers inaccessible to independent contributors.
@@ -59,7 +59,7 @@ Bitcoin's Lightning Network enables programmable, near-zero-fee micropayments gl
5959

6060
### 2.3 Problem Statement
6161

62-
There is no open, continuously updated, decentralized AI world model that:
62+
There is no open, continuously updated, decentralized distributed AI (conglomerate of many models) that:
6363
1. Compensates contributors fairly and automatically with real money (Bitcoin).
6464
2. Allows anyone with a GPU to join and earn rewards.
6565
3. Is demonstrably trustworthy via cryptographic model provenance (OpenTimestamps).
@@ -70,9 +70,9 @@ There is no open, continuously updated, decentralized AI world model that:
7070

7171
## 3. Project Vision
7272

73-
> **"A living, open model of our world — built by everyone, owned by no one, powered by Bitcoin."**
73+
> **"A distributed AI built by everyone, owned by no one, powered by Bitcoin."**
7474
75-
The Open World Model will be the world's first community-owned, continuously updated AI that understands the planet — its geography, science, culture, code, and events — funded and incentivized entirely through the Bitcoin economy.
75+
The Open World Model is a conglomerate AI: many different AI models combined into one distributed system. It will be the world's first community-owned, continuously updated distributed AI of this kind — capable across geography, science, culture, code, and events — funded and incentivized entirely through the Bitcoin economy.
7676

7777
---
7878

@@ -387,7 +387,7 @@ The Lightning channel stake acts as OWM's native Proof-of-Stake mechanism — en
387387

388388
| Term | Definition |
389389
|---|---|
390-
| **OWM** | Open World Model — the project name |
390+
| **OWM** | Open World Model — distributed/conglomerate AI project (many models, one system) |
391391
| **Node** | A machine operated by a contributor that provides GPU compute to the OWM network |
392392
| **Federated Ensemble** | A collection of specialized AI sub-models that collaborate to produce outputs, where each sub-model may be trained on different nodes |
393393
| **Federated Learning** | A machine learning approach where model training occurs locally on nodes; only gradient updates (not raw data) are shared |

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Open World Model (OWM)
22

3-
> *"A living, open model of our world — built by everyone, owned by no one, powered by Bitcoin."*
3+
> *"A distributed AI built by everyone, owned by no one, powered by Bitcoin."*
44
55
## What is OWM?
66

7-
The **Open World Model** is an open-source, federated ensemble of AI models that build and maintain a comprehensive, continuously updated model of the real world — geography, science, code, language, and live data. The system runs on a permissionless network of GPU nodes. Node operators are compensated in **Bitcoin** via the **Lightning Network**. Model versions are anchored to the Bitcoin blockchain via **OpenTimestamps**. The project integrates with **GitHub** for automated code analysis, security audits, and PR generation. Participation is secured by Bitcoin-native **Proof-of-Work** (optional mining pool contribution) and **Proof-of-Stake** (Lightning channel stake to the treasury); there is no new token.
7+
The **Open World Model** is not a model of the world — it is a **distributed AI** formed from many different AI models working together as a single conglomerate. It is an open-source, federated ensemble of models that collectively run on a permissionless network, continuously updated with diverse capabilities (e.g. geography, science, code, language, live data). The system runs on a permissionless network of GPU nodes. Node operators are compensated in **Bitcoin** via the **Lightning Network**. Model versions are anchored to the Bitcoin blockchain via **OpenTimestamps**. The project integrates with **GitHub** for automated code analysis, security audits, and PR generation. Participation is secured by Bitcoin-native **Proof-of-Work** (optional mining pool contribution) and **Proof-of-Stake** (Lightning channel stake to the treasury); there is no new token.
88

99
For full business and technical requirements, see [BRS.md](BRS.md) and [SRS.md](SRS.md).
1010

SRS.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ This document covers all software components of the OWM system: the node daemon,
8484

8585
### 2.1 Product Perspective
8686

87-
OWM is a standalone distributed system composed of:
87+
OWM is a **distributed AI**: many different AI models form one conglomerate system (it is not a single "model of the world"). It is a standalone distributed system composed of:
8888
- A **P2P node network** where each node runs the OWM daemon.
8989
- A **coordinator layer** that bootstraps the network and routes tasks (decentralizes progressively).
9090
- A **model layer** consisting of a federated ensemble of transformer-based sub-models.
@@ -98,7 +98,7 @@ OWM is a standalone distributed system composed of:
9898
|---|---|---|
9999
| Node Operator | CLI + Dashboard | Run node daemon, earn BTC |
100100
| Data Contributor | CLI + API | Submit datasets, earn BTC |
101-
| API Consumer | REST/WebSocket API | Query world model |
101+
| API Consumer | REST/WebSocket API | Query the conglomerate model (OWM) |
102102
| GitHub User | GitHub App + Bounty Board | Contribute code, earn BTC |
103103
| Core Maintainer | All interfaces + admin CLI | Deploy, configure, govern |
104104
| Treasury Signer | Multisig wallet UI | Approve treasury transactions |
@@ -539,7 +539,7 @@ jobs:
539539

540540
```
541541
# Query API
542-
POST /v1/query # Send a query to the world model
542+
POST /v1/query # Send a query to the conglomerate model (OWM)
543543
POST /v1/query/stream # Streaming token generation (WebSocket)
544544
GET /v1/query/{query_id} # Retrieve cached query result
545545

owm-coordinator/cmd/coordinator/main.go

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ import (
3333
_ "github.com/owmnetwork/owm-coordinator/internal/metrics"
3434
"github.com/owmnetwork/owm-coordinator/internal/lightning"
3535
"github.com/owmnetwork/owm-coordinator/internal/lightning/mock"
36+
"github.com/owmnetwork/owm-coordinator/internal/observer"
3637
"github.com/owmnetwork/owm-coordinator/internal/payment"
3738
"github.com/owmnetwork/owm-coordinator/internal/registry"
3839
"github.com/owmnetwork/owm-coordinator/internal/rpc"
@@ -197,7 +198,33 @@ func run() error {
197198
GradientL2ClipNorm: cfg.FL.GradientL2ClipNorm,
198199
AnomalyStdDevThreshold: cfg.FL.AnomalyStdDevThreshold,
199200
}, log)
200-
disp := payment.New(lnPayment, db, rdb, log)
201+
202+
var obsClient *observer.Client
203+
if cfg.Observer.Enabled {
204+
keyData, err := os.ReadFile(cfg.Observer.SigningKeyPath)
205+
if err != nil {
206+
return fmt.Errorf("observer signing key: %w", err)
207+
}
208+
obsClient, err = observer.NewClient(observer.ClientConfig{
209+
APIEndpoint: cfg.Observer.APIEndpoint,
210+
SigningKeyPEMOrHex: keyData,
211+
Log: log,
212+
})
213+
if err != nil {
214+
return fmt.Errorf("observer client: %w", err)
215+
}
216+
info, err := lnReadonly.GetInfo(context.Background())
217+
if err != nil {
218+
return fmt.Errorf("observer: get treasury pubkey (GetInfo): %w", err)
219+
}
220+
senderPubkeyHash := observer.PubkeyHashHex(info.PubkeyHex)
221+
if senderPubkeyHash == "" {
222+
return fmt.Errorf("observer: treasury pubkey from GetInfo produced empty hash (pubkey_hex length=%d); cannot set sender_public_key_hash for receipt submission", len(info.PubkeyHex))
223+
}
224+
obsClient.SetSenderPubkeyHash(senderPubkeyHash)
225+
log.Info("observer protocol enabled", zap.String("api", cfg.Observer.APIEndpoint))
226+
}
227+
disp := payment.New(lnPayment, db, rdb, log, obsClient)
201228

202229
// ── gRPC server ───────────────────────────────────────────────────────────
203230
srv := rpc.New(reg, sched, verif, flOrch, disp, rdb, db, log)

0 commit comments

Comments
 (0)