Repository navigation
Architecture
Ranesh Rajit edited this page Oct 8, 2026
·
3 revisions
flowchart LR
subgraph AGENT["Remote agent (untrusted)"]
direction TB
B1["binary bytes<br/>AgentState.java"] --> M["Measurer<br/>SHA-256 x3"]
B2["config/<br/>agent-config.json"] --> M
B3["memory whitelist<br/>mode / limit / version"] --> M
M --> H["hBin, hCfg, hMem<br/>hComb = SHA256(raw32 x3)"]
H --> S["Signer - Ed25519 seal<br/>agentId / seq / ts / hashes / prevHash"]
end
subgraph CHAIN["Local chain :8545"]
SOL["Integrity.sol<br/>enroll / anchor<br/>Anchored events = history"]
end
subgraph BOSS["Boss / Verifier (trusted)"]
RE["re-measure (single host)"] --> V["Verifier - 6 checks<br/>comb / seal / link /<br/>recompute / baseline / freshness"]
BASE[("baseline.json<br/>golden, enrolled Phase 0")] --> V
end
S -->|"signed JSON, every 5s"| V
S -->|"anchor() tx, every 5s"| SOL
S -->|"always append"| LED[("ledger.jsonl<br/>FALLBACK")]
SOL -. "block.timestamp authoritative" .-> V
V --> D["Dashboard :8080<br/>GREEN / RED / STALE"]
V -->|"counter-signs every verdict"| W["Witness (boss key)<br/>witness.jsonl hash chain"]
| Box | Job | File |
|---|---|---|
| Measurer | 3 SHA-256 fingerprints + deterministic memory canonicalization | measure/Measurer.java |
| Signer | Ed25519 wax seal over the 8-field payload | sign/Signer.java |
| Chain anchor | Real anchor() tx every cycle + getLatest readback (CHAIN_MISMATCH on divergence), locally signed EIP-155 raw tx (pure-JDK secp256k1 + RLP submitted via eth_sendRawTransaction, falls back to eth_sendTransaction), raw JSON-RPC (HTTP/1.1), Keccak + manual ABI |
chain/ChainAnchor.java, chain/Secp256k1.java, chain/Rlp.java, chain/Keccak.java, chain/Abi.java
|
| Verifier | 6 independent checks, per-component blame | verify/Verifier.java |
| Witness | Boss counter-attestation: own key, hash-chained witness.jsonl (rotates to a timestamped archive past 50k lines; a signed carry line keeps the chain verifiable across files) |
witness/Witness.java |
| Baseline | Golden hComb from Phase 0 enrollment, never overwritten from chain; pins the public key and (when config/chain.json exists) chainContract + chainId
|
config/baseline.json |
| Dashboard | Status light + attack buttons + witness panel + /metrics (Prometheus text), PORT / RPC_URL env overrides, JDK HttpServer
|
ui/Dashboard.java, web/
|
| Contract | Diary: enroll once, anchor per cycle, history in events |
contract/contracts/Integrity.sol |
- Chain only cannot tell "new honest measurement" from "honest Checker anchoring a hash of the attacker's edited file".
- Baseline only cannot prove when things happened or in what order.
- The Verifier demands both:
H_recomputed == H_chain == H_baseline.
- The agent machine is untrusted: it measures and signs, it never decides what is good.
- The Boss stores truth:
baseline.json(golden hashes + pinned public key) and the witness key live outside the writable agent area. - The chain orders truth:
Anchoredevents give history andblock.timestampgives freshness.ledger.jsonlis a tamper-evident file fallback so the engine survives node death; it and the witness file rotate to timestamped archives past 50k lines.
Decentralized Runtime Integrity Engine