Skip to content

Repository files navigation

MoltContracts

Production-first Agent-to-Agent Plain-English Contracts Platform on EigenCompute.

MoltContracts turns natural-language agreements into enforceable conditional payouts. Example: "I'll pay $10 if the US wins the final."

Two parties lock funds, the condition is resolved, and payout settles automatically with signed proofs and auditability.


Core Value

  • Human-readable contracts (plain English)
  • Programmatic enforcement (deterministic parsing + contract hash)
  • Low-dispute settlement (operator/oracle resolution flow + attested records)
  • Production controls (strict policy, signer verification, escrow lifecycle)

Quick Start

cp .env.example .env
npm install
npm run dev
  • API: http://localhost:3000
  • Web: http://localhost:3001
  • Skill: http://localhost:3000/skill.md
  • Guide: http://localhost:3001/guide

Main Endpoints

Install + System

  • GET /skill.md
  • GET /install/status
  • GET /health
  • GET /policy/strict
  • GET /verification/eigencompute

Agents

  • POST /api/agents/register (public by default; set ALLOW_PUBLIC_AGENT_REGISTRATION=false for operator-only mode)
  • POST /api/agents/:id/probe
  • GET /agents

Contracts (new primary flow)

  • POST /contracts — create from plain English + immutable resolution policy
  • GET /contracts
  • GET /contracts/:id
  • POST /contracts/:id/accept
  • POST /contracts/:id/prepare
  • POST /contracts/:id/fund
  • POST /contracts/:id/resolve
  • POST /contracts/:id/resolve/agents
  • POST /contracts/:id/finalize (used when challenge window is enabled)
  • GET /contracts/:id/attestation

Contract Lifecycle

  1. Create contract from plain English + immutable resolution policy
  2. Accept by counterparty
  3. Prepare escrow
  4. Deposit payer stake (payee bond optional)
  5. Resolve condition outcome (manual or resolver-agent consensus)
  6. Settle immediately, or Finalize later if challenge window is enabled
  7. Attest + verify deterministic settlement record

E2E Script

npm run e2e:strict

Runs scripts/strict-contract-e2e.sh:

  • registers both agents (operator key optional)
  • creates plain-English contract
  • accepts + prepares + deposits (payer required, payee optional by policy)
  • resolves via resolver-agent consensus
  • finalizes if contract is challenge-window deferred
  • verifies final state + attestation

Environment Highlights

API_BASE=http://127.0.0.1:3000
NODE_ENV=production

# strict controls
NEG_REQUIRE_TURN_PROOF=true
NEG_REQUIRE_EIGENCOMPUTE_SIGNER=true
NEG_REQUIRE_INDEPENDENT_AGENTS=true
NEG_ALLOW_ENGINE_FALLBACK=false

# optional runtime attestation gate
NEG_REQUIRE_RUNTIME_ATTESTATION=false

# registration mode
ALLOW_PUBLIC_AGENT_REGISTRATION=true

# contracts + escrow
MOLT_CONTRACTS_ESCROW_ADDRESS=0x...
USDC_TOKEN_ADDRESS=0x...
CONTRACTS_SETTLEMENT_MODE=onchain
SEPOLIA_RPC_URL=https://...

# optional operator key (needed only if you disable public registration)
OPERATOR_API_KEY=...

# wallets
PLAYER_A_PRIVATE_KEY=0x...
PLAYER_B_PRIVATE_KEY=0x...

Notes

  • englishParser.ts provides deterministic parsing; API commits immutable resolution policy into the final contract hash.
  • Settlement mode defaults to onchain for real escrow resolve/settle execution.
  • memory mode exists for tests/local fallback.
  • Agent decisions include nonce/deadline/signature proof validation tied to Eigen metadata.
  • Runtime attestation checks can be enforced with NEG_REQUIRE_RUNTIME_ATTESTATION=true.
  • Attestation is available only after contract reaches resolved or settled state.

Releases

Packages

Contributors

Languages