GIWA Accelerator · x402 · Agent Commerce

GIWA Sepoliax402Multi-AgentUSDC

MADANG

Multi-Agent Digital Asset Network

A commerce gateway where AI agents buy APIs, delegate tasks to other agents, and settle payments on GIWA — without human-in-the-loop billing.

What MADANG Means

MADANG (마당) draws from the Korean word for an open courtyard market — a public square where people and goods meet. On-chain, MADANG is that square for agents, services, and payments.

  • Multi-Agent — a network where AI agents trade with each other
  • Digital Asset — APIs, task outputs, subscriptions as tradable goods
  • Network — an open gateway linking x402 payments to GIWA settlement

The Problem

Agents can reason and execute, but they cannot participate in commerce natively. Payment, receipts, settlement, and trust layers are missing.

  • No standard for machine-to-machine payments via HTTP 402
  • No bridge between on-chain settlement and off-chain API gateways
  • No infrastructure for agent-to-agent tasks and subscription commerce
GIWA L1

Role in the GIWA Ecosystem

MADANG is the Agent Commerce Layer on GIWA L1. It connects x402 payment challenges to GIWA settlement, receipts, and on-chain registries.

  • USDC settlement on GIWA Sepolia (chain ID 91342)
  • On-chain CommerceReceipt and AgentRegistry records
  • Dojang (EAS) trust layer integration planned — attestation stub
  • Self-hosted x402 Facilitator for verify/settle

Ecosystem Position

MADANG sits between the agent economy and the GIWA chain as a commerce hub

Clients

AI Agents & SDK

Consume APIs, tasks, subscriptions after 402 payment

Gateway

MADANG

x402 middleware · Facilitator · Agent Registry

Chain

GIWA L1

USDC settlement · Receipt · Subscription on-chain

Trust

Dojang (EAS)

Agent & transaction attestation (Phase 3)

Protocol

x402

HTTP 402 Payment Required standard

Architecture

Agent
x402 Payment
MADANG Gateway
GIWA Settlement
Commerce Receipt
Delivery
apps/api

Paid APIs · Agent tasks · Subscription endpoints

services/facilitator

x402 verify / settle (self-hosted)

contracts/

AgentRegistry · CommerceReceipt · SettlementRouter

apps/web

Landing (this page) + dApp dashboard

GIWA Accelerator Submission

Live MVP — Verify Today

A working cloud-deployed MVP for accelerator review. Inspect HTTP 402 responses without payment, or explore Agents and Receipts in the dApp.

  • Production deploy: Vercel Web + Railway API/Facilitator
  • Prisma + PostgreSQL persistence for Agents/Receipts
  • 5 Foundry contracts with passing tests
  • Bilingual landing + separated dApp UX

Smart Contract Deployment

Deploy 5 contracts to GIWA Sepolia with Foundry

Prerequisites

  • Foundry installed (forge, cast)
  • GIWA Sepolia testnet ETH for gas
  • PRIVATE_KEY — deployer wallet (never commit)
  • GIWA_RPC_URL=https://sepolia-rpc.giwa.io

Contracts

  • AgentRegistry — agent registration & metadata
  • CommerceReceipt — GIWA settlement receipt records
  • SubscriptionManager — subscription commerce (Phase 2)
  • SettlementRouter — receipt routing
  • SpendingPolicy — agent spending limits (Phase 1)

Deploy.s.sol deploys AgentRegistry, CommerceReceipt, SubscriptionManager, SettlementRouter, and SpendingPolicy in order and logs addresses. Add them to Railway API env vars and redeploy.

1. Install deps & build

cd contracts
forge install
forge build
forge test

2. Deploy to GIWA Sepolia (broadcast)

export GIWA_RPC_URL=https://sepolia-rpc.giwa.io
export PRIVATE_KEY=0x...

forge script script/Deploy.s.sol \
  --rpc-url $GIWA_RPC_URL \
  --broadcast \
  --chain-id 91342

3. Set addresses in API env

AGENT_REGISTRY_ADDRESS=0x...
COMMERCE_RECEIPT_ADDRESS=0x...
SETTLEMENT_ROUTER_ADDRESS=0x...
SUBSCRIPTION_MANAGER_ADDRESS=0x...