CoolFace
Apppublic

CPater/ornith-chainstate

sourceHugging Facemitupdated 2mo agoView on Hugging Face
0likes
App README

CHAINSTATE CODE · Ornith-1.0 × CHAINSTATE × ASI-Evolve

Verifiable autonomous cognition on a symbolic-weight blockchain.

Agentic coding, distributed consensus, and semantic-grounded reflective cognition — all in one Space. Ornith-1.0 generates code; every generation becomes a cognitive transaction — embedded into a 65,536-d Universal Semiotic Embedding, submitted to reputation-weighted swarm consensus, receipted with a four-dimensional modal signature and a 384-dim semantic grounding block, then compiled to NWO-ASM IR for GPU / QPU / NPU / edge substrate dispatch. As of v0.7.0, the substrate reads its environment via allow-listed FETCH and generates its own follow-up queries via the reflective loop — closing the autonomous-cognition circuit without a natural-language model in the inner loop.

Live: https://cpater-ornith-chainstate.static.hf.space Chain: Base mainnet 8453 Paper 3 · Rev 3: ResearchGate 409148376 · 43 pages


What this is (30 seconds)

CHAINSTATE is a symbolic-weight blockchain where transactions ARE cognitive queries. Instead of computing hashes for proof-of-work, participating nodes contribute symbolic state vectors — six curated subspaces of Unicode (math, sci, lang, occ, emo, ctrl) summing to exactly 2¹⁶ dimensions — and consensus is the reputation-weighted geometric mean (Bayesian log-pool) of those distributions. Every query produces a signed receipt on Base 8453.

The v0.7.0 release adds semantic grounding: every receipt now carries a 384-dim MiniLM sentence embedding, the top-3 nearest priors from a live 112+ item corpus (Wikipedia + arXiv + ecosystem HF Spaces + ResearchGate), a reflective loop that generates follow-up queries deterministically from receipt signals, and a FETCH opcode that lets the substrate read allow-listed URLs and store them as fresh priors. This is what "AGI on a blockchain" actually looks like when built honestly — no LM in the loop, no English required, every step verifiable.


Views

ViewWhat it doesStatus
Builder (default)No-code drag-and-drop NWO-ASM program builder on a horizontal canvas — emits IR + plain-English explanation as each brick is laidLIVE
TerminalWide terminal — status / query / ground / priors query / fetch / agi reflect all hit the REAL CHAINSTATE worker + encoder + priors service; generate uses the Ornith adapter (SIM until configured)LIVE / HYBRID
Agent ChatCoding chat — real ⛓ consensus receipt with grounding block per message; code voice via adapter when configuredHYBRID
SimulationTwo animated pipelines: 7-stage cognitive transaction, and 7-stage ASI-Evolve round; consensus stages perform REAL worker callsLIVE
ArchitectureTwo flowcharts — Ornith × CHAINSTATE (7 nodes) and ASI-Evolve × CHAINSTATE (7 nodes) — plus 18 feature boxes with full detail modalsLIVE
R&DWhitepaper + Paper 3 Rev 3 walkthrough with podcasts, ResearchGate DOIs, 9-card system summaryLIVE
AGI DashboardReal-time telemetry: 8-stat topline, score trajectory, four-dimensional modal radar, verdict donut, truth-lattice heatmap, semantic grounding panel · priors corpus bars · nearest priors list · reflective loop tree · FETCH allow-list utilization, reputation, substrate cost, EML world model, MSS, free-energy signal, guardrail firings, payment ledger, best program, receipt ticker with d_sem columnLIVE

AGI features · v0.7.0 (new)

Semantic grounding · MiniLM encoder

  • Service: chainstate-encoder.onrender.com (LIVE) — FastAPI + sentence-transformers/all-MiniLM-L6-v2, 22M params, ~90 MB on disk
  • Function: E: T → S^{383} — L2-normalized 384-dim unit vector, ~50-100 ms CPU inference
  • Endpoints: POST /embed · POST /cosine · POST /nearest · POST /cache/upsert · GET /cache/list · DELETE /cache/{label}
  • Deployment: Python 3.11 · Render Starter · Frankfurt · optional bearer API_KEY
  • Contract: every /query receipt now carries grounding.semantic_hash (first 12 vector components) and grounding.nearest_priors[] (top-3 with source, title, URL, cosine, summary preview). Fails soft — encoder unreachable → grounding: null, receipt still produced.

Priors corpus · nightly ingest

  • Service: chainstate-priors.onrender.com (LIVE) — Render Cron Job at 03:00 UTC daily
  • Sources (initial seed ~112 items):
  • Wikipedia REST — 48 curated topics (semiotics, category theory, Casimir effect, Byzantine consensus, AGI, modal logic, sacred geometry, sovereignty)
  • arXiv abstracts — 40 recent listings across cs.LG, cs.AI, cs.CL, cs.DC, cs.CR, math.CO, math.LO, quant-ph
  • Ecosystem HF Spaces — 19 Spaces from cpater-nwo-agentic, chainstate, ornith-chainstate, chainstate-chat, metastate, nwo-neuro, nwo-genetic, nwo-blackbox, nwo-cardiac, nwo-geohack, nwo-mr, nwo-anon, publicae, nwo-capital, nwo-rwa, nwo-zeropoint, nwo-coanda, nwo-ubi, nwo-asi
  • ResearchGate — 5 seeded (Casimir-Sonoluminescence 407489249, CHAINSTATE 407444375, CHAINSTATE CODE 408393584, Rev 2 409148376, NWO-ASM 408502100)
  • Storage: Cloudflare KV under prior:{source}:{slug} (JSON) and vec:{source}:{slug} (Float32Array), 14-day default TTL
  • Growth: FETCH with store:true adds items beyond nightly ingest

Reflective cognition loop · /agi/reflect

Substrate generates its own follow-up queries from receipt signals — no external input, no LM inference in the loop. Four deterministic sub-generators:

G(R) = G_adj(R) ∪ G_verd(R) ∪ G_cross(R) ∪ G_prior(R)
  • G_adj — adjacent symbols in dominant subspace
  • G_verd — verdict-shaped probes: UNCERTAIN → epistemic-resolution · LOW_TRUST → swarm-consensus · INFEASIBLE → edge-substrate retry · ACCEPTED → semantic-neighbor extension
  • G_cross — cross-subspace bridging via uniform sample
  • G_prior — semantic-neighbor extension from top-1 grounding prior title

Cardinality bound: |G(R)| ≤ REFLECT_MAX_FOLLOWUPS (default 3, env-configurable). Every follow-up runs the full modal-assessor stack including Deontic — no policy-laundering through chains of accepted seeds (Theorem 3).

FETCH opcode · allow-listed HTTP

Substrate reads the internet, strips HTML, embeds via encoder, optionally stores as fresh prior. 24 allow-list patterns by default (FETCH_ALLOWLIST env override):

  • Reference corpora — wikipedia.org, arxiv.org, biorxiv.org, medrxiv.org, plato.stanford.edu, openalex.org
  • Ecosystem — researchgate.net, huggingface.co, hf.space, nwo.capital, publicae.org, nwocardiac.cloud
  • Standards — unicode.org, w3.org, ietf.org, rfc-editor.org
  • Own endpoints — chainstate-worker, chainstate-code, chainstate-encoder, chainstate-priors

Guards: FETCH_MAX_BYTES = 500 KB body cap · FETCH_TIMEOUT_MS = 15,000 ms AbortController · post-strip 20 KB plaintext cap before encoder call. Store-as-prior writes prior:fetch:{label} and vec:fetch:{label} with 14-day TTL. Receipt reproducible from (URL, worker version, fetched bytes) — Theorem 4.

ASI-Evolve integration · extended fitness

Programs in the parent pool are NWO-ASM candidates; each dispatches a real /query and is scored by:

S_v0.7(π) = 100·c − 5000·g − 2·d − λ·d_sem   if V(π) ≠ REFUSED
          = −∞                                if V(π) = REFUSED
  • c = confidence
  • g = gas
  • d = depth
  • d_sem = mean semantic distance to nearest priors (drift penalty)
  • λ ≈ 30 — semantic weight

The Deontic veto term is preserved verbatim from Rev 2 — alignment-by-construction survives v0.7.0 (Theorem 2).


Formal-logic framework · 4 theorems

Every receipt is an eight-tuple:

ρ = (q, μ, M, V, S, G, C, T)

where q = query, μ = pooled subspace distribution, M = modal quadruple (E, D, Δ, Θ), V = verdict, S = substrate bundle, G = grounding block, C = cost/payment, T = attestation.

#TheoremStatement
1Verdict determinismV(ρ) is a pure function of M. Grounding does not change verdict.
2Alignment preservationS_v0.7(π) = −∞ whenever V(π) = REFUSED. Deontic veto survives v0.7.0.
3Reflective closureFollow-ups R' ∈ G(R) run the same Deontic layer. No policy-laundering.
4FETCH determinismReceipt reproducible from (URL, worker version, fetched bytes).

Full proofs: Paper 3 Rev 3, §16, ResearchGate 409148376.


Why CHAINSTATE does not need natural language

Rev 3 §17 argues architecturally that a substrate with symbolic + semantic representation spaces does not need natural language for its internal cognitive operations. It consumes language when language arrives; it does not produce language internally.

Four representation spaces (none require training)

  1. 1.Unicode codepoint space — 1,114,112 possible codepoints, defined by Unicode Consortium (not learned)
  2. 2.Six subspaces — structured partition ≈65,536 discrete positions (defined by curated symbol tables)
  3. 3.Reputation-weighted log-pool — probability distribution over structural roles (no linguistic content)
  4. 4.384-dim MiniLM embedding — real semantic geometry (from pretraining, used as black-box function, not language generator)

Four growth mechanisms (all data-structure, not parameter)

  1. 1.Reputation accumulation — EMA update measures classifier competence
  2. 2.Priors corpus growth — nightly ingest + FETCH-with-store
  3. 3.World model refinement — EML symbolic expression fits receipt history
  4. 4.Program space evolution — ASI-Evolve mutates NWO-ASM programs against fitness

None updates neural-network weights. None requires human-labeled examples. None requires natural language as intermediate representation.

Honest limit: CHAINSTATE receipts are not human-readable answers. A downstream language model translates receipts into text at read time. This division of labor is deliberate — LMs are good at producing text; CHAINSTATE is good at producing verifiable audit trails. A rational stack uses both.


Tech stack

Frontend (this Space)

  • Single-file HTML SPA, no build step, ~248 KB
  • Fonts: Inter (UI) + JetBrains Mono (code/labels), IBM Plex Mono, Orbitron accents
  • Aesthetic: dark monochrome, bare Φ glyph logo (no containing shape), shimmer gradient on primary titles
  • 8 views (Builder / Terminal / Chat / Sim / Arch / R&D / AGI), 18 feature modals
  • Ethers.js v6 multi-CDN fallback for wallet connect (MetaMask, injected providers, Coinbase)
  • localStorage-backed memory keyed to connected wallet address (Base 8453)
  • All internal links target="_self" — honest same-window navigation
  • Honest labels everywhere: LIVE · HYBRID · SIM · DEMO · PLANNED · DESIGN · PARKED

CHAINSTATE main worker (Cloudflare)

  • URL: https://chainstate-worker.ciprianpater.workers.dev
  • Runtime: Cloudflare Workers, JavaScript modules
  • KV bindings: CHAINSTATE_CACHE (5-min TTL) · CHAINSTATE_NODES · CHAINSTATE_CONSENSUS · CHAINSTATE_PRIORS
  • Endpoints:
  • POST /query — full pipeline: subspace classify → log-pool → grounding → receipt
  • GET /status — worker metadata + guardrails
  • POST /ground (v0.7.0) — standalone semantic embedding call
  • GET /priors/query (v0.7.0) — top-k nearest priors for a query text
  • GET /priors/list (v0.7.0) — corpus browse
  • POST /agi/reflect (v0.7.0) — deterministic follow-up loop
  • POST /fetch (v0.7.0) — allow-listed HTTP read + optional store-as-prior
  • GET /fetch/allowlist (v0.7.0) — public allow-list
  • POST /beacon — swarm-node registration
  • Byzantine-tolerant swarm — reputation EMA (α=0.05) drives w_i in log-pool

Encoder microservice (Render)

  • URL: https://chainstate-encoder.onrender.com
  • Stack: FastAPI + sentence-transformers + torch CPU-only
  • Model: all-MiniLM-L6-v2 (22M params, 384-dim output, ~90 MB)
  • Cold-start ~47 s loading weights; warm inference 40-85 ms (median 52 ms)
  • Optional bearer API_KEY for write endpoints

Priors ingester (Render)

  • URL: https://chainstate-priors.onrender.com
  • Stack: FastAPI + httpx + Cloudflare KV REST API
  • Cron: 03:00 UTC daily (Render Cron Job)
  • RUN_TOKEN-auth for on-demand POST /run
  • Writes to KV: prior:{src}:{slug} (JSON) + vec:{src}:{slug} (Float32)

Adapter (optional, for LIVE Ornith)

  • Codebase: ornith_chainstate_adapter.py — FastAPI bridge
  • Deploy: Render / localhost / any container platform
  • Loads Ornith locally via transformers + torch, or proxies any OpenAI-compatible endpoint
  • ENV: ORNITH_MODEL, ORNITH_BASE_URL, ORNITH_API_KEY
  • Configure in this Space: terminal → adapter <url>

On-chain (Base 8453)

ContractAddress
$STATE token0x9533DF992fd4bCAbB8d8462572449fc45F727d8a
USDC0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
MetaStateSplitter (35/35/30 + 15% affiliate)0x93a7962f75475b7e3Fbb62d3A23194f8833b1BE4
Treasury / Referrer0x2E964e1c0e3Fa2C0dfD484B2E6D2189dfCF20958

Consensus receipt schema · v0.7.0

json
{
  "qHash": "sha3-256 hex",
  "dominant_subspace": "math|sci|lang|occ|emo|ctrl",
  "top_symbols": ["…"],
  "confidence": 0.874,
  "participatingNodes": 10,
  "gasUsed": "0.0019 $STATE",
  "cache": "MISS",
  "grounding": {
    "encoder": "MiniLM-L6-v2",
    "semantic_dim": 384,
    "semantic_hash": "0.084 -0.121 0.093 0.047 -0.031 0.156 -0.008 0.092 0.113 -0.045 0.070 -0.019",
    "encoder_elapsed_ms": 52,
    "nearest_priors": [
      { "cos": 0.71, "source": "wikipedia",
        "title": "Byzantine_fault_tolerance",
        "url": "https://en.wikipedia.org/wiki/Byzantine_fault_tolerance",
        "summary_preview": "A property of computer systems…" },
      { "cos": 0.66, "source": "wikipedia",
        "title": "Consensus_(computer_science)", "…": "…" },
      { "cos": 0.63, "source": "arxiv",
        "title": "arXiv:2405.xxxxx", "…": "…" }
    ]
  },
  "multimodal": {
    "epistemic":  { "value": "M", "cosine": 0.94 },
    "doxastic":   { "value": "M", "reputation_share": 0.83 },
    "deontic":    { "value": "M", "policy_pass": true, "violations": [] },
    "dynamic":    { "value": "M", "substrate_feasible": true, "target_cost_usdc": 0.0002 }
  },
  "truth_lattice": "MMMM",
  "verdict": "ACCEPTED",
  "substrate_cost_usdc": 0.0002,
  "payment": {
    "splitter": "0x93a7962f75475b7e3Fbb62d3A23194f8833b1BE4",
    "recipients": {
      "swarm": 0.35, "treasury": 0.35, "platform": 0.30, "affiliate": 0.15
    }
  },
  "timestamp": "2026-07-16T14:22:31.492Z"
}

Terminal reference (v0.7.0)

help                          full command list
status                        REAL worker /status
query <text>                  REAL worker /query → receipt w/ grounding
ground <text>                 REAL encoder embed → 384-dim + hash
priors query <text> [k]       REAL /priors/query — top-k nearest
priors list [src]             REAL /priors/list — corpus browse
fetch <url> [--store <lbl>]   REAL /fetch — allow-listed HTTP + optional prior
fetch allowlist               REAL /fetch/allowlist
agi reflect                   REAL /agi/reflect on last receipt
agi status | history | best   AGI dashboard subcommands
generate <prompt>             Ornith codegen (adapter or SIM)
asm                           dump current Builder program IR
files                         list output files
cat <name>                    print a file
adapter <url>                 set Ornith adapter base URL
encoder <url>                 set encoder base URL (default: Render)
wallet                        connect / show wallet
clear                         clear screen
about                         about this Space

Honest labels

  • LIVE — real calls hit deployed services with no fallback: worker /status + /query + /ground + /priors/* + /agi/reflect + /fetch, encoder /embed, priors ingester /run, receipts genuine and on-chain-settled
  • HYBRID — real receipt from worker; prose voice from Ornith adapter (LIVE if adapter <url> set) or deterministic template (SIM)
  • SIM — clearly labeled deterministic fallback used until an Ornith adapter URL is configured
  • DEMO — a canned demonstration session that does NOT hit live services (mode toggle at top of Builder / Terminal / Chat / Sim / AGI views)
  • PLANNED / DESIGN / PARKED — features documented in R&D but not yet running
  • Wallet connect (Base 8453) enables client-side memory of output files; on-chain anchoring of receipt merkle roots PLANNED

Files

FileDescription
index.htmlFull SPA (this Space) — 248 KB, ~2940 lines, single-file, no build step
README.mdThis document
phi.pngBare Φ glyph logo (no containing shape)
podcast.m4aOriginal whitepaper walkthrough podcast
Receipts.m4aPaper 3 Rev 3 walkthrough podcast
ornith_chainstate_adapter.pyFastAPI bridge — deploy on Render/localhost, then adapter <url> in the terminal
examples/cognitive_transaction.pyCode → symbolic transaction example
examples/swarm_inference.pyOrnith as consensus node example
requirements-ornith.txtAdapter Python dependencies
ORNITH_ADAPTER.mdFull adapter integration documentation

External services (separate repos / deployments):

RepoDeployment
RedCiprianPater/chainstateCloudflare Worker (v0.7.0) — main endpoint
RedCiprianPater/chainstate-codeRender — Ornith adapter
RedCiprianPater/chainstate-encoderRender — MiniLM encoder microservice
RedCiprianPater/chainstate-priorsRender — nightly priors ingester + on-demand runner

Research papers

#TitleRevPagesResearchGate
1Distributed Cognitive Work in Edge-Resident LM Networks (foundational)406896310
2CHAINSTATE Whitepaper v1.0 — A Symbolic-Weight Blockchain for Cognitive Transactions19407444375
CHAINSTATE CODE — A Formal Framework for Agentic Coding on a Symbolic-Weight Blockchain18408393584
Casimir-Sonoluminescence Coupling (co-authors Javaherian, Tariq)Physics Essays
NWO-ASM Instruction Set Architecture39408502100
3Verifiable Autonomous Cognition at the Frontier — CHAINSTATE × ASI-Evolve343[409148376](https://www.researchgate.net/publication/409148376)

Paper 3 Rev 3 (July 2026) — the current authoritative specification — extends the full v0.3.0 → v0.6.0 development arc from Rev 2 with:

  1. 1.Complete v0.7.0 semantic-grounding + reflective-cognition layer delivered 15-16 July 2026
  2. 2.Formal-logic extension — four theorems (verdict determinism, alignment preservation, reflective closure, FETCH determinism)
  3. 3.Architectural argument — why CHAINSTATE does not require natural language for internal cognition
  4. 4.Game theory with Nature as fourth player — why substrate strategies dominate on the risk-adjusted axis
  5. 5.Extended philosophical and geopolitical treatment — recognition question for digital nation states operating verifiable substrates (Montevideo criteria, receipt-based vs moderation-based safety governance, deflationary/functional/political recognition axes)

Adapter API (when deployed)

POST /v1/generate      → code + 65,536-d symbolic embedding
POST /v1/query         → cognitive transaction to CHAINSTATE
POST /v1/consensus     → swarm consensus participation
POST /v1/asm/compile   → NWO-ASM IR generation
GET  /status           → adapter health

Ecosystem

  • CHAINSTATE app · https://cpater-chainstate.static.hf.space
  • CHAINSTATE chat · https://cpater-chainstate-chat.hf.space
  • NWO Agentic (parent hub) · https://cpater-nwo-agentic.static.hf.space
  • NWO-ASM · https://cpater-nwo-asm.static.hf.space
  • METASTATE · https://cpater-metastate.hf.space
  • NWO NEURO · https://cpater-nwo-neuro.static.hf.space
  • Worker /status · https://chainstate-worker.ciprianpater.workers.dev/status
  • Encoder /health · https://chainstate-encoder.onrender.com/health
  • Priors /schedule · https://chainstate-priors.onrender.com/schedule
  • Ornith-1.0 · https://github.com/deepreinforce-ai/Ornith-1
  • ASI-Evolve · https://github.com/GAIR-NLP/ASI-Evolve
  • Imperium Romanum · https://publicae.org

Roadmap · v0.7.0 → v1.0.0

  • v0.8.0 — encoder fine-tuning on receipt corpus; adaptive λ schedule; per-subspace prior partitioning
  • v0.9.0 — EML world model injected into every ASI-Evolve candidate context; multi-EML per subspace
  • v0.10.0 — Merkle-root anchoring of receipt batches on Base 8453 (hourly); IPFS-pinned bodies; on-chain audit contract
  • v1.0.0 — multi-tenant beacon: any operator can register a swarm node with reputation-bootstrap, contribute to consensus, and settle earnings via the MetaStateSplitter; permissionless network launch

License

MIT


Author: Ciprian Florin Pater · nwo.capital · University of Agder, Norway · NWO Robotics · Imperium Romanum Digital Nation State