CREHub
CREHub is a pay-per-trigger marketplace where developers publish Chainlink CRE workflows as premium on-chain capabilities and AI agents consume them autonomously - no subscriptions, no API keys, no gatekeepers.
What it is
Chainlink CRE gives developers the ability to write workflows that run on a Decentralised Oracle Network with verifiable, trust-minimised compute. But every CRE workflow today is siloed: built privately, used by one team, and invisible to everyone else. There is no marketplace to share them, no standard interface for AI agents to consume them, and no way for creators to monetise them.
CREHub fixes this.
CREHub is a decentralised marketplace where developers publish Chainlink CRE workflows as pay-per-trigger AI skills. Any AI agent (or human) can discover a workflow by semantic search, pay a micro-fee in USDC, and receive a verifiable on-chain result. No subscriptions. No API keys. No central authority. Just a trigger, a payment, and a cryptographically attested output.
Here's how it works end-to-end:
A creator builds a CRE workflow using @crehub/cli, runs crehub test to simulate it locally, deploys it to the Chainlink DON with crehub deploy, and registers it on-chain with crehub list - writing its metadata (price, inputs, outputs, category) to WorkflowRegistry.sol on Ethereum Sepolia. The workflow's HTTP trigger is locked to the CREHub gateway's ECDSA public key, so only the marketplace can fire it.
On the consumer side, an AI agent searches GET /api/workflows/search?q=aave+health+factor, finds the workflow, and calls POST /api/trigger/:workflowId. The gateway returns HTTP 402 with USDC payment details. The agent pays on Ethereum Sepolia and retries with X-Payment:
Every execution produces three on-chain proofs:
- a USDC payment transaction
- an ExecutionSettled event from SettlementVault
- a keccak256(outputJson) hash stored in WorkflowResultStore - written by the CRE Forwarder via CREHubExecutor.onReport()
For AI agents specifically, CREHub ships an MCP Server (7 tools for Claude Code and AI IDEs) and an Openclaw SKILL.md - both giving agents a native, standardised interface to discover, pay for, and execute any CRE workflow without custom integration.
The result: CRE workflows become a composable, monetisable, agent-accessible layer - turning isolated developer tools into a shared capability marketplace. CREHub has processed 46 real on-chain executions across two live workflows (Aave Health Factor Monitor and Technical Analysis Signal) with fully verifiable settlement on Ethereum Sepolia.
How it Works
CREHub is a decentralized marketplace for Chainlink CRE workflows - think npm for on-chain AI agents, where anyone can publish a workflow and anyone (human or AI) can discover and pay to run it.
---
Smart Contracts (Ethereum Sepolia)
Two Solidity contracts form the trust layer. WorkflowRegistry.sol is the source of truth for listings - each workflow is stored
on-chain with its ID, creator address, USDC price, description, and full I/O schema (input/output field names, types, descriptions).
SettlementVault.sol holds escrowed USDC and releases it based on execution outcome: 90% to the workflow creator on success, 1%
protocol fee retained, or 99% refunded on failure. Settlement is triggered by the gateway's hot wallet after the CRE execution
completes.
---
Backend API (Bun + Express + MongoDB)
The backend bootstraps by reading all WorkflowListed events from the registry contract on startup using viem, upserting them into
MongoDB. A live watchContractEvent listener plus a 30-second fallback polling loop keeps the DB in sync with chain state. A semantic
search index is built in-memory using @xenova/transformers with the all-MiniLM-L6-v2 model - each workflow's description and
metadata is embedded as a float32 vector, and queries are ranked by cosine similarity. The API exposes endpoints for listing,
searching, and fetching workflow detail, and proxies trigger calls to the gateway.
---
x402 Payment Gateway (Bun + Express)
Implements the HTTP 402 payment protocol: the client first hits POST /trigger/:workflowId with no payment and receives a 402 Payment
Required response with the exact USDC amount and recipient address. The client then submits an on-chain USDC transfer, passes the
tx hash in the X-Payment header, and the gateway verifies it on-chain - checking the amount, recipient, and that the hash hasn't
been reused (replay protection via MongoDB deduplication). Once verified, it calls cre workflow simulate as a subprocess in the
workflow's directory, which runs the TypeScript workflow code through the Chainlink CRE runtime. The result is returned to the
caller, and settlement is finalized on-chain via SettlementVault.
---
Frontend (Next.js + wagmi + viem)
Built with Next.js App Router. Wallet connection is handled by wagmi + WalletConnect. The workflow detail page renders the full I/O
schema dynamically. The Trigger Panel walks the user through the full x402 flow - it detects wallet balance, constructs the USDC
transfer calldata, sends the on-chain payment via MetaMask, then polls the backend with the tx hash until execution completes. An
Agent Console page lets developers send raw JSON payloads programmatically and watch a live streaming execution log.
---
AI Integration
An MCP (Model Context Protocol) server exposes 7 tools - list_workflows, search_workflows, get_workflow_detail, discover_workflow,
trigger_workflow, get_executions, get_execution - so Claude.ai (or any MCP-compatible client) can discover, evaluate, and trigger
workflows in natural language without leaving the chat interface. A SKILL.md file in the repo follows the agentskills.io spec,
making the entire marketplace callable by OpenClaw and compatible autonomous agents via a single POST /api/trigger/:workflowId with
an X-Payment header.
---
Developer CLI (crehub-cli)
A TypeScript CLI built with Bun that wraps the full developer lifecycle. crehub init scaffolds a new CRE workflow project from a
template. crehub doctor validates the environment - checks for the cre binary, wallet config, and RPC connectivity. crehub test runs
cre workflow simulate locally with a sample payload. crehub deploy broadcasts the workflow to the Chainlink CRE DON. crehub list
registers the workflow on-chain via WorkflowRegistry.listWorkflow(), making it discoverable in the marketplace immediately.
Links
Created by
- Nilesh Gupta
- Ankur Kumar Shukla