Technical Report · ECOSUS CO., LTD. · TR-2026-008 EN JP TH
TR-2026-008

gyotak-x402

AI-Agent Round-Trip Settlement on Cardano — Preprod Evidence การชำระเงินไป-กลับโดย AI Agent บน Cardano — หลักฐานบน Preprod

A single order autonomously triggers on-chain payment and 100% cashback · Cardano Preprod · 2026-05-31 คำสั่งซื้อเดียวกระตุ้นการชำระเงินบนเชนและคืนเงิน 100% โดยอัตโนมัติ · Cardano Preprod · 31 พ.ค. 2569
Preprod Verifiedยืนยันบน Preprod แล้ว
Dateวันที่
May 31, 2026
Networkเครือข่าย
Cardano Preprod
Statusสถานะ
Finalฉบับสมบูรณ์
Classหมวดหมู่
Publicสาธารณะ
Abstract / 要旨 / บทคัดย่อ
This report documents the production deployment and on-chain verification of gyotak-x402, an AI-agent-driven round-trip settlement system on the Cardano network. Triggered by a single order through either the MCP endpoint or the LINE GYOTAK VIP order interface, the system autonomously (1) converts the order amount from THB to ADA, (2) executes an on-chain A→B payment, and (3) executes a sequential B→A 100% cashback. All transaction signing is performed server-side inside a Cloudflare Worker. Five settlement records (BB-5 to BB-9) were anchored on Cardano Preprod; the round-trip cases (BB-8, BB-9) confirmed exact 100% cashback, each wallet consuming only the 0.17 tADA network fee. The customer holds no wallet — GYOTAK's wallets act on their behalf.
รายงานนี้บันทึกการ deploy และการยืนยันบนเชนของ gyotak-x402 ระบบชำระเงินไป-กลับขับเคลื่อนด้วย AI agent บน Cardano จากคำสั่งซื้อเดียวผ่าน MCP หรือหน้าสั่งซื้อ LINE GYOTAK VIP ระบบจะ (1) แปลง THB เป็น ADA, (2) จ่าย A→B บนเชน, (3) คืนเงิน 100% B→A ตามลำดับ การเซ็นทั้งหมดทำฝั่งเซิร์ฟเวอร์ บันทึก 5 รายการ (BB-5 ถึง BB-9) บน Cardano Preprod กรณีไป-กลับ (BB-8, BB-9) ยืนยันคืนเงิน 100% พอดี ลูกค้าไม่ต้องมีกระเป๋าเงิน — กระเป๋าเงินของ GYOTAK ดำเนินการแทน

0. Background & Motivation 0. ที่มาและแรงจูงใจ

GYOTAK operates a sashimi-grade frozen-seafood supply chain in Thailand under a producer-owned model. The brand intentionally maintains no conventional consumer website; instead it exposes machine-readable interfaces — an MCP server, AEO endpoints, and an llms.txt manifest — enabling AI agents to discover, query, and order natively. This report addresses the subsequent capability: enabling an AI agent to execute payment on-chain on a customer's behalf. The design constraint is that the customer possesses no wallet, no key, and no blockchain literacy; settlement must therefore be fully delegated to server-controlled wallets. The 100% cashback described herein is a bounded promotional campaign for early VIP customers, funded as a capability demonstration rather than a recurring discount. Social-media cooperation by participants is handled as an off-chain agreement and is not enforced by the system. GYOTAK ดำเนินห่วงโซ่อุปทานอาหารทะเลแช่แข็งเกรดซาชิมิในไทยภายใต้โมเดลที่ผู้ผลิตเป็นเจ้าของ แบรนด์ตั้งใจไม่มีเว็บไซต์ผู้บริโภคแบบดั้งเดิม แต่เปิดอินเทอร์เฟซที่อ่านได้ด้วยเครื่อง — MCP server, AEO endpoints และ llms.txt — ให้ AI agent ค้นพบ สอบถาม และสั่งซื้อได้ รายงานนี้กล่าวถึงความสามารถถัดไป: ให้ AI agent ดำเนินการชำระเงินบนเชนแทนลูกค้า ข้อจำกัดการออกแบบคือลูกค้าไม่มีกระเป๋าเงิน กุญแจ หรือความรู้บล็อกเชน การชำระเงินจึงต้องมอบหมายให้กระเป๋าที่เซิร์ฟเวอร์ควบคุมทั้งหมด Cashback 100% เป็นแคมเปญส่งเสริมการขายแบบจำกัดสำหรับลูกค้า VIP รุ่นแรก เป็นการสาธิตความสามารถ การร่วมมือโซเชียลมีเดียเป็นข้อตกลงนอกเชน ระบบไม่บังคับ

1. System Architecture 1. สถาปัตยกรรมระบบ

Componentองค์ประกอบ Implementationการพัฒนา
Entry: MCP JSON-RPC place_order; AI agent calls directly; x402 gate bypassed (price 0); VIP (vipx402) auth retained JSON-RPC place_order; AI agent เรียกตรง; ข้าม x402 gate; คงการยืนยัน VIP
Entry: LINE GYOTAK VIP POST /gyotak/vip-order; human VIP order screen; settlement runs non-blocking via waitUntil POST /gyotak/vip-order; หน้าสั่งซื้อ VIP; ชำระเงินแบบ non-blocking ผ่าน waitUntil
Signingการเซ็น Cardano Serialization Lib (WASM) inside the Worker; nodejs_compat + manual WASM init Cardano Serialization Lib (WASM) ใน Worker; nodejs_compat + manual WASM init
Chain I/O Koios Preprod — address_utxos (POST), submittx (POST), tip (GET)
Rateอัตรา D1-backed multi-source daily rate with hardcoded fallback (§5) อัตราหลายแหล่งผ่าน D1 พร้อม fallback (§5)
Key custodyการเก็บกุญแจ Wallet A & B private keys in Wrangler Secrets (preprod-only hot wallets) กุญแจ A & B ใน Wrangler Secrets (hot wallet เฉพาะ preprod)

2. Round-Trip Settlement Flow 2. ขั้นตอนการชำระเงินไป-กลับ

Both wallets (A, B) belong to GYOTAK. The A→B transaction represents the customer's payment; the B→A transaction returns the full amount as the 100% cashback. The cashback executes sequentially — strictly after the A→B transaction completes — to prevent UTXO double-spend on wallet B. If the cashback step fails, the payment and the order remain valid; the failure is recorded independently and does not block order completion. กระเป๋าทั้งสอง (A, B) เป็นของ GYOTAK A→B คือการจ่ายของลูกค้า B→A คืนเต็มจำนวนเป็น cashback 100% การคืนเงินทำตามลำดับหลัง A→B เสร็จ เพื่อป้องกัน double-spend หาก cashback ล้มเหลว การจ่ายและคำสั่งซื้อยังคงอยู่

3. On-Chain Settlement Records 3. บันทึกบนเชน

Five settlement attempts were anchored on Cardano Preprod on 2026-05-31, demonstrating progressive capability: one-way payment, real-time rate, an honestly recorded failure, and two full round-trips. 31 พ.ค. 2569 บันทึก 5 รายการบน Cardano Preprod แสดงความสามารถที่พัฒนาขึ้น

Order Entryทาง THB ADA Rateอัตรา A→B B→A Resultผล
BB-5MCP10012.997816 fixedคงที่ 3491fd71…0a PAID
BB-6MCP10012.980290 real-timeเรียลไทม์ 10b0b03e…46 PAID
BB-7MCP100 Binance 451 FAILED
BB-8MCP10012.997816 fixedคงที่ 0986e19b…c8 e05f7805…a8 ROUND-TRIP
BB-9MCP10013.152398 D1 live 9b9abe68…5b 1fa1e4e0…4e ROUND-TRIP
On BB-7 (recorded failure): a rate-source outage (Binance HTTP 451 from the Worker's edge) caused this attempt to fail. It is kept on record — not hidden — consistent with the GYOTAK principle that failures must also be inscribed. This directly motivated the multi-source rate design in §5. BB-7 (ความล้มเหลวที่บันทึก): เหตุขัดข้องของแหล่งอัตรา (Binance 451) ทำให้ล้มเหลว เก็บไว้ในบันทึก ไม่ซ่อน ตามหลักการ "บันทึกความล้มเหลวด้วย"

4. Round-Trip Verification (BB-8) 4. การตรวจสอบไป-กลับ (BB-8)

The flagship round-trip. Both transactions were included in the same block (4,772,517); balance deltas confirm an exact 100% cashback. บันทึกไป-กลับหลัก ทั้งสองธุรกรรมอยู่ในบล็อกเดียวกัน (4,772,517) ยืนยันคืนเงิน 100% พอดี

Wallet Baselineก่อน (tADA) Afterหลัง (tADA) Δ Breakdownรายละเอียด
A 9,894.795062 9,894.625062 −0.170000 −12.997816 +12.997816 −0.17 fee
B 104.354938 104.184938 −0.170000 +12.997816 −12.997816 −0.17 fee

Each wallet consumed only the 0.17 tADA network fee; the full 12.997816 ADA returned to the customer — a true 100% cashback. Because wallet B was pre-funded with its own tADA reserve, it returned the full received amount while paying its own fee. แต่ละกระเป๋าใช้เพียงค่าธรรมเนียม 0.17 tADA ยอดเต็ม 12.997816 ADA คืนสู่ลูกค้า — cashback 100% จริง กระเป๋า B มีเงินสำรองอยู่แล้วจึงจ่ายค่าธรรมเนียมเองและคืนยอดเต็ม

5. Multi-Source Rate with D1 Fallback 5. อัตราหลายแหล่งพร้อม D1 Fallback

Direct per-order calls to public rate APIs proved unreliable from Cloudflare Workers — CoinGecko returns 403 and Binance returns 451 depending on the variable edge location a request egresses from (the cause of BB-7). The fix decouples acquisition from consumption. การเรียก API อัตราโดยตรงไม่เสถียรจาก Workers — CoinGecko 403, Binance 451 ขึ้นกับ edge location วิธีแก้คือแยกการดึงออกจากการใช้งาน

// Daily (cron, once/day) — store whatever succeeds into D1
async fetchAndStoreExchangeRates(db):
  thb_usd = frankfurter()                       // stable from Workers
  ada_usd = binance() ?? coinbase() ?? kraken() // multi-source fallback
  if (both ok) INSERT INTO gyotak_exchange_rates // else keep prior row

// Per-order — read latest D1 row, never hit an external API
async thbToAda(thb, db):
  row = SELECT ... ORDER BY id DESC LIMIT 1
  (ada_usd, thb_usd) = row ?? FALLBACK(0.236, 32.6) // hardcoded last resort
  usd = thb / thb_usd;  ada = usd / ada_usd

Three layers: (1) D1's latest daily-fetched row; (2) if a daily fetch fails, the prior row persists and the system keeps running on the last good rate; (3) a hardcoded fallback if D1 is empty. BB-9 confirmed live D1 rates: 100 ÷ 32.52 ÷ 0.2338 = 13.152398 ADA — distinct from the fallback's 12.997816. สามชั้น: (1) แถวล่าสุดใน D1, (2) ถ้าดึงล้มเหลวใช้แถวก่อน, (3) fallback ฮาร์ดโค้ด BB-9 ยืนยันอัตราสด: 13.152398 ADA

6. Claimed Technical Novelty 6. ความใหม่ทางเทคนิค

  1. Walletless agent-mediated settlement: the customer holds no wallet and signs nothing. Identity is established by LINE ID; GYOTAK's server-held wallets execute payment on their behalf.
  2. Server-side Cardano signing inside an edge Worker: full transaction construction and Ed25519 signing run inside a Cloudflare Worker via WASM, with no external signing service.
  3. Order-triggered round-trip: a single order autonomously triggers payment and 100% cashback as a sequenced pair, both anchored on-chain.
  4. Sequential double-spend safety: B→A strictly awaits A→B completion, preventing concurrent UTXO contention on the shared wallet.
  5. Decoupled rate oracle with persistence fallback: daily multi-source acquisition into D1 isolates settlement from per-request, edge-dependent API failures.
  1. ウォレットレスのエージェント代行決済:顧客はウォレットを持たず署名もしない。本人性はLINE IDで確立し、GYOTAKのサーバー保有ウォレットが顧客に代わって決済する。
  2. エッジWorker内サーバーサイドCardano署名:トランザクション構築とEd25519署名を外部署名サービスなしでWorker内WASMで完結。
  3. 注文起点の往復:単一注文が支払いと100%キャッシュバックを直列ペアとして自律実行し、両者をオンチェーンに記録する。
  4. 直列による二重消費安全性:B→AはA→B完了を厳密に待ち、共有ウォレットのUTXO競合を防ぐ。
  5. 永続化フォールバック付き分離レートオラクル:日次多層取得をD1に貯め、決済をリクエスト毎のエッジ依存API障害から隔離する。
  1. การชำระเงินผ่าน agent แบบไร้กระเป๋า: ลูกค้าไม่มีกระเป๋าและไม่เซ็น ระบุตัวตนด้วย LINE ID กระเป๋าของ GYOTAK ดำเนินการแทน
  2. การเซ็น Cardano ฝั่งเซิร์ฟเวอร์ใน edge Worker: สร้างธุรกรรมและเซ็น Ed25519 ผ่าน WASM ใน Cloudflare Worker
  3. ไป-กลับจากคำสั่งซื้อเดียว: คำสั่งเดียวกระตุ้นจ่ายและคืน 100% ตามลำดับ ทั้งคู่บันทึกบนเชน
  4. ความปลอดภัย double-spend แบบลำดับ: B→A รอ A→B เสร็จก่อน ป้องกันการแย่ง UTXO
  5. Rate oracle แยกพร้อม fallback: ดึงหลายแหล่งรายวันลง D1 แยกการชำระเงินจากความล้มเหลวของ API ที่ขึ้นกับ edge

7. Design Philosophy 7. ปรัชญาการออกแบบ

"In the AI-agent era, a customer should be able to buy fish without ever touching a wallet, a key, or a chain — yet the proof that value moved should be permanent and public. The agent bears the complexity; the human keeps the simplicity."
"ในยุค AI agent ลูกค้าควรซื้อปลาได้โดยไม่ต้องแตะกระเป๋าเงิน กุญแจ หรือเชน — แต่หลักฐานว่ามูลค่าเคลื่อนไหวต้องถาวรและเปิดเผย agent แบกรับความซับซ้อน มนุษย์รักษาความเรียบง่าย"

8. GYOTAK Protocol Layers 8. GYOTAK Protocol Layers

Layer 1
gyotak-catch
Catch provenance ZKPZKP ที่มาปลา
✓ Mainnet
Layer 2
gyotak-temp-log
Storage temp + quick-freeze ZKPZKP อุณหภูมิ
✓ Preprod → Mainnet
Layer 3
gyotak-ratio-log
Formula ratio compliance ZKPZKP สัดส่วนสูตร
✓ Preprod
Settlement
gyotak-x402
AI-agent round-trip settlement (this report)การชำระเงินไป-กลับ (รายงานนี้)
✓ Preprod · Cardano
Layer 4+
gyotak-transit
Transport route verificationการยืนยันเส้นทาง
Plannedวางแผน

The ZKP layers (1–3) prove the value of the product itself on Midnight; the settlement layer proves the movement of value on Cardano. Two complementary chains — one continuum from provenance to payment. ZKP layers (1–3) พิสูจน์คุณค่าของตัวสินค้าบน Midnight; settlement layer พิสูจน์การเคลื่อนมูลค่าบน Cardano สองเชนเสริมกัน — จากแหล่งกำเนิดถึงการชำระเงิน

9. Archive Metadata 9. Metadata

Fieldฟิลด์ Valueค่า
Document IDECOSUS-TR-2026-008
Prior Reportรายงานก่อน TR-2026-007 · gyotak-ratio-log Preprod
Authorผู้เขียน Takuya Ogura, Chairman, ECOSUS CO., LTD.
Organizationองค์กร ECOSUS CO., LTD. · 0205562030631 · Pranburi, Thailand
Report dateวันที่ May 31, 2026
NetworkCardano Preprod
Round-trip TX (BB-8) A→B 0986e19b7bfe628c448d176a752319a740658887797b923a48026dad0a1e3cc8
B→A e05f7805d5b3962589144102ac7c7bb04d0383e08b12d91c84ece8f883a211a8
block 4,772,517 · preprod.cexplorer.io/tx/
Licenseใบอนุญาต CC BY 4.0