Skip to content

Commit 4506b4f

Browse files
committed
Update README.md
1 parent 0dbde29 commit 4506b4f

1 file changed

Lines changed: 54 additions & 5 deletions

File tree

README.md

Lines changed: 54 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,17 @@ so that you can publish verifiable context on the OriginTrail DKG.
1212

1313
Project status: actively maintained.
1414

15+
## Architecture
16+
17+
GWALN is built on three key layers, leveraging the OriginTrail Decentralized Knowledge Graph (DKG):
18+
19+
1. **🤖 Agent Layer**: The **MCP Server** exposes all CLI capabilities (fetch, analyze, publish) to AI agents (like Claude or Cursor) via the Model Context Protocol. This allows agents to autonomously verify information and interact with the DKG.
20+
2. **🧠 Knowledge Layer**: The tool normalizes unstructured data (Wikipedia/Grokipedia) into **Structured Knowledge Assets** (JSON-LD). These assets are analyzed for discrepancies and formatted as standardized ClaimReviews.
21+
3. **🔗 Trust Layer**:
22+
* **OriginTrail DKG**: Verifiable publication of Knowledge Assets on the DKG Edge Node.
23+
* **NeuroWeb/Polkadot**: Blockchain consensus for DKG operations.
24+
* **x402**: Implements the [x402](https://x402.gitbook.io/x402) payment standard for incentivized access to premium MCP tools.
25+
1526
### Basic functionality
1627

1728
GWALN CLI is intended for analysts and contributors who review
@@ -42,11 +53,11 @@ Before using this tool, you should be familiar with:
4253

4354
You should have:
4455

45-
* Node.js 20.18.1 or later on macOS, Linux, or Windows
46-
* Network access to a DKG edge node and sufficient blockchain funds if
47-
you plan to publish.
48-
* Optional: a Google Gemini API key if you use automated bias
49-
verification.
56+
* Node.js 20.18.1 or later on macOS, Linux, or Windows
57+
* Network access to a DKG edge node (NeuroWeb) and sufficient $TRAC tokens if
58+
you plan to publish.
59+
* Optional: a Google Gemini API key if you use automated bias
60+
verification.
5061

5162
## How to use GWALN CLI
5263

@@ -197,6 +208,35 @@ catalog or discover new ones using the lookup command.
197208

198209
2. Inspect the output in `~/.gwaln/notes/moon.json` and `~/.gwaln/notes/index.json`.
199210

211+
<details>
212+
<summary>Example JSON-LD Community Note</summary>
213+
214+
```json
215+
{
216+
"@context": ["https://schema.org", "https://www.w3.org/ns/anno.jsonld"],
217+
"@type": "ClaimReview",
218+
"@id": "urn:gwaln:note:moon:2024-11-26T12:00:00.000Z",
219+
"topic_id": "moon",
220+
"claimReviewed": "Comparison of Moon entries on Grokipedia and Wikipedia",
221+
"reviewRating": {
222+
"@type": "Rating",
223+
"ratingValue": "4.8",
224+
"ratingExplanation": "Detected 2 discrepancies including 0 bias issues..."
225+
},
226+
"gwalnTrust": {
227+
"accuracy": 3,
228+
"completeness": 3,
229+
"tone_bias": 3,
230+
"stake": { "token": "TRAC", "amount": 0 }
231+
},
232+
"citation": [
233+
{ "@type": "CreativeWork", "name": "Wikipedia", "url": "..." },
234+
{ "@type": "CreativeWork", "name": "Grokipedia", "url": "..." }
235+
]
236+
}
237+
```
238+
</details>
239+
200240
3. Publish to OriginTrail (ensure your config has live signing keys):
201241

202242
```bash
@@ -265,6 +305,15 @@ using the Model Context Protocol’s session headers and reuses it for the
265305
subsequent `tools/list`, `tools/call`, etc. There are no extra discovery
266306
routes—just point your MCP client at that one URL.
267307

308+
### x402 Monetization
309+
310+
The MCP server implements the **x402** payment standard (via `src/lib/x402.ts`) to monetize premium tools like `query`, `publish`, and `lookup` on the NeuroWeb testnet.
311+
312+
* **Free Tools**: `fetch`, `analyze`, `show`
313+
* **Paywalled Tools**: `query`, `publish`, `lookup` (requires 1 TRAC payment)
314+
315+
When an AI agent attempts to use a paywalled tool without payment, the server returns a `402 Payment Required` error with payment details. The agent can then facilitate the payment on-chain and retry the request with the payment proof.
316+
268317
### Query a published Knowledge Asset
269318

270319
Retrieve previously published Community Notes from the DKG by topic title:

0 commit comments

Comments
 (0)