SciClaw x DAO

ChimiaClaw: Signed artifact DAG for autonomous chemistry agents

SciClaw x DAO

Created At

Open Agents

Project Description

ChimiaClaw is a Rust-native operating layer for autonomous scientific agents doing Chemistry & Physics that treats every meaningful state transition as an immutable, signed, content-addressed artifact in a parented DAG. It is the foundation of the infrastructure which will become the pillar of how ChimiaDAO will operate. For this hackathon I made three different agents, a literature one, a retrosynthesis one (The process via which we figure out how to make a molecule) and a computational chemistry one (Which runs Density Functional Theory (DFT) calculations on products and reactants). I was inspired by MIT's SciClaw x Infinite, re-wrote it in Rust, and made it far more agentic as well as ready for on-chain transactions. The idea is for AI+Scientists as well as AI Agents alone to be able to use this framework.

How it's Made

The whole system is a Rust workspace (~25 crates + 3 binaries) built around one canonical state model: an immutable, content-addressed, signature-verified artifact DAG. Every meaningful transition, a literature extraction, a retrosynthesis route, a DFT result, a quote, an escrow authorization, a result acknowledgement, a refund, a governance vote, is written as a parented signed artifact (chimiaclaw-artifact) with a stable schema id (chimiaclaw-schema), persisted to a content-addressed FileArtifactStore. Skills (chimiaclaw-skill + WASM and subprocess hosts) are pure functions that consume artifacts and produce artifacts. The market layer (chimiaclaw-market) gives that DAG a transaction spine: profile → offer → request → quote → acceptance → escrow → settlement → result → ack → release/refund.

Sponsor integrations • ENS (chimiaclaw-identity-ens + viem-driven scripts): live Sepolia publication, resolution, and verification of a text-record capability profile on chimiaclaw.eth. The CLI signs identity.ens.publication/resolution/verification artifacts so the dashboard's ENS card is just a projection of those signed records. • 0G (chimiaclaw-storage-0g): wraps 0G Storage uploads, captures storage URI + root hashes, and emits signed storage.zerog.upload artifacts. We produced 12 of these on Galileo for the overnight pipeline (organogermanium + propylene-glycol-diester DFT). ArtifactAnchor.sol (Foundry, Solidity 0.8.24) lets us commit artifact content hashes and 0G roots on-chain. • Uniswap (chimiaclaw-settle-uniswap): hits the Trade API POST /v1/quote with CLASSIC V4-pool routing, signs a market.uniswap.quote artifact, and uses a UniswapPreparedTransfer settlement shape for retrosynthesis ($3.10) and DFT ($8.25), plus a 7-molecule batch quote ($57.75). It is intentionally quote-only — no /swap call — so the agent is non-custodial. • KeeperHub (chimiaclaw-exec-keeperhub): a Rust schedule/status client surface plus runbook + builder feedback in FEEDBACK.md.

Chemistry stack DFT requests carry a chem.molecule.adt artifact with payload-bound canonical bytes drawn from chimiaclaw-moladt, a portable Rust ADT (atoms, coordinates, formal charges, sigma bonds, Dietz bonding systems, provenance) that mirrors a subset of the adjacent Haskell MolADT-Bayes, which was made by a former colleague of mine - https://github.com/oliverjgoldstein/MolADT-Bayes. Canonical JSON guarantees that Rust, Haskell, Python workers, and verifiers all hash the same payload bytes. MoleculeAdt::to_xyz and to_pyscf_atom_block are deterministic projections that drive the PySCF worker (skills/dft_pyscf, with optional GPU4PySCF and ASE), so SMILES becomes a derived projection rather than the canonical input. AiZynthFinder (skills/retrosynth_aizynth) and ORCA (skills/dft_orca) live behind the same skill boundary. ORD→ADT (chimiaclaw-ord-adt) bridges the Open Reaction Database into ADT experiments. Six HOMO/LUMO/total-density cubes are hashed and rendered as a WebGPU point-cloud gallery with bond skeletons in the dashboard.

Dashboard / world-model demo/world-map.html is a single dependency-free HTML/JS/WebGPU file that reads demo/world-model.live.json if present, otherwise falls back to demo/world-model.json, and refreshes every 5 seconds. demo/live-dashboard-watch.py watches demo/overnight-full-out/ and projects newly signed artifacts into the live JSON. chimiaclaw-cli world-model verify walks every reference in the model back to a signed artifact in the store. The UI is a projection rather than a second source of truth.

Contracts Foundry workspace under contracts/: ArtifactAnchor.sol (content-hash + 0G root anchoring), SettlementEscrow.sol (artifact-bound payment intents), ProposalRegistry.sol, CapabilityRegistry.sol, AgentReputation.sol, JobBoard.sol, ChimiaGovernor.sol, ChimiaTreasury.sol. Tests use forge and pin solc 0.8.24.

Notable / slightly hacky bits • The browser is treated as a render-only client: it never calls wallets, DFT workers, Uniswap, ENS, or 0G. All evidence comes from local signed JSON files; the verifier is the only thing trusted to bind UI text to chain/state. • DFT cubes are never inlined. Workers compute, hash, and store cubes; artifacts only carry the hash + size + grid metadata, so signing is cheap and replay-verifiable. The WebGPU gallery loads cubes lazily and shows the hash next to the orbital it renders. • A "live projection" file (world-model.live.json) is git-ignored and rebuilt by a Python watcher from on-disk artifacts. The dashboard can update mid-demo without a backend, and the static fallback still verifies offline. • The MolADT ADT is hand-mirrored from the Haskell MolADT-Bayes and pinned by canonical JSON byte equality, so future Haskell-side optimizers can sign the exact same molecule artifacts a Rust DFT request was built from. • Uniswap settlement is wired through a UniswapPreparedTransfer shape that produces a fully signed quote artifact but deliberately stops short of /swap, giving us audit-grade settlement evidence without ever holding user funds. • The whole submission boots from one focused command: python3 demo/live-dashboard-watch.py --once && python3 -m http.server -d demo 8797, then chimiaclaw-cli world-model verify proves the UI matches the signed DAG end-to-end.

Development tooling Cargo workspaces + cargo check --workspace --all-features, cargo test --workspace, Foundry for contracts, uv/uvx for Python skill envs, pnpm + tsc --noEmit + next build for SciCrucible, Mermaid for the architecture and prize-track diagrams in docs/HACKATHON.md and docs/ARCHITECTURE.md. AI development assistance came from Warp's Oz agent for scaffolding Rust crates, drafting the WebGPU HUD, and iterating Mermaid diagrams; the agents themselves and every signed artifact are produced by deterministic Rust/Python code, not by an LLM at runtime.

background image mobile

Join the mailing list

Get the latest news and updates