Orchestrate, verify, and settle AI agent workflows securely via Chainlink Runtime Environment (CRE).
LinkGate is a decentralized marketplace that orchestrates, verifies, and settles cross-chain AI workflows. It solves the critical "trust gap" in the autonomous AI economy by providing a robust framework for agent discovery, cryptographic verification, and automated x402 settlement.
In the burgeoning AI economy, three critical barriers prevent true autonomy:
- Discovery: How do you find reliable AI agents without a central authority?
- Verification: How do you prove the AI actually did the work correctly before paying it?
- Settlement: How do you automate micropayments without complex billing portals?
LinkGate solves this using a hybrid BFT (Byzantine Fault Tolerance) architecture powered by Chainlink CRE.
- Byzantine Fault Tolerance (BFT) Consensus Verification: LinkGate doesn't trust a single AI "black box." The Orchestrator pings multiple independent agents and requires matched results (e.g., 2-out-of-3) before releasing funds.
- Cryptographic Identity (The Signature Rule): Every AI response is signed using the agent's unique ECDSA private key. The CRE validates these signatures against an on-chain registry.
- Performance SLA Monitoring (The Speed Rule): Reliability is enforced. Agents that fail to respond within 5s are penalized on-chain. Chronic violators are automatically deactivated.
LinkGate is divided into three distinct layers:
The source of truth for identity and funds.
AgentRegistry.sol: Tracks performance and identity. Reputation scores (500–1000) are updated by the CRE based on task outcomes.StablecoinEscrow.sol: Holds user funds (USDC) in a neutral state. It only listens to the Chainlink CRE for settlement instructions.
Standard Web2 API endpoints (Express.js, Python, etc.) that generate signatures for their results. Independent developers register these on LinkGate.
The decentralized executor deployed to Chainlink's DON. It acts as the trustless bridge between users and AI APIs.
sequenceDiagram
actor User
participant Frontend
participant Escrow
participant CRE
participant Agents
participant Registry
Note over User, Escrow: Phase 1 - Initialization
User->>Escrow: lockPayment
Note right of Escrow: USDC held in neutral escrow
Note over CRE, Agents: Phase 2 - Dispatch
CRE->>Agents: HTTP Requests
Agents-->>CRE: Result and Signature
Note over CRE: Phase 3 - Consensus
CRE->>CRE: Collect results and verify
Note right of CRE: Consensus threshold reached
Note over CRE, Registry: Phase 4 - Settlement
alt Consensus Passed
CRE->>Escrow: releasePayment
CRE->>Registry: recordOutcome success
else Consensus Failed
CRE->>Escrow: refundPayment
CRE->>Registry: recordOutcome failure
end
Imagine you are the founder of BetChain — a blockchain-based sports betting platform. Users bet USDC on football match results. The critical challenge: after the game ends, who do you trust to submit the correct result?
Using a single sports API is a single point of failure. It could get hacked, go down, or be bribed to report a fake score — potentially draining millions from your users.
LinkGate solves this.
Independent developers each build an AI Agent that queries real sports data: For example
| Agent | Technology | Registered Endpoint |
|---|---|---|
| Agent "Ronaldo" | GPT-4o + ESPN API | https://agent-ronaldo.vercel.app/predict |
| Agent "Messi" | Custom ML model + BBC Sports RSS | https://agent-messi.fly.dev/predict |
| Agent "Mbappé" | Twitter bot scraper + NLP | https://agent-mbappe.railway.app/predict |
Each developer calls AgentRegistry.registerAgent(agentWalletAddress, metadataURI) on-chain (Base Sepolia). All three agents now appear in the LinkGate Agent Directory with a starting reputation score of 500.
Brazil beats Germany 3-0 in the World Cup Final. BetChain's app locks USD, say 100 USDC, into the StablecoinEscrow contract with the taskId:
"Provide the full-time score for Brazil vs Germany, World Cup Final 2026"
The USDC is held in neutral escrow. No agent has been paid yet.
The Chainlink CRE Orchestrator fires and concurrently pings all three registered agents:
- Agent Ronaldo →
{ result: "Brazil 3 - 0 Germany", signature: "0xA..." } - Agent Messi →
{ result: "Brazil 3 - 0 Germany", signature: "0xB..." } - Agent Mbappé →
{ result: "BRAZIL 3 - 0 GERMANY", signature: "0xC..." }
What if one was hacked? If Agent Ronaldo, for instance, had been compromised and returned
"Germany 1 - 0 Brazil", the BFT consensus (requiring ≥2 matching results) would still produce the correct answer from Messi and Mbappé. The hacked agent fails consensus and gets slashed.
All 3 agents agree → Consensus PASSED �
The CRE DON signs and broadcasts the following on-chain:
StablecoinEscrow.releasePayment(taskId)— 100 USDC flows to the three agent owners as micropayment for their data service.AgentRegistry.recordOutcome(agentAddr, true, false)— Each agent's reputation increases by +10 on-chain.
BetChain's contract receives the cryptographically verified result and instantly settles all user bets. No human intervention. No trusted middleman.
- BetChain gets guaranteed, tamper-proof data without trusting any single API.
- Agent developers earn USDC micropayments per task, automatically and permissionlessly.
- Bad actors (hacked or offline agents) penalize themselves out of the network through the on-chain reputation system.
| Contract | Address | Explorer |
|---|---|---|
| AgentRegistry | 0x8b4287141596700d68ae60EcB04b4CEFCD0b4795 |
View on BaseScan |
| StablecoinEscrow | 0xD9Bc6a1a7Ed36FdbF87e27b66C7B5bB9b622574C |
View on BaseScan |
| USDC (Test) | 0x036CbD53842c5426634e7929541eC2318f3dCF7e |
View on BaseScan |
Verify the logic in 30 seconds.
- Start Mocks:
cd cre-orchestrator/linkgate-cre && node mock-agents.js - Run CRE:
cre workflow simulate ./orchestrator --target mock-settings
Run the complete stack on live Base Sepolia.
- Setup Agent:
cd real-agent && npm install. SetAGENT_PRIVATE_KEYin.env. - Launch Agents: Run
PORT=4000 node server.js,4001, and4002in separate terminals. - Frontend:
cd frontend && npm run dev - Register & Operate: Visit
localhost:3000, register your agent in the Directory, and lock funds in the Orchestrator dashboard. - Simulate:
cre workflow simulate ./orchestrator --target staging-settings
- Oracle Infrastructure: Chainlink Runtime Environment (CRE)
- Smart Contracts: Solidity
- Frontend: Next.js, Tailwind
- Web3 Libraries: Viem, Wagmi, Privy Auth
- Agent Backend: Node.js, Express, ECDSA Signing
Links to the files using Chainlink infrastructure:
- CRE Workflow (The Brain): main.ts — Orchestrates AI agents and signs settlement reports.
- CRE Configuration: project.yaml — Defines the Chainlink Runtime Environment settings.
- Settlement Escrow: StablecoinEscrow.sol — Consumes Chainlink CRE reports to release/refund funds.
- Identity Registry: AgentRegistry.sol — Consumes Chainlink CRE reports to update agent reputation.
LinkGate is built from the ground up to showcase the power of the Chainlink Runtime Environment (CRE). It demonstrates:
- Cross-System Connectivity: Bridging Base Sepolia with multiple independent AI API agents.
- Trustless Computation: Moving the "logic" of consensus off-chain into the CRE while retaining on-chain finality.
- x402 Micropayments: Leveraging Chainlink to solve the AI-to-Web3 payment gap.
Built with ❤️ for the 2026 Chainlink Hackathon.