-
Notifications
You must be signed in to change notification settings - Fork 1
contracts
Jacob S Vickers edited this page Jul 16, 2026
·
4 revisions
title: contracts created: 2026-07-07 updated: 2026-07-11 type: entity tags: [layer-2, identity, tokenomics, compliance] confidence: high source_files:
- contracts/src/framework/AgentPrimitivesFactory.sol
- contracts/src/framework/XibalbaAgentRegistry.sol
- contracts/src/framework/XibalbaNameService.sol
- contracts/src/core/SovereignAgent.sol
- contracts/src/oracle/ReputationRegistry.sol
- contracts/src/oracle/CCIPReputationBridge.sol
- contracts/src/shield/ComplianceGate.sol
- contracts/src/markets/IntegrityMarket.sol
- contracts/script/Deploy.s.sol
- contracts/script/DeployMarkets.s.sol
The Solidity/Foundry package (solc 0.8.28): the on-chain heart of the protocol.
It implements the 7 agent primitives, the
factory that deploys them, the shared registries, the $ITK token, the
Xibalba Shield HIPAA stack, the
market/application layer, and the
ZK verifier.
-
Primitives (per-agent):
SovereignAgent,StateAnchor(direct-deploy);ReputationRegistry,Slasher,VerifierRegistry,ComplianceGate,AgentProfile(EIP-1167 clones —Initializable, set up viainitializenot a constructor). -
Singletons:
IntegrityToken($ITK),UltraPlonkVerifier,XibalbaAgentRegistry,XibalbaNameService(XNS, added 2026-07-11 — see below),DomainRegistry, plus the Shield stack (CoveredEntityRegistry,SmartBAAFactory/SmartBAA— see Smart BAA —HIPAAGuardrailRegistry,EHRGate). -
Factory:
AgentPrimitivesFactory.registerPrimitives(...)clones the 5 and atomically registers all 7 addresses inXibalbaAgentRegistry. -
Markets (
contracts/src/markets/, added 2026-07-09):IntegrityMarket(EIP-1167 clone template, one clone per market),MarketFactory(singleton — any registered agent deploys+owns its own market clone),A2ACapitalPool(singleton — agent-to-agent capital escrow). See Integrity Market for the full design; deployed via the separate incrementalDeployMarkets.s.sol, not genesisDeploy.s.sol. -
XibalbaNameService(XNS,contracts/src/framework/XibalbaNameService.sol, added 2026-07-11): maps human-readable handles ("hermes.integrity") to a registered agent'sSovereignAgentaddress. Self-service and first-come-first-served (register()checksXibalbaAgentRegistry. isRegisteredAgent(msg.sender)live, no admin in the critical path) — deliberately not a port of the legacy prototype's same-named contract, which required an admin-onlyREGISTRAR_ROLEto register handles on an agent's behalf, violating this rewrite's self-sovereign thesis. Modeled instead onDomainRegistry.registerDomain's existing self-service pattern in this codebase;XNS's ownREGISTRAR_ROLEis reserved for dispute intervention only (revokeByRegistrar), same scope asDomainRegistry's. Was[PLANNED](see the olddocs/wiki/concepts/xns.md, now removed per that page's own "replace when a real contract lands" instruction) — no contract existed anywhere in this rewrite'scontracts/src/until now.
-
Call-routing: every clone's admin is the agent's
SovereignAgentcontract; state changes route throughSovereignAgent.execute(one bootstrap exception — see agent primitives). -
Clone-init footgun guarded: inline field initializers (
= 3 days) compile into the constructor, which clones never run — every such default is set ininitializeinstead (Slasher.disputeWindow,ReputationRegistry.reportingPeriod). -
via_ir = true—registerPrimitivesclones+inits 5 contracts in one function and hits "stack too deep" under legacy codegen.
-
165 tests (
forge test, confirmed via a real run — the rootREADME.md's previously-stale "127" is now fixed to match), all green — including full end-to-end coverage of the registration sequence intest/AgentPrimitivesFactory.t.sol, 21 market-layer tests, 14test/XibalbaNameService.t.soltests, and 3 new tests coveringCCIPReputationBridge's per-agent-clone rework (see below). -
Deployed to Base Sepolia (chainId 84532):
XibalbaAgentRegistryat0x72e21e44AdD6d6e7CAa02eaedF078630afC40819,AgentPrimitivesFactoryat0x215f39C8a2Cea2F8c6976fA10bbf48479825aD6e, plus the market-layer singletons (see Integrity Market). Full set indeployments.baseSepolia.json.XibalbaNameServiceis wired intoDeploy.s.soland verified end-to-end against a real local anvil deploy, but not yet broadcast to Base Sepolia — that's a live-contract action needing explicit sign-off, not taken automatically.
-
UltraPlonkVerifier.solis a fail-closed placeholder (verify()reverts) untilbb write_solidity_verifiergenerates the real UltraHonk verifier from integrity-zkp. Confirmed directly against the deployed Base Sepolia bytecode (234 bytes — far too small to be the real ~2465-line generated verifier), not just inferred from source: the placeholder is what's actually live. -
CCIPReputationBridge.sol— reworked 2026-07-11, no longer a gap in the sense of being architecturally incompatible with the per-agent clone model: it now holdsXibalbaAgentRegistryand resolves each agent's ownReputationRegistryclone viaresolveAgent(agent).primitives.reputationRegistry(the same idiomEHRGate/IntegrityMarket/A2ACapitalPoolalready use) instead of one immutable pre-clone-model registry address. Bridging is now correctly per-agent opt-in — an agent'sSovereignAgentcontroller must grant this bridgeBRIDGE_ROLEon its own clone before_ccipReceivecan update its score, since each clone'sDEFAULT_ADMIN_ROLEbelongs to that specific agent, not a global admin. Still not deployed byDeploy.s.sol— but that's now a genuine operational decision (a peer bridge needs a second real chain to be meaningful), not a remaining code gap.
Related: agent primitives, ComplianceGate, Interface Contract.
Generated from INTEGRITY-LATEST/docs/wiki. Edit the canonical repository files, not this mirror.
- A2A Negotiation Protocol [PLANNED]
- AIS API — Versioned Wire Spec
- Agent Integrity Score (AIS)
- Agent Primitives (Self-Sovereign Identity)
- Behavioral Commitment Chain (BCC)
- ComplianceGate & Integrity Health
- Cross-Chain Reputation Sync [PLANNED]
- Decentralized Identifier (DID)
- Identity Ceiling & Verification Ladder [BUILT]
- Integrity Market (Prediction Markets, Binary Options, A2A Capital Allocation)
- Integrity Protocol Specification
- Local Metrology (Client-Side AIS Signal Derivation)
- Merkle Batching & Anchoring Convention
- Observability & PHI Safety Pipeline
- On-Chain Governance
- Persistent Memory Bridge
- Persistent Memory, Genesis Root & Lineage [PARTIALLY BUILT]
- Smart BAA (On-Chain Business Associate Agreement Escrow)
- Telemetry Ingestion Pipeline
- Testing Strategy
- The Four Foundational Primitives
- Xibalba Agent Operating Model
- ZK-ML Model-Inference Verification [PLANNED]
- Zero-Knowledge Proving Pipeline