Skip to content

0x-xrpl/clauthify

Repository files navigation

日本語 · English

Clauthify

Before AI pays, we authify.

One checkpoint before AI-driven payments move.


Overview

Clauthify は、AI Agent が支払い・スワップ・エスクロー・外部トランザクションを実行する前に入る pre-payment approval and proof layer です。

AIが自律的に決済を進める前に、Clauthify が一度その intent を受け取り、誰が実行しようとしているのかを確認し、必要に応じて Human Override を要求し、承認されたルートだけを準備し、最後に Proof Receipt を生成します。

Clauthify は、OpenClaw / ISEAI のような Agent runtime に接続できる Agent Skill SDK direction として設計されています。
現在の実装は、スタンドアロンで動作する TypeScript MVP であり、adapter-based route preparation、testnet / devnet integration、Human Badge verifier-ready path、安全な fallback mode を備えています。

OpenClaw / ISEAI の managed runtime 連携は、管理画面アクセスが利用可能になり次第接続できる設計です。


Why “Clauthify”?

The name Clauthify combines Claw, Auth, and -ify.

  • Claw connects to OpenClaw and autonomous agent execution.
  • Auth refers to authentication, authorization, and human approval.
  • -ify means turning something into a verified state.

Together, Clauthify means turning sensitive AI agent actions into human-approved, verifiable actions.

Claw gives agents power.
Auth gives humans control.
-ify turns approval into proof.


Core Flow

AI payment intent
→ Human Badge check
→ actor classification
→ policy decision
→ Human Override if needed
→ route preparation
→ Proof Receipt

簡単に言うと:

AI wants to pay.
Clauthify stops it.
A human approves when required.
Only then a route is prepared.
A Proof Receipt is generated.

Problem

AI Agent は、決済、スワップ、エスクロー、外部API操作、オンチェーン操作などを自律的に実行できる方向へ進んでいます。

しかし、AIがそのまま決済ルートへ進めると、次のような問題が起きます。

  • 実行主体は人間なのか、AIなのか、botなのか
  • AIによる支払いをそのまま許可してよいのか
  • どのタイミングで人間の承認を要求すべきか
  • 承認されたことをどう証明するのか
  • 決済ルートへ進む前に、安全なチェックポイントを置けるのか

Clauthify はこの問題に対して、AI-driven payment の前段に verification / policy / approval / proof のゲートを置きます。


Solution

Clauthify は、AI-driven payment intent を安全な approval flow に変換します。

AI Agent が直接支払いへ進むのではなく、Clauthify が先に intent を受け取り、以下を行います。

  1. payment / swap / escrow intent を受け取る
  2. Human Badge / verifier state を確認する
  3. actor を分類する
  4. policy を判定する
  5. 必要なら Human Override を要求する
  6. approved route を準備する
  7. Proof Receipt を生成する

これにより、AI-powered payment workflow に対して、軽量で監査可能なチェックポイントを提供します。


Technical Stack

Layer Technology / Direction
Language TypeScript
Runtime Node.js
Demo runner tsx
Package manager npm
Architecture Adapter-based route preparation
Verification layer Human Badge-style adapter, World verifier-ready path
Policy layer Actor classification + policy decision + Human Override
Receipt layer Proof Receipt JSON output
XRPL integration XRPL Testnet payment / escrow prepare and execute path
Jupiter integration Quote + swap transaction preparation
Sui integration Sui Move package + Sui devnet ProofReceipt object
NEAR / IronClaw direction Secure-runtime-ready metadata and receipt path
OpenClaw / ISEAI direction Agent Skill SDK positioning
UI direction Minimal presentation-ready approval dashboard

Architecture

Clauthify は、小さな adapter-based architecture で構成されています。

PaymentIntent
→ HumanBadge Adapter
→ Actor Classification
→ Policy Engine
→ Human Override
→ Route Adapter
→ Proof Receipt

Adapter layout

src/
  index.ts
  types.ts
  adapters/
    humanBadge.ts
    xrpl.ts
    jupiter.ts
    suiProof.ts
    nearRuntime.ts

Contract / docs layout

contracts/
  sui-proof/
  near-runtime-receipt/

docs/
  iseai-openclaw.md
  sui-devnet.md
  near-ironclaw.md
  near-testnet.md
  jupiter-route.md
  xrpl-testnet.md
  world-id.md
  maglab.md

Main Concepts

Payment Intent

Payment Intent は、AI Agent、人間、または不明な actor が「何をしようとしているか」を表す入力です。

Example:

{
  "id": "ai_002",
  "actorHint": "ai",
  "amount": 10,
  "asset": "USDC",
  "purpose": "agent payment"
}

Actor Classification

Clauthify は actor を以下のように分類します。

Actor Type Meaning
verified_human Human Badge state が通った人間扱いの actor
ai_agent AI-driven actor。より厳しい policy が必要
unknown_bot 不明またはブロック対象の automation

Policy Decision

Policy output は以下の3つです。

Policy Meaning
allow route preparation に進める
require_human_override AI action を一時停止し、人間承認を要求する
block route を拒否する

Human Override

AI Agent の支払い intent は、必要に応じて一度 pause されます。
人間が approve した場合のみ、route preparation に進みます。


Proof Receipt

Proof Receipt は、Clauthify の最終出力です。

以下を記録します。

  • 誰が実行しようとしたか
  • Human Badge state
  • policy decision
  • Human Override の状態
  • 使用された route adapter
  • route が prepared / executed / paused / rejected のどれか

Integration Status

Integration Current State
XRPL Testnet prepare / execute path with tx hash
Jupiter Quote + swap_tx prepared, no signing / no send
Sui Real devnet ProofReceipt object created and recorded
NEAR / IronClaw Execution-ready secure runtime metadata prepared
World / Human Badge World ID 4.0 Human Badge flow with backend verification and nullifier duplicate-use protection in apps/world-id-ui
ISEAI / OpenClaw Agent Skill SDK direction prepared for managed runtime use
MAGLAB Future fit checkpoint

Current State

  • 7 demo scenarios run with npm run demo
  • Human Badge supports:
    • mock
    • external_mock
    • world_verify_ready
  • Separate World ID 4.0 Human Badge UI/API exists under apps/world-id-ui
  • World ID UI/API binds proof to Clauthify payment intent with:
    • signal = clauthify:<intentId>
  • World ID UI/API includes:
    • backend RP signature endpoint
    • server-side signing key only
    • backend verify forward to POST /api/v4/verify/{rp_id}
  • verifierStatus becomes verified only after successful v4 verification
  • proof_missing, failed, and duplicate states are preserved
  • demo-grade file-based nullifier persistence protects duplicate use for the same protected action
  • allow_legacy_proofs is currently enabled for migration safety
  • production deployment should replace file storage with durable database storage
  • XRPL supports:
    • mock
    • testnet prepare
    • testnet execute with safety confirmation
  • Jupiter supports:
    • mock
    • quote mode
    • swap transaction preparation mode
  • Sui supports:
    • proof_only
    • devnet_ready
    • devnet_object_ready
    • devnet_object_created
  • Sui Move package exists in contracts/sui-proof
  • sui move build succeeded locally
  • Sui devnet publish succeeded
  • Sui devnet ProofReceipt object creation succeeded
  • NEAR / IronClaw supports:
    • proof_only
    • execution_ready
    • secure_runtime_ready
    • testnet_receipt_recorded
  • contracts/near-runtime-receipt exists
  • docs/near-testnet.md exists
  • Local IronClaw execution remains a runtime path
  • ISEAI setup has been started
  • OpenClaw managed dashboard access can be connected once available

Route Modes / Integration Modes

Layer Modes / Status State
Human Badge mock, external_mock, world_verify_ready Implemented
World Verify /api/v4/verify/{rp_id} path, WORLD_PROOF_JSON support, separate World ID 4.0 Human Badge flow in apps/world-id-ui Backend verification + duplicate protection
XRPL mock, testnet prepare, testnet execute Implemented
Jupiter mock, quote, swap_tx Implemented, no signing or send
Sui proof_only, devnet_ready, devnet_object_ready, devnet_object_created Implemented, real devnet object recorded
NEAR / IronClaw proof_only, execution_ready, secure_runtime_ready, testnet_receipt_recorded Implemented as metadata / receipt path
OpenClaw / ISEAI Agent Skill SDK positioning Prepared for managed runtime
MAGLAB Context checkpoint Future fit

Implementation Highlights

Confirmed in current MVP

  • XRPL testnet prepare / execute path
  • Jupiter quote path
  • Jupiter swap transaction preparation path
  • Sui Move package build
  • Sui devnet package publish
  • Sui devnet ProofReceipt object creation
  • Clauthify recording of created Sui devnet object in demo output
  • NEAR / IronClaw execution-ready metadata output
  • Human Badge verifier-ready path
  • ISEAI / OpenClaw Agent Skill SDK direction

Update paths

  • World / Human Badge can move from proof-pending to verified when a real proof payload is provided through WORLD_PROOF_JSON / IDKit flow
  • apps/world-id-ui can move Human Badge from proof-pending to verified through a World ID 4.0 RP-signature + v4 verify flow with nullifier duplicate-use protection
  • OpenClaw / ISEAI managed runtime can be connected once dashboard access is available
  • NEAR / IronClaw can be extended from execution-ready metadata to runtime execution
  • UI can present the full approval flow as a dashboard

Demo Scenarios

The default demo contains 7 scenarios:

  1. Verified human payment
  2. AI agent payment without override
  3. AI agent payment with override
  4. Unknown bot
  5. Human payment requiring Jupiter route
  6. Sui ProofReceipt route
  7. NEAR / IronClaw runtime route

Installation

npm install

Run

Default demo:

npm run demo

Human Badge / World

Human Badge is implemented as a verifier-style adapter with three modes.

Mock mode

Default local behavior:

npm run demo

External mock mode

HUMAN_BADGE_MODE=external_mock npm run demo

This produces verifier-style metadata for demo flows.

World verifier-ready mode

HUMAN_BADGE_MODE=world_verify_ready \
WORLD_RP_ID='your_rp_id' \
npm run demo

This mode keeps the World / Human Badge verification path ready for a real proof flow.

In the current demo, if no proof payload is provided, Clauthify keeps the flow in a verifier-ready state and marks the proof as pending instead of claiming a completed verification.

Expected status without proof:

verifierStatus: proof_missing

World verifier-ready mode with proof payload

HUMAN_BADGE_MODE=world_verify_ready \
WORLD_RP_ID='your_rp_id' \
WORLD_ACTION='clauthify_payment_approval' \
WORLD_SIGNAL='clauthify_demo' \
WORLD_PROOF_JSON='{"proof":"<proof>","nullifier_hash":"<nullifier_hash>","merkle_root":"<root>","verification_level":"orb"}' \
npm run demo

When a real proof payload is added later and accepted by the verification flow, this mode can move from proof-pending to verified.

World ID 4.0 Human Badge UI/API

A separate World ID 4.0 Human Badge UI/API exists under apps/world-id-ui.

Current status:

  • uses IDKit proof collection in a separate app
  • binds proof to Clauthify payment intent with signal = clauthify:<intentId>
  • generates RP signatures on the backend only
  • keeps the RP signing key server-side only
  • forwards the IDKit result payload as-is to POST /api/v4/verify/{rp_id}
  • returns verified only after successful v4 verification
  • preserves proof_missing, failed, and duplicate fallback states
  • stores verified nullifiers in a demo-grade file-based server-side store
  • rejects duplicate use of the same nullifier for the same protected Clauthify action
  • keeps allow_legacy_proofs enabled for migration safety
  • should use durable database storage instead of file storage in production
  • does not change the root TypeScript MVP
  • does not change npm run demo

Human Badge status

World / Human Badge:
Verifier-ready path implemented.
Proof-pending state is supported.
The flow can be extended with WORLD_PROOF_JSON / IDKit when a real proof is available.

See also:

  • apps/world-id-ui/WORLD_ID_4_STATUS.md

XRPL

XRPL is implemented as a testnet payment / escrow route adapter with mock fallback.

XRPL testnet prepare

XRPL_ROUTE_MODE=testnet \
XRPL_TESTNET_SECRET='your_testnet_secret' \
XRPL_TESTNET_ADDRESS='your_testnet_address' \
XRPL_TESTNET_DESTINATION='destination_testnet_address' \
npm run demo

XRPL testnet execute

XRPL_ROUTE_MODE=testnet \
XRPL_TESTNET_SECRET='your_testnet_secret' \
XRPL_TESTNET_ADDRESS='your_testnet_address' \
XRPL_TESTNET_DESTINATION='destination_testnet_address' \
XRPL_TESTNET_EXECUTE=true \
XRPL_CONFIRM_EXECUTE=YES \
npm run demo

XRPL execution is safety-gated and testnet-only.

Safety gates

XRPL execute requires:

XRPL_TESTNET_EXECUTE=true
XRPL_CONFIRM_EXECUTE=YES

Jupiter

Jupiter is implemented as a quote and swap transaction preparation adapter.

Jupiter quote

JUPITER_ROUTE_MODE=quote npm run demo

Jupiter swap transaction preparation

JUPITER_ROUTE_MODE=swap_tx \
JUPITER_USER_PUBLIC_KEY='your_solana_public_key' \
npm run demo

Jupiter swap_tx mode prepares a swap transaction only.

It does not:

  • sign a transaction
  • send a transaction
  • require a private key
  • move funds

Expected status:

routeMode: swap_tx
receipt.status: prepared

Sui

Sui is implemented as a proof layer with a real devnet ProofReceipt object recorded by Clauthify.

Sui devnet object created

SUI_PROOF_MODE=devnet_object_created \
SUI_PACKAGE_ID=0x138fd6c97b11c46b6c5729e15b3e60fc8f92df10ee489bc55f9d458f867218a7 \
SUI_PROOF_OBJECT_ID=0xf13ee20038c28c9b9075129620dc46a98193258b4876d4eb96577334f9a35649 \
SUI_TX_DIGEST=A2YwqavSXo5XxvHRjwiVPnVsiprZpN9NtcL9hkbCCRZw \
npm run demo

Confirmed Sui devnet result

  • PackageID=0x138fd6c97b11c46b6c5729e15b3e60fc8f92df10ee489bc55f9d458f867218a7
  • Module=proof_receipt
  • ObjectType=0x138fd6c97b11c46b6c5729e15b3e60fc8f92df10ee489bc55f9d458f867218a7::proof_receipt::ProofReceipt
  • ProofReceipt ObjectID=0xf13ee20038c28c9b9075129620dc46a98193258b4876d4eb96577334f9a35649
  • Transaction Digest=A2YwqavSXo5XxvHRjwiVPnVsiprZpN9NtcL9hkbCCRZw

Sui status

Sui:
Real devnet ProofReceipt object created and recorded.

NEAR / IronClaw

NEAR / IronClaw is implemented as a secure-runtime-ready metadata and receipt path.

Execution-ready metadata

NEAR_IRONCLAW_MODE=execution_ready npm run demo

This produces IronClaw / NEAR secure runtime metadata such as:

{
  "runtime": "ironclaw",
  "network": "near_ai_or_near_testnet",
  "execution": "not_executed_locally",
  "clauthifyRole": "pre-payment policy and proof receipt gate"
}

NEAR secure runtime ready

NEAR_RUNTIME_MODE=secure_runtime_ready npm run demo

NEAR testnet receipt recorded

NEAR_RUNTIME_MODE=testnet_receipt_recorded \
NEAR_CONTRACT_ID='your-contract.testnet' \
NEAR_TX_HASH='your_tx_hash' \
NEAR_RECEIPT_ID='near_receipt_demo_001' \
npm run demo

NEAR / IronClaw status

NEAR / IronClaw:
Execution-ready secure runtime metadata prepared.
The current demo keeps local IronClaw execution as a future runtime path.

ISEAI / OpenClaw Direction

Clauthify is prepared as an OpenClaw / ISEAI Agent Skill SDK direction.

Expected agent behavior:

When a payment, swap, escrow, or AI-driven transaction is requested,
do not execute it directly.

First call Clauthify.

Check the Proof Receipt.
Only continue if the receipt allows it.
If human override is required, pause and ask the human.

Current state:

ISEAI / OpenClaw:
Agent Skill SDK direction prepared for managed AI agent workflows.
Managed runtime access can be connected once the dashboard environment is available.

Proof Receipt Example

AI agent payment without approval:

{
  "receipt": {
    "actorType": "ai_agent",
    "policy": "require_human_override",
    "overrideStatus": "pending",
    "route": "xrpl_escrow",
    "adapter": "xrpl",
    "routeMode": "mock",
    "status": "paused"
  }
}

After human approval:

{
  "receipt": {
    "actorType": "ai_agent",
    "policy": "require_human_override",
    "overrideStatus": "approved",
    "route": "xrpl_escrow",
    "adapter": "xrpl",
    "routeMode": "testnet",
    "status": "prepared"
  }
}

Jupiter quote / swap transaction preparation:

{
  "receipt": {
    "actorType": "verified_human",
    "policy": "allow",
    "overrideStatus": "not_required",
    "route": "jupiter_route",
    "adapter": "jupiter",
    "routeMode": "quote",
    "status": "prepared"
  }
}

NEAR / IronClaw execution-ready metadata:

{
  "route": {
    "adapter": "near_runtime",
    "routeMode": "proof_only",
    "status": "prepared"
  },
  "receipt": {
    "status": "prepared"
  }
}

UI Demo Direction

A minimal UI should show the full Clauthify flow:

AI payment intent
→ Clauthify intercepts
→ Human Badge check
→ Policy Engine
→ Human Override
→ Route Preparation
→ Proof Receipt

Recommended UI screens:

  1. Dashboard / Integration Status
  2. Payment Intent Review
  3. Human Badge + Policy Check
  4. Human Override Approval
  5. Route Preparation
  6. Proof Receipt Output

UI rules

  • Show Human Badge as Verifier-ready / Proof pending when no real World proof is provided
  • Do not show World verified unless verifierStatus is actually verified
  • Show NEAR / IronClaw as Execution-ready metadata / runtime path
  • Show Jupiter as swap_tx prepared / no signing / no send
  • Show Sui as devnet ProofReceipt object recorded

UI Copy

Hero:

Before AI pays, we authify.

Subcopy:

Clauthify intercepts AI payment intent before execution, requires human approval when needed, prepares safe routes, and emits a Proof Receipt.

Flow copy:

AI wants to pay.
Clauthify stops it.
A human approves.
Only then the route is prepared.
A Proof Receipt is generated.

Integration card copy:

XRPL:
Testnet payment / escrow route.
Tx hash ready.

Jupiter:
Quote + swap transaction prepared.
No signing / no send.

Sui:
Devnet ProofReceipt object recorded.

NEAR / IronClaw:
Execution-ready secure runtime metadata.

World / Human Badge:
Verifier-ready.
Proof-pending state supported.

ISEAI / OpenClaw:
Agent Skill SDK direction prepared.
Managed runtime path.

Safety

  • .env is ignored
  • Never commit secrets
  • No mainnet execution
  • No private keys in source code
  • No real secrets in .env.example
  • XRPL execute is gated by:
    • XRPL_TESTNET_EXECUTE=true
    • XRPL_CONFIRM_EXECUTE=YES
  • Jupiter swap_tx does not sign
  • Jupiter swap_tx does not send
  • World proof payloads should not be committed
  • World ID RP signing keys must remain server-side only
  • apps/world-id-ui is World ID 4.0-ready, but verified state is only returned after successful v4 verification
  • apps/world-id-ui uses demo-grade file-based nullifier persistence; production should replace it with durable database storage
  • NEAR / IronClaw runtime execution is kept as an extension path
  • OpenClaw / ISEAI managed runtime integration can be connected once access is available

Ecosystem Coverage

Ecosystem Clauthify Role
XRPL Testnet payment / escrow route
Jupiter Quote and swap transaction preparation
Sui Proof layer with real devnet ProofReceipt object
World / Human Badge Verifier-ready human approval path
NEAR / IronClaw Secure runtime envelope and policy-bound agent execution path
ISEAI / OpenClaw Agent Skill SDK direction for managed AI agent workflows
MAGLAB Future fit checkpoint

Related Docs


Final Status Summary

Layer Current State
XRPL Testnet prepare / execute path with tx hash
Jupiter Quote + swap_tx prepared, no signing / no send
Sui Devnet ProofReceipt object created and recorded
NEAR / IronClaw Execution-ready secure runtime metadata prepared
World / Human Badge World ID 4.0 Human Badge flow with backend verification and nullifier duplicate-use protection under apps/world-id-ui
ISEAI / OpenClaw Agent Skill SDK direction prepared for managed runtime use
MAGLAB Future fit checkpoint

Closing

Clauthify adds a human approval and proof checkpoint before AI-driven payments move.

It does not try to replace wallets or payment rails.
It verifies intent before any payment route is prepared.

Before AI pays, we authify.

About

Before AI pays, we authify.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors