Skip to content

Latest commit

 

History

18 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Praxion — The Execution Layer for Autonomous AI Agents

Chainlink Convergence Hackathon 2025

AI agents discover, pay (x402), and trigger verifiable onchain workflows via Chainlink CRE with DON consensus + onchain settlement. Powered by Chainlink CRE and the x402 payment standard.

The Problem

AI agents increasingly need to call external services (APIs, LLMs, data feeds) autonomously. But there's no verifiable way to:

  1. Prove a service was actually executed
  2. Settle payments atomically with service delivery
  3. Attest to the result with decentralized consensus

The Solution

Praxion creates a verifiable execution layer where:

AI Agent → HTTP Request + x402 Payment Proof
  → CRE DON validates payment & executes service
  → DON consensus on the result
  → On-chain settlement with signed attestation
  → Agent receives DON-signed response

Every service call is:

  • Paid via x402 (HTTP 402 Payment Required standard with stablecoin payments)
  • Executed by Chainlink's Decentralized Oracle Network (DON)
  • Verified through multi-node consensus
  • Settled on-chain with a DON-signed report

Architecture

CRE Workflow (workflow/)

A TypeScript workflow deployed to Chainlink's DON:

  1. HTTP Trigger — Receives requests from AI agents
  2. x402 Validation — Verifies payment proof from headers
  3. Service Execution — Calls the requested API via HTTPClient with DON consensus
  4. Report Generation — Creates a DON-signed attestation of the result
  5. On-chain Settlement — Writes to PraxionSettlement via EVMClient.writeReport()

Smart Contract (contracts/)

PraxionSettlement.sol — Extends Chainlink's ReceiverTemplate:

  • Receives DON-signed reports via the Chainlink Forwarder
  • Records: agent address, service hash, payment amount, result hash, timestamp
  • Emits ServiceExecuted and PaymentSettled events
  • Provides on-chain proof of every agent-service interaction

x402 Payment Flow

Agent                    CRE DON                  Settlement Contract
  │                        │                              │
  ├─ POST /service ───────►│                              │
  │  + X-PAYMENT header    │                              │
  │  + intent body         │                              │
  │                        ├─ Validate payment            │
  │                        ├─ Execute service (consensus) │
  │                        ├─ Sign report ────────────────►│
  │                        │                              ├─ Record settlement
  │◄─ DON-signed result ──┤                              │
  │  + settlement txHash   │                              │

Quick Start

Prerequisites

Smart Contracts

cd contracts
forge install
forge test

Workflow

cd workflow
bun install
npx tsc --noEmit  # Type-check

# Simulate locally
cre workflow simulate --config config.staging.json

# Deploy to DON
cre login
cre workflow deploy --config config.staging.json

Deploy Contract

Deploy PraxionSettlement to Sepolia with the Chainlink Forwarder address:

forge create src/PraxionSettlement.sol:PraxionSettlement \
  --constructor-args 0x15fc6ae953e024d975e77382eeec56a9101f9f88 \
  --rpc-url $SEPOLIA_RPC \
  --private-key $PRIVATE_KEY

Then update workflow/config.staging.json with the deployed address.

Project Structure

├── README.md
├── workflow/                    # CRE TypeScript workflow
│   ├── main.ts                 # Entry point: HTTP trigger → handler
│   ├── agentCallback.ts        # Core logic: validate, execute, settle
│   ├── x402.ts                 # x402 payment parsing & validation
│   ├── config.staging.json     # Sepolia testnet config
│   ├── package.json
│   └── tsconfig.json
├── contracts/                   # Foundry smart contracts
│   ├── src/
│   │   ├── PraxionSettlement.sol      # Settlement contract
│   │   └── interfaces/
│   │       ├── IReceiver.sol            # CRE receiver interface
│   │       └── ReceiverTemplate.sol     # Base template with security
│   ├── test/
│   │   └── PraxionSettlement.t.sol    # 10 passing tests
│   └── foundry.toml

Supported Services

The workflow currently supports:

Service Description Params
price-feed Crypto price data coin, currency
market-data Detailed market info coin
Custom Any HTTP endpoint url, method, body

Example Agent Request

{
  "payment": {
    "network": "ethereum-sepolia",
    "txHash": "0x...",
    "token": "0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238",
    "amount": "100000",
    "payer": "0xAgentAddress",
    "payee": "0xServiceProvider",
    "timestamp": 1708000000
  },
  "intent": {
    "service": "price-feed",
    "params": {
      "coin": "ethereum",
      "currency": "usd"
    }
  }
}

Key Technologies

  • Chainlink CRE — Decentralized compute with DON consensus
  • x402 — HTTP 402 Payment Required standard for machine payments
  • Praxion — The Execution Layer for Autonomous AI Agents

Demo — x402 Payment Flow

Run the full x402 payment flow locally on Base Sepolia:

1. Start the x402 Server

cd server
npm install
npx tsx src/index.ts

The server starts on http://localhost:4402 with x402-protected endpoints:

  • GET /health — Free health check
  • GET /price/:coin — Real-time price data ($0.001 USDC)
  • GET /analysis/:coin — Market analysis + signal ($0.001 USDC)

2. Run the Agent Client

In a new terminal, set your agent's private key (must have Base Sepolia USDC):

cd agent
npm install
AGENT_PRIVATE_KEY=0xYOUR_PRIVATE_KEY npx tsx src/index.ts

The agent will:

  1. Check server health (free)
  2. Request ETH price → gets 402 → auto-pays USDC → receives data
  3. Request BTC price → same flow
  4. Request ETH analysis → same flow

3. See It Onchain

Each paid request creates a real USDC transfer on Base Sepolia. Check:

How It Works

Agent                    Server                 Facilitator (x402.org)
  │                        │                          │
  │── GET /price/eth ─────►│                          │
  │◄── 402 + payment ─────│                          │
  │    requirements        │                          │
  │                        │                          │
  │── GET /price/eth ─────►│                          │
  │   + PAYMENT-SIGNATURE  │── verify ───────────────►│
  │                        │◄── valid ────────────────│
  │                        │                          │
  │◄── 200 + price data ──│                          │
  │   + PAYMENT-RESPONSE   │── settle ───────────────►│
  │                        │◄── tx hash ──────────────│

License

MIT

About

The Execution Layer for Autonomous AI Agents — Chainlink CRE + x402 payments

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages