skills$openclaw/AGIRAILS Payments
unima3x1.7k

by unima3x

AGIRAILS Payments – OpenClaw Skill

AGIRAILS Payments is an OpenClaw Skills integration for coding workflows. Official ACTP (Agent Commerce Transaction Protocol) SDK — the first trustless payment layer for AI agents. Pay for services or receive payments through blockchain-secured USDC escrow on Base L2. Use when agent needs to make payments, receive payments, check transaction status, or handle disputes.

1.7k stars8.2k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

nameAGIRAILS Payments
descriptionOfficial ACTP (Agent Commerce Transaction Protocol) SDK — the first trustless payment layer for AI agents. Pay for services or receive payments through blockchain-secured USDC escrow on Base L2. Use when agent needs to make payments, receive payments, check transaction status, or handle disputes. OpenClaw Skills integration.
ownerunima3x
repositoryunima3x/agirails
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @unima3x/agirails
last updatedFeb 7, 2026

Maintainer

unima3x

unima3x

Maintains AGIRAILS Payments in the OpenClaw Skills directory.

View GitHub profile
File Explorer
22 files
.
examples
full-lifecycle.md
6.6 KB
simple-payment.md
6.4 KB
openclaw
agent-config.json
1.4 KB
cron-examples.json
2.8 KB
QUICKSTART.md
3.1 KB
security-checklist.md
4.0 KB
SOUL-provider.md
2.9 KB
SOUL-treasury.md
3.0 KB
validation-patterns.md
6.1 KB
references
provider-template.md
12.7 KB
requester-template.md
13.6 KB
state-machine.md
5.3 KB
scripts
setup.sh
4.0 KB
test-balance.ts
1.9 KB
test-purchase.ts
3.5 KB
_meta.json
278 B
README.md
3.1 KB
SKILL.md
10.9 KB
SKILL.md

name: AGIRAILS Payments version: 2.1.0 description: Official ACTP (Agent Commerce Transaction Protocol) SDK — the first trustless payment layer for AI agents. Pay for services or receive payments through blockchain-secured USDC escrow on Base L2. Use when agent needs to make payments, receive payments, check transaction status, or handle disputes. author: AGIRAILS Inc. homepage: https://agirails.io repository: https://github.com/agirails/openclaw-skill license: MIT tags:

  • payments
  • blockchain
  • escrow
  • agent-commerce
  • base-l2
  • usdc
  • web3 keywords:
  • AI agent payments
  • trustless escrow
  • ACTP protocol
  • agent-to-agent commerce
  • USDC payments metadata: openclaw: emoji: "💸" minVersion: "1.0.0" requires: env: - AGENT_PRIVATE_KEY - AGENT_ADDRESS

AGIRAILS — Trustless Payments for AI Agents

Enable your AI agent to pay for services or receive payments through blockchain-secured USDC escrow on Base L2.

🚀 Quick Start

Just say: "Pay 10 USDC to 0xProvider for translation service"

The agent will:

  1. Initialize ACTP client
  2. Create transaction with escrow
  3. Track state through completion
  4. Handle disputes if needed

Prerequisites

RequirementCheckInstall
Node.js 18+node --versionnodejs.org
Private Keyecho $AGENT_PRIVATE_KEYExport wallet key
USDC BalanceCheck walletBridge USDC to Base via bridge.base.org

Environment Variables

export AGENT_PRIVATE_KEY="0x..."   # Wallet private key
export AGENT_ADDRESS="0x..."       # Wallet address

Note: SDK includes default RPC endpoints. For high-volume production use, set up your own RPC via Alchemy or QuickNode and pass rpcUrl to client config.

Installation

# TypeScript/Node.js
npm install @agirails/sdk

# Python
pip install agirails

How It Works

ACTP uses an 8-state machine with blockchain-secured escrow:

Human/Agent requests service
        ↓
   INITIATED ──► Provider quotes price
        ↓
     QUOTED ──► Requester accepts, locks USDC
        ↓
   COMMITTED ──► Provider starts work
        ↓
  IN_PROGRESS ──► Provider delivers (REQUIRED step!)
        ↓
   DELIVERED ──► Dispute window (48h default)
        ↓
    SETTLED ◄── Manual release (requester calls releaseEscrow)

   DISPUTED ──► Mediator resolves (splits funds)
   CANCELLED ──► Refund to requester

Key Guarantees

GuaranteeDescription
Escrow SolvencyVault always holds ≥ active transaction amounts
State MonotonicityStates only move forward, never backwards
Deadline EnforcementNo delivery after deadline passes
Dispute Protection48h window to raise issues before settlement

Actions

ActionWhoDescription
payRequesterSimple payment (create + escrow lock)
checkStatusAnyoneGet transaction state
createTransactionRequesterCreate with custom params
linkEscrowRequesterLock funds in escrow
transitionStateProviderQuote, start, deliver
releaseEscrowRequesterRelease funds to provider
transitionState('DISPUTED')EitherRaise dispute for mediation

Requester Flow (Paying for Services)

Simple Payment

import { ACTPClient } from '@agirails/sdk';

const client = await ACTPClient.create({
  mode: 'mainnet',
  privateKey: process.env.AGENT_PRIVATE_KEY!,
  requesterAddress: process.env.AGENT_ADDRESS!,
});

// One-liner payment
const result = await client.basic.pay({
  to: '0xProviderAddress',
  amount: '25.00',     // USDC
  deadline: '+24h',    // 24 hours from now
});

console.log(`Transaction: ${result.txId}`);
console.log(`State: ${result.state}`);

Advanced Payment (Full Control)

// 1. Create transaction
const txId = await client.standard.createTransaction({
  provider: '0xProviderAddress',
  amount: '100',  // 100 USDC (user-friendly)
  deadline: Math.floor(Date.now() / 1000) + 86400,
  disputeWindow: 172800,  // 48 hours
  serviceDescription: 'Translate 500 words to Spanish',
});

// 2. Lock funds in escrow
const escrowId = await client.standard.linkEscrow(txId);

// 3. Wait for delivery... then release
// ...wait for DELIVERED
await client.standard.releaseEscrow(escrowId);

Provider Flow (Receiving Payments)

import { ethers } from 'ethers';
const abiCoder = ethers.AbiCoder.defaultAbiCoder();

// 1. Quote the job (encode amount as proof)
const quoteAmount = ethers.parseUnits('50', 6);
const quoteProof = abiCoder.encode(['uint256'], [quoteAmount]);
await client.standard.transitionState(txId, 'QUOTED', quoteProof);

// 2. Start work (REQUIRED before delivery!)
await client.standard.transitionState(txId, 'IN_PROGRESS');

// 3. Deliver with dispute window proof
const disputeWindow = 172800;  // 48 hours
const deliveryProof = abiCoder.encode(['uint256'], [disputeWindow]);
await client.standard.transitionState(txId, 'DELIVERED', deliveryProof);

// 4. Requester releases after dispute window (or earlier if satisfied)

⚠️ CRITICAL: IN_PROGRESS is required before DELIVERED. Contract rejects direct COMMITTED → DELIVERED.


Proof Encoding

All proofs must be ABI-encoded hex strings:

TransitionProof FormatExample
QUOTED['uint256'] amountencode(['uint256'], [parseUnits('50', 6)])
DELIVERED['uint256'] dispute windowencode(['uint256'], [172800])
SETTLED (dispute)['uint256', 'uint256', 'address', 'uint256'][reqAmt, provAmt, mediator, fee]
import { ethers } from 'ethers';
const abiCoder = ethers.AbiCoder.defaultAbiCoder();

// Quote proof
const quoteProof = abiCoder.encode(['uint256'], [ethers.parseUnits('100', 6)]);

// Delivery proof
const deliveryProof = abiCoder.encode(['uint256'], [172800]);

// Resolution proof (mediator only)
const resolutionProof = abiCoder.encode(
  ['uint256', 'uint256', 'address', 'uint256'],
  [requesterAmount, providerAmount, mediatorAddress, mediatorFee]
);

Checking Status

const status = await client.basic.checkStatus(txId);

console.log(`State: ${status.state}`);
console.log(`Can dispute: ${status.canDispute}`);

Disputes

Either party can raise a dispute before settlement:

// Raise dispute
await client.standard.transitionState(txId, 'DISPUTED');

// Mediator resolves (admin only)
const resolution = abiCoder.encode(
  ['uint256', 'uint256', 'address', 'uint256'],
  [
    ethers.parseUnits('30', 6),   // requester gets 30 USDC
    ethers.parseUnits('65', 6),   // provider gets 65 USDC
    mediatorAddress,
    ethers.parseUnits('5', 6),    // mediator fee
  ]
);
await client.standard.transitionState(txId, 'SETTLED', resolution);

Protocol Fees

Fee TypeAmount
Platform fee1% of transaction
Minimum fee$0.05 USDC
Maximum cap5% (governance limit)

Provider receives: amount - max(amount * 0.01, $0.05)


Client Modes

ModeNetworkUse Case
mockLocal simulationDevelopment, testing
testnetBase SepoliaIntegration testing
mainnetBaseProduction
// Development
const client = await ACTPClient.create({
  mode: 'mock',
  requesterAddress: '0x...',
});
await client.mintTokens('0x...', '1000000000');  // Mint test USDC

// Production
const client = await ACTPClient.create({
  mode: 'mainnet',
  privateKey: process.env.AGENT_PRIVATE_KEY!,
  requesterAddress: process.env.AGENT_ADDRESS!,
});

Error Handling

import {
  InsufficientFundsError,
  InvalidStateTransitionError,
  DeadlineExpiredError,
} from '@agirails/sdk';

try {
  await client.basic.pay({...});
} catch (error) {
  if (error instanceof InsufficientFundsError) {
    console.log(error.message);
  } else if (error instanceof InvalidStateTransitionError) {
    console.log(`Invalid state transition`);
  }
}

Python Example

import asyncio
import os
from agirails import ACTPClient

async def main():
    client = await ACTPClient.create(
        mode="mainnet",
        private_key=os.environ["AGENT_PRIVATE_KEY"],
        requester_address=os.environ["AGENT_ADDRESS"],
    )

    result = await client.basic.pay({
        "to": "0xProviderAddress",
        "amount": "25.00",
        "deadline": "24h",
    })

    print(f"Transaction: {result.tx_id}")
    print(f"State: {result.state}")

asyncio.run(main())

Troubleshooting

ProblemCauseSolution
COMMITTED → DELIVERED revertsMissing IN_PROGRESSAdd transitionState(txId, 'IN_PROGRESS') first
Invalid proof errorWrong encodingUse ethers.AbiCoder with correct types
Insufficient balanceNot enough USDCBridge USDC to Base via bridge.base.org
Deadline expiredToo slowCreate new transaction with longer deadline

Files

FilePurpose
{baseDir}/references/requester-template.mdFull requester agent template
{baseDir}/references/provider-template.mdFull provider agent template
{baseDir}/references/state-machine.mdDetailed state transitions
{baseDir}/examples/simple-payment.mdMinimal payment example
{baseDir}/examples/full-lifecycle.mdComplete transaction lifecycle

OpenClaw Integration

Ready-to-use templates for OpenClaw agents.

Quick Setup (5 minutes)

# Run setup script
bash {baseDir}/scripts/setup.sh

# Add agent config to openclaw.json (see agent-config.json)
# Set environment variables
# Restart OpenClaw

See {baseDir}/openclaw/QUICKSTART.md for detailed guide.

OpenClaw Files

FilePurpose
{baseDir}/openclaw/QUICKSTART.md5-minute setup guide
{baseDir}/openclaw/agent-config.jsonReady-to-use agent configs
{baseDir}/openclaw/SOUL-treasury.mdTreasury agent template (buyer)
{baseDir}/openclaw/SOUL-provider.mdMerchant agent template (seller)
{baseDir}/openclaw/cron-examples.jsonAutomation cron jobs
{baseDir}/openclaw/validation-patterns.mdDelivery validation helpers
{baseDir}/openclaw/security-checklist.mdPre-launch security audit

Scripts

ScriptPurpose
{baseDir}/scripts/setup.shAutomated workspace setup
{baseDir}/scripts/test-balance.tsCheck wallet balance
{baseDir}/scripts/test-purchase.tsTest purchase on testnet

Resources

README.md

AGIRAILS Payments - OpenClaw Skill

Official OpenClaw skill for AI agent payments via the ACTP (Agent Commerce Transaction Protocol).

What is this?

This skill enables AI agents running on OpenClaw/Clawdbot to:

  • Pay for services from other agents
  • Receive payments for providing services
  • Track transactions through the 8-state machine
  • Handle disputes with blockchain-secured escrow

Manual installation

# Clone to your skills directory
git clone https://github.com/agirails/openclaw-skill.git ~/.openclaw/skills/agirails

Prerequisites

  1. AGIRAILS SDK installed in your project:

    npm install @agirails/sdk   # TypeScript
    pip install agirails        # Python
    
  2. Environment variables:

    export AGENT_PRIVATE_KEY="0x..."   # Wallet private key
    export AGENT_ADDRESS="0x..."       # Wallet address
    
  3. USDC on Base - Bridge via bridge.base.org

Usage

Once installed, just tell your AI agent:

"Pay 10 USDC to 0xProviderAddress for translation service"

The skill provides documentation for:

  • Basic API (one-liner payments)
  • Standard API (full control)
  • Advanced API (provider flows, proof encoding)

Skill Contents

openclaw-skill/
├── SKILL.md                         # Main skill documentation
├── README.md                        # This file
├── references/
│   ├── state-machine.md             # 8-state machine reference
│   ├── requester-template.md        # Full requester agent template
│   └── provider-template.md         # Full provider agent template
├── examples/
│   ├── simple-payment.md            # All 3 API levels explained
│   └── full-lifecycle.md            # Complete transaction flow
├── openclaw/                        # OpenClaw integration
│   ├── QUICKSTART.md                # 5-minute setup guide
│   ├── agent-config.json            # Ready-to-use configs
│   ├── SOUL-treasury.md             # Buyer agent template
│   ├── SOUL-provider.md             # Seller agent template
│   ├── cron-examples.json           # Automation jobs
│   ├── validation-patterns.md       # Delivery validators
│   └── security-checklist.md        # Pre-launch audit
└── scripts/
    ├── setup.sh                     # Automated setup
    ├── test-balance.ts              # Check wallet balance
    └── test-purchase.ts             # Test on testnet

State Machine

INITIATED → QUOTED → COMMITTED → IN_PROGRESS → DELIVERED → SETTLED
                          ↓            ↓             ↓
                     CANCELLED    DISPUTED ─────────→↑

Important: IN_PROGRESS is required before DELIVERED.

Links

License

MIT © AGIRAILS Inc.

Permissions & Security

Security level L1: Low-risk skills with minimal permissions. Review inputs and outputs before running in production.

Requirements

| Requirement | Check | Install | |-------------|-------|---------| | **Node.js 18+** | `node --version` | [nodejs.org](https://nodejs.org) | | **Private Key** | `echo $AGENT_PRIVATE_KEY` | Export wallet key | | **USDC Balance** | Check wallet | Bridge USDC to Base via [bridge.base.org](https://bridge.base.org) | ### Environment Variables ```bash export AGENT_PRIVATE_KEY="0x..." # Wallet private key export AGENT_ADDRESS="0x..." # Wallet address ``` > **Note:** SDK includes default RPC endpoints. For high-volume production use, set up your own RPC via [Alchemy](https://alchemy.com) or [QuickNode](https://quicknode.com) and pass `rpcUrl` to client config. ### Installation ```bash

FAQ

How do I install AGIRAILS Payments?

Run openclaw add @unima3x/agirails in your terminal. This installs AGIRAILS Payments into your OpenClaw Skills catalog.

Does this skill run locally or in the cloud?

OpenClaw Skills execute locally by default. Review the SKILL.md and permissions before running any skill.

Where can I verify the source code?

The source repository is available at https://github.com/openclaw/skills/tree/main/skills/unima3x/agirails. Review commits and README documentation before installing.