CHAINSTATE phi logoCHAINSTATE / OS
CHAINSTATE AGI LINUX OS
LOCAL-FIRST · OFFLINE-CAPABLE · GOVERNED COGNITION · KERNEL-NEAR EVIDENCE

COGNITION
WITHOUT
LOCK-IN.

CHAINSTATE OS is a proposed Linux-based cognitive operating system. Eight separated trust planes, a governed reasoning loop extended with kernel-near eBPF observation, BranchState continuity with TIMEMACHINE rollback, metacognitive isolation, an independent falsifiability kill gate, and constitutional safety — designed to run on your hardware, answer to you, and fail closed. Research Paper II (October 2026) adds an eBPF substrate for process, syscall, filesystem and network telemetry, with an LSM-BPF enforcement path reserved for reviewed deployments.

CPU / GPU / NPU / FPGA / RISC-V BRANCHSTATE TIMEMACHINE KILL GATE eBPF SUBSTRATE REFERENCE ARCHITECTURE
GET OS · USD 666 ONE-TIME READ THE PAPERS
8TRUST PLANES
9LOOP STAGES
0CLOUD DEPENDENCIES REQUIRED
1OWNER: YOU
01 / LIVE DEMO SIMULATION

CHAINSTATE-UI

Simulated control surface. Pick a cs command from the side rail to swap the terminal output and highlight the matching state tile; live telemetry runs on the right. SIMULATED — no real substrate is attached to this page.

chainstate-ui / live demoUI LIVE
SUBSTRATE
CS
LOCAL
NETWORK
SAFE-DEGRADED
POLICY
ENFORCED
METACOG
ISOLATED
KILLGATE
INDEPENDENT
RECEIPTS
APPEND-ONLY
BRANCH
experiment-01
KERNEL · eBPF
KERNEL
4/4 ATTACHED
CPU42%
MEM6.4G
TOKENS18.2k
LATENCY84ms
RECEIPTS128
OUTPUT · cs statusSTREAM
$ cs status

SUBSTRATE .... LOCAL
NETWORK ...... SAFE-DEGRADED
POLICY ....... ENFORCED
METACOG ...... ISOLATED
KILLGATE ..... INDEPENDENT
RECEIPTS ..... APPEND-ONLY
BRANCH ....... experiment-01
KERNEL ....... eBPF ATTACHED (4/4)

Demo telemetry is simulated.

INFERENCE THROUGHPUT · ROLLING WINDOW · SIMULATED

[boot] local runtime initialized [policy] default-deny network profile active [metacog] user context isolated [killgate] independent evaluator ready [continuity] branch root verified [ebpf] 4 monitors attached · verifier OK · ringbuf 256KiB
02 / SYSTEM ARCHITECTURE

MULTILAYER FLOW

Full substrate map: the governed cognition loop at the top, eight separated trust planes, the continuity + release infrastructure, and the new kernel-near eBPF evidence plane at the bottom. No edge skips a plane. Hover any node for a summary; click for the full specification.

● LIVE ● BETA ● DESIGN ● ROADMAP — node ring color = status · line gradient = data / authority flow
03 / TECHNICAL CONFIGURATION

TECH STACK

LAYERSPECIFICATIONSTATUS
Base systemLinux (hardened distribution target), immutable base image, signed A/B partitions, verified bootDESIGN
Cognitive runtimeLocal model host with pluggable backends (GGUF / ONNX / vendor runtimes), retrieval, proposal generator confined to the Cognitive planeDESIGN
Metacognitive layerIsolated uncertainty estimator and hypothesis-killing evaluator; user-local state cannot rewrite substrate metacognitionDESIGN
Constitutional engineHard-veto policy machine: consent, provenance, capability budgets, fail-closed defaultsDESIGN
Execution sandboxNamespaced, quota-limited process cells; signed skill plugins with declared capability limitsDESIGN
ContinuityBranchState append-only receipt chain, TIMEMACHINE branch/rollback, conflict-aware offline peer syncDESIGN
Hardware abstractionCPU / GPU / NPU / FPGA / RISC-V targets; UCI-1 + RISC-V acceleration path; optional optical inference backendROADMAP
Sensor fusionLiDAR, radar, EO/IR, MEMS, hyperspectral, audio behind default-deny actuation policyROADMAP
eBPF observationProcess, syscall, filesystem, network monitors via libbpf + CO-RE; signed BPF artifacts, kernel-profile preflight, ringbuf telemetryDESIGN
eBPF enforcementLSM-BPF hooks for MAC and audit; disabled by default, enabled only after separate threat model and independent reviewROADMAP
DistributionGitHub releases: signed packages, SHA-256 checksums, SBOM, sandboxed installer with entitlement verificationBETA
Entitlement / paymentBase mainnet ETH settlement to treasury 0x2E96…0958; one wallet per install; client-side RPC verification + backend hardening when liveBETA
Demo siteThis page — static HF Space, in-browser simulation, wallet connection UILIVE

TARGET INFERENCE LATENCY BY BACKEND · DESIGN TARGETS

CPU (AVX2)
~380ms
GPU (CUDA/ROCm)
~85ms
NPU
~120ms
FPGA
~150ms
RISC-V + UCI-1
~220ms
Optical (optional)
~40ms

TRUST PLANE PRIVILEGE BUDGET · SHARE OF SYSTEM AUTHORITY

Constitutional
VETO
Metacognitive
KILL
Execution
QUOTA
Cognitive
PROPOSE
Skill
DECLARED
Interface
REQUEST
eBPF (observe)
WITNESS
04 / MATH & INVARIANTS DESIGN

FORMAL CORE

Receipt chain integrity

H(r₀) = SHA-256(genesis ‖ device_id)
H(rₙ) = SHA-256(H(rₙ₋₁) ‖ actionₙ ‖ planeₙ ‖ tₙ)

Append-only: valid(rₙ) ⇒ valid(r₀ … rₙ₋₁)
Any rewrite of rₖ invalidates all H(rₖ₊₁ … rₙ).

Capability budget

B(t) = B₀ − Σᵢ c(aᵢ)   for approved actions aᵢ ≤ t

execute(a) permitted ⇔
  c(a) ≤ B(t)  ∧  veto(a) = ⊥  ∧  sig(skill) valid

Budget exhaustion ⇒ fail closed, not fail open.

Metacognitive kill gate

For hypothesis h with evidence E:
  U(h) = 1 − max P(h | E)

kill(h) ⇔ U(h) > τ_kill  ∨  falsifier(h, E) = ⊤

The kill-gate evaluator is independent:
weights(killgate) ∩ writable(user_state) = ∅

BranchState merge

branch b = (root, Δ₁ … Δₙ)

merge(b₁, b₂) defined ⇔ conflict(Δ(b₁), Δ(b₂)) = ∅
else: user-arbitrated three-way merge over receipts

TIMEMACHINE: restore(t) replays r₀ … r_t exactly;
state(t) is a pure function of the receipt prefix.

eBPF intent / observation reconciliation PAPER II

declared  D(a)  = { principal, capability, exec_id, policy_fp }
observed  O(a)  = { pid, exec_id, hook, event_class }  from BPF

consistent(a) ⇔ D(a).exec_id = O(a).exec_id
             ∧  O(a).event_class ⊆ capability(a)

¬consistent(a)  →  incident_candidate(a); metacog weighs
alternatives; constitutional plane decides response.

eBPF loader gate PAPER II

load(obj) permitted ⇔
     provenance(obj) ∧ policy(obj.class) ∧ kernel_compat
   ∧ signature(obj) ∧ verifier(obj) = ⊤
   ∧ hook ∈ approved_hooks
   ∧ capabilities ⊆ loader_capabilities

Any gate false ⇒ fail closed; AI cannot generate obj.
05 / CONSTITUTIONAL SAFETY

FAIL CLOSED

Fail closed for ambiguous sensitive actions — uncertainty resolves to refusal, never to execution.
Same-wallet payment entitlement and install signature verified by an independent backend when live; the browser alone is never trusted.
User-local state cannot rewrite substrate metacognition — the evaluator that doubts the system is not owned by the system.
Physical actuation is default-deny with a separate, explicit safety case per actuator class.
Signed packages, SHA-256 checksums, SBOM and sandboxed installation for every release artifact.
Local-only mode, air-gap operation and explicit per-destination egress controls.
Unicode confusables and prompt-injection inputs are treated as untrusted at every plane boundary.
Conflict-aware offline synchronization — peers reconcile receipts, they never overwrite them.
eBPF programs are signed artifacts loaded through a privileged boundary; the AI cannot generate or load BPF code.
LSM-BPF enforcement is disabled by default; enabling requires a reviewed threat model and recovery procedure.
The Linux BPF verifier is an independent kernel safety boundary; the OS does not replace it with a model-generated judgment.
Telemetry is minimized — only fields necessary for the declared security purpose are collected, and retention is configurable.
06 / KERNEL EVIDENCE PAPER II — OCT 2026

eBPF SUBSTRATE

Research Paper II extends CHAINSTATE from a governed user-space architecture to a kernel-near observability and security substrate using extended Berkeley Packet Filter (eBPF). The goal is not to make eBPF an AI decision-maker. eBPF supplies kernel-visible evidence that can be correlated with what the Constitutional plane authorized. Declared behavior = capability contract. Observed behavior = kernel event stream. Receipt outcome = the auditable relationship between the two.

TRUST CHAIN · USER-SPACE → KERNEL

CognitiveRUNTIME MetacogKILL GATE ConstitutionalPOLICY CapabilityACTION BROKER ExecutionSANDBOX eBPF Observe+ RESERVED ENFORCE Linux KernelVERIFIER AUTHORITY FLOWS DOWN · EVIDENCE FLOWS UP RECEIPT CORRELATION · intent ↔ observation

BPF PROGRAMS · os/ebpf/

DESIGN
process_monitor
process_monitor.bpf.c
SEC("tp/sched/sched_process_*")
Correlates authorized execution with parent/child identity and executable provenance. Captures exec, fork, exit via tracepoints.
DESIGN sys
syscall_monitor
syscall_monitor.bpf.c
SEC("tp/raw_syscalls/sys_enter")
Exposes unexpected syscall behavior from sandboxed workloads. Filtered by selected event classes to minimize telemetry.
DESIGN
filesystem_monitor
filesystem_monitor.bpf.c
SEC("fentry/vfs_open") · SEC("fentry/vfs_write")
Records file open, read and write events against the issued capability (e.g. fs.read:workspace) for policy reconciliation.
DESIGN
network_monitor
network_monitor.bpf.c
SEC("cgroup_skb/egress") · SEC("kprobe/tcp_connect")
A skill configured with net.none that opens a socket raises an incident candidate. Egress destination class is captured for the receipt.
ROADMAP · DISABLED BY DEFAULT
security_lsm
security_lsm.bpf.c
BPF_PROG_TYPE_LSM · attached to LSM hooks
Reserved for a future MAC/audit enforcement profile. Enabled only after a separate threat model, compatibility matrix, recovery procedure and independent security review.

EIGHT-GATE LOAD SEQUENCE · PRIVILEGED LOADER

PROVENANCESource revision, build metadata, SBOM, artifact digest, signer identity.
POLICYProgram class and hook allowed for the deployment profile.
COMPATIBILITYKernel / BTF availability, program type, helpers and capabilities.
INTEGRITYRelease-artifact signature validated against known signer.
VERIFIERIndependent Linux BPF verifier accepts the program. No AI override.
ATTACHMENTProgram attached only to the approved hook set — nothing else.
HEALTHMonitor load state, event loss, CPU and memory overhead, detach events.
ROLLBACKThresholds exceeded → remove program, restore last known-good profile.

EVALUATION DIMENSIONS · PAPER II

eBPF coverage
TARGET
Event-loss rate
< 1%
Attribution accuracy
TARGET
Policy / observation consistency
TARGET
Unexpected-egress detection
< 500ms
Enforcement latency (LSM)
< 50ms
Rollback time
< 2s
Verifier rejection (negative tests)
100%
Telemetry overhead · CPU
< 3%
Privacy minimization
TARGET

No value is a measured production result until reproduced on the Appendix A matrix. All bars are design targets.

CODE · REFERENCE SNIPPETS

os/ebpf/process_monitor.bpf.cCO-RE · libbpf
// os/ebpf/process_monitor.bpf.c — exec/fork/exit telemetry
#include "vmlinux.h"
#include <bpf/bpf_helpers.h>
#include <bpf/bpf_tracing.h>

char LICENSE[] SEC("license") = "GPL";

struct process_event {
    __u32 pid;
    __u32 ppid;
    __u64 ts_ns;
    __u32 uid;
    char  comm[16];
    char  exe[128];
};

struct {
    __uint(type, BPF_MAP_TYPE_RINGBUF);
    __uint(max_entries, 256 * 1024);
} events SEC(".maps");

SEC("tp/sched/sched_process_exec")
int handle_exec(struct trace_event_raw_sched_process_exec *ctx) {
    struct process_event *e;
    e = bpf_ringbuf_reserve(&events, sizeof(*e), 0);
    if (!e) return 0;
    u64 id = bpf_get_current_pid_tgid();
    e->pid   = id >> 32;
    e->ppid  = BPF_CORE_READ(ctx, old_pid);
    e->ts_ns = bpf_ktime_get_ns();
    e->uid   = bpf_get_current_uid_gid();
    bpf_get_current_comm(&e->comm, sizeof(e->comm));
    bpf_ringbuf_submit(e, 0);
    return 0;
}
07 / RESEARCH & DEVELOPMENT

THE PAPERS

PAPER I · SEPTEMBER 2026

CHAINSTATE AGI Linux OS

A Local-First Cognitive Operating System with Temporal BranchState Continuity, Hardware-Agnostic Cognitive Acceleration, Sensor-Fusion, Optical-Generative Extensions, Constitutional Safety, and Offline-First Distributed Deployment.

Separation of trust planes. Interface, Skill, Cognitive, Metacognitive, Constitutional, Execution, Continuity and Hardware are distinct privilege domains. A Cognitive-plane proposal holds no authority until it survives Challenge, Authorization and Execution.

Governed cognition loop. OBSERVE → REPRESENT → HYPOTHESISE → CHALLENGE → AUTHORIZE → EXECUTE → REFLECT, with receipts appended at every transition.

Continuity as a first-class citizen. BranchState treats system state as a pure function of an append-only receipt chain, enabling TIMEMACHINE rollback, branching experiments and conflict-aware offline peer sync.

Independent falsifiability. A metacognitive kill gate, isolated from user-writable state, actively attempts to falsify the system's own hypotheses before they can act.

Hardware pluralism. CPU, GPU, NPU, FPGA, RISC-V with UCI-1 acceleration path and an optional optical inference backend on the roadmap, plus a default-deny fused-sensor pipeline.

DOWNLOAD PDF RESEARCHGATE

PODCAST · PAPER I
Audio walkthrough · OS.m4a
PAPER II · OCTOBER 2026 · FOLLOW-UP

A Governed Cognitive Operating System with Kernel-Level eBPF Observability and Enforcement

Follow-up paper extending CHAINSTATE from a governed user-space architecture to a kernel-near observability and security substrate using eBPF, with an LSM-BPF enforcement path reserved for reviewed deployments.

eBPF as evidence, not authority. The cognitive runtime cannot generate or load arbitrary eBPF programs. Signed, pre-built BPF artifacts move through a privileged loader with eight gates (provenance → policy → compatibility → signature → kernel verifier → attachment → health → rollback).

Intent / observation reconciliation. Receipts correlate what Constitutional authorized with what the kernel-visible execution path reports: request hash, principal, capability set, executable identity, observed event class, policy fingerprint, outcome.

Extended loop. Observe → Represent → Hypothesise → Challenge → Authorize → Execute → observe kernel effects → Receipt → Reflect.

Independent kernel verifier. The Linux BPF verifier remains an independent safety boundary. Signatures establish provenance and integrity; they do not replace verifier checks or capability requirements.

LSM-BPF disabled by default. MAC and audit via LSM-BPF are enabled only after a separate threat model, compatibility matrix, recovery procedure and independent security review.

Evaluation. Twelve measurable dimensions — coverage, event loss, attribution, consistency, detection and enforcement latency, rollback, verifier rejection, overhead, privacy minimization, offline determinism. No numeric target is presented as a result until reproduced on Appendix A's experiment matrix.

DOWNLOAD PDF RESEARCHGATE

PODCAST · PAPER II
Audio walkthrough of the eBPF follow-up · eBPF.m4a

R&D tracks

DESIGN BranchState + TIMEMACHINE continuity core

DESIGN eBPF process / syscall / fs / network monitors

ROADMAP LSM-BPF enforcement (reviewed deployments only)

ROADMAP UCI-1 + RISC-V acceleration

ROADMAP LiDAR / radar / EO-IR / MEMS / hyperspectral / audio fusion

ROADMAP Optional optical inference backend

DESIGN ORCID 0000-0002-9510-8377 · University of Agder

08 / ACCESS

GET THE OS

CHECKOUT · BETA · CLIENT-SIDE VERIFICATION
USD666

One-time, one install per wallet. ETH settlement on Base mainnet (chain 8453) directly to the CHAINSTATE treasury. The transaction hash is required to unlock the installer — public download does not grant installation.

TREASURY 0x2E964e1c0e3Fa2C0dfD484B2E6D2189dfCF20958 state-v.eth
ETH/USD loading…
Price in ETH —
Chain Base 8453

Wallet not connected.

ALREADY PAID? REDEEM BY TX HASH

Paste a Base-mainnet transaction hash sent from the connected wallet to the treasury above. The page verifies it against the public Base RPC and issues your install token.

INSTALL UNLOCKED

Entitlement bound to . One wallet · one install.
INSTALL TOKEN · SHA-256(wallet ‖ tx ‖ chainstate-os-v1)
—
INSTALLER COMMAND
—

The installer in RedCiprianPater/chainstate-os re-verifies the token server-side against the on-chain transaction and your wallet signature before writing the bundle. Keep the token private — anyone who holds it can attempt one install.

GITHUB INSTALL

Public download does not grant installation. The installer requires the install token above, which binds entitlement to the paying wallet, bundle hash and expiry, with a same-wallet signature.

REPOSITORY

HF SPACE

This static Space is demo + checkout UI only. Secrets stay off the Space; verification runs against the public Base RPC until the hardened backend is live.

SPACE

RELEASE INTEGRITY

Every release ships signed packages, SHA256SUMS, an SBOM and verify-bundle.sh. Verify before installing. Both R&D papers are attached to releases and linked from this Space.

HOW ENTITLEMENT WORKS

  1. Connect MetaMask on Base 8453.
  2. Click PAY — the page computes the ETH amount for USD 666 at live rate and sends your transaction to the treasury.
  3. The page polls the public Base RPC for inclusion and verifies: to = treasury, from = your wallet, status = success.
  4. An install token = SHA-256(wallet ‖ tx ‖ v1) is derived.
  5. The repo installer re-verifies the token on-chain and against your wallet signature before writing the bundle. One wallet, one install.