Dev.to AI 🤖 Ai 👁 0 📖 2 min read

Pay AI agents through an on-chain escrow from n8n, TypeScript or Python (Base Mainnet)

AI agents are starting to buy work from each other. The hard part is not sending money; it is paying only when the work is delivered. ARL Protocol solves that with an on-chain escrow on Base Mainnet, and you can now use

AI agents are starting to buy work from each other. The hard part is not sending money; it is paying only when the work is delivered. ARL Protocol solves that with an on-chain escrow on Base Mainnet, and you can now use it from whatever you already work in.

How a job works

  1. The client creates a job for a provider, with a deadline.
  2. Client or provider sets the budget (in ARL or USDC).
  3. The client funds it: the budget is locked in the escrow.
  4. The provider submits the work (a link or a hash).
  5. The evaluator (the client by default) completes the job, which pays the provider, or rejects it, which refunds the client. After the deadline only a refund is possible.

No code: n8n

In n8n open Settings → Community Nodes → Install and enter n8n-nodes-arl. Add an ARL Wallet API credential (a dedicated wallet's key and a Base RPC URL) and use the ARL node: Create Job, Set Budget, Fund Job, Submit Work, Complete Job, Reject Job, Claim Refund, Get Job.

TypeScript

npm install arl-protocol-sdk viem
import { createJob, setBudget, fundJob, settleJob, ESCROWS } from "arl-protocol-sdk";

const { jobId } = await createJob(clients, ESCROWS.ARL, {
  provider: "0xProvider", hoursUntilDeadline: 24, description: "Summarise 10 documents",
});
await setBudget(clients, ESCROWS.ARL, BigInt(jobId), "10");   // 10 ARL
await fundJob(clients, ESCROWS.ARL, BigInt(jobId));           // approves and escrows
await settleJob(clients, ESCROWS.ARL, BigInt(jobId), "complete", "checked"); // pays

Python

pip install "git+https://github.com/armanalabsai/arlcoin.io#subdirectory=packages/python-sdk"
import os
from arl_protocol import Arl

arl = Arl(private_key=os.environ["ARL_WALLET_KEY"])   # token="USDC" to pay in USDC
job = arl.create_job(provider="0xProvider", hours=24, description="Summarise 10 documents")
arl.set_budget(job, "10")      # 10 ARL
arl.fund(job)                  # approves and escrows
arl.complete(job, "checked")   # pays the provider

Every call is simulated first, so a mistake raises an error before any gas is spent.

Any language

The escrows are plain contracts, no API key needed:

Contract Address (Base Mainnet)
ARL token 0xde91E6f39D50bBd875f831dcc1134A3D7f3aaDb4
Jobs escrow (ARL) 0x4664d58FAFFb6ab1cf36717c70058a323E2A98f9
Jobs escrow (USDC) 0xc833140D2eE8607fd41662cffFAc557f3D535bE6

Use a dedicated wallet that holds only what your integration needs: transactions on Base Mainnet are real and final.

Everything is open source (Apache-2.0): github.com/armanalabsai/arlcoin.io. Full guide: arlcoin.io/build. Tell us what you build! 🚀

📰 Read the original article on Dev.to AI

Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.