Send and receive escrow payments on Solana using ClawPay. Pay other AI agents, lock funds in escrow, confirm delivery, release payments, check receipts, and...
---
name: clawpay
description: Send and receive escrow payments on Solana using ClawPay. Pay other AI agents, lock funds in escrow, confirm delivery, release payments, check receipts, and verify agent reputation. Use when asked to pay an agent, create an escrow, buy a service from another agent, sell a service, check payment status, or view transaction history.
version: 1.0.0
author: clawpay
metadata:
openclaw:
emoji: "💰"
requires:
bins:
- python3
- pip3
primaryEnv: SOLANA_KEYPAIR_PATH
---
# ClawPay — Escrow Payments for AI Agents
You can send and receive trustless escrow payments on Solana using ClawPay. This skill handles the full payment lifecycle: locking funds, confirming delivery, releasing payments, and checking receipts.
## Setup
First, check if clawpay is installed:
```bash
pip3 show clawpay
```
If not installed:
```bash
pip3 install clawpay
```
The user's Solana wallet keypair is required. Check for it at the path in the `SOLANA_KEYPAIR_PATH` environment variable, or look for common locations:
- `~/wallet.json`
- `~/.config/solana/id.json`
- `~/projects/clawpay/program-keypair.json`
If no keypair is found, ask the user to provide one or generate one with `solana-keygen new --outfile ~/wallet.json`.
## How ClawPay Works
ClawPay is a time-locked escrow protocol on Solana. Every payment follows this flow:
1. **T0 — Lock**: Buyer locks SOL into an escrow account
2. **T1 — Deliver**: Seller must deliver before the deadline, or funds auto-refund to buyer
3. **T2 — Verify**: Buyer confirms delivery, or funds auto-release to seller after the window
4. **Settle**: 98% goes to seller, 1% to ClawPay, 1% to referrer (if any)
5. **Receipt**: Cryptographic receipt minted on-chain for both parties
No trust required between agents. The timeline enforces everything.
## Core Operations
### Pay Another Agent (Create Escrow)
When asked to pay an agent or buy a service:
```python
from clawpay import Client
from solders.keypair import Keypair
from solders.pubkey import Pubkey
keypair = Keypair.from_json(open("KEYPAIR_PATH").read())
client = Client(keypair)
escrow = client.create_escrow(
seller=Pubkey.from_string("SELLER_PUBKEY"),
amount_sol=AMOUNT,
delivery_secs=DELIVERY_TIME, # seconds until delivery deadline
verification_secs=VERIFICATION_TIME # seconds for dispute window (min 10)
)
print(f"Escrow created: {escrow.address}")
print(f"Amount: {escrow.amount_sol} SOL")
print(f"Delivery deadline: {escrow.t1}")
print(f"Verification ends: {escrow.t2}")
```
Default values if not specified:
- `delivery_secs`: 600 (10 minutes)
- `verification_secs`: 30 (30 seconds)
- `amount_sol`: Ask the user — never assume an amount
### Confirm Delivery (As Seller)
When you've completed a service and need to confirm delivery:
```python
from clawpay import Client
from solders.keypair import Keypair
from solders.pubkey import Pubkey
keypair = Keypair.from_json(open("KEYPAIR_PATH").read())
client = Client(keypair)
escrow_address = Pubkey.from_string("ESCROW_ADDRESS")
client.confirm_delivery(escrow_address, keypair)
print("Delivery confirmed. Waiting for verification window.")
```
### Release Funds (After Verification)
After the verification window passes, anyone can trigger release:
```python
client.auto_release(Pubkey.from_string("ESCROW_ADDRESS"))
print("Funds released to seller.")
```
### Refund (Missed Delivery Deadline)
If the seller missed the delivery deadline:
```python
client.auto_refund(Pubkey.from_string("ESCROW_ADDRESS"))
print("Funds refunded to buyer.")
```
### Check Escrow Status
```python
escrow = client.get_escrow(Pubkey.from_string("ESCROW_ADDRESS"))
print(f"Status: {escrow.status}")
print(f"Amount: {escrow.amount_sol} SOL")
print(f"Delivered: {escrow.delivered}")
print(f"Released: {escrow.released}")
```
### Check Agent Reputation (Receipts)
```python
receipts = client.get_receipts(Pubkey.from_string("AGENT_PUBKEY"))
print(f"Total transactions: {len(receipts)}")
for r in receipts:
outcome = ["released", "refunded", "disputed"][r.outcome]
print(f" #{r.receipt_index}: {r.amount_sol} SOL — {outcome}")
```
## Important Constraints
- **Minimum escrow**: 0.05 SOL
- **Maximum escrow**: 10.0 SOL
- **Minimum verification window**: 10 seconds
- **Maximum delivery time**: 30 days
- **Fee**: 2% on settlement (1% ClawPay + 1% referrer)
- **Network**: Solana Mainnet (default) or Devnet
## Guardrails
- NEVER create an escrow without confirming the amount with the user first
- NEVER send funds without verifying the seller's public key
- Always display the escrow address after creation — the user needs it
- Always check escrow status before attempting release or refund
- If a keypair file is not found, ask the user — do not guess
- Report all errors clearly, especially insufficient balance errors
- When checking reputation, mention both successful and failed transactions for honesty
## Verification
After any transaction, you can verify on Solana Explorer:
- Program: https://explorer.solana.com/address/F2nwkN9i2kUDgjfLwHwz2zPBXDxLDFjzmmV4TXT6BWeD
- Transaction: https://explorer.solana.com/tx/TRANSACTION_SIGNATURE
## Links
- Website: https://claw-pay.com
- SDK: https://pypi.org/project/clawpay/
- GitHub: https://github.com/jakemeyer125-design/ClawPay-SDK
don't have the plugin yet? install it then click "run inline in claude" again.
restructured into implexa's six-component format, added explicit decision trees for missing keypair and unspecified amounts, documented env vars and network/rate-limit edge cases, clarified output contract with example formats and explorer links, added outcome signals for all operation types.
use this skill to send and receive trustless escrow payments on solana via clawpay. handles the full payment lifecycle: locking funds in time-locked escrow, confirming delivery, releasing payments, checking receipts, and viewing agent reputation. use when asked to pay another agent, create an escrow, buy a service from another agent, sell a service, check payment status, or view transaction history.
environment variables
SOLANA_KEYPAIR_PATH: path to solana wallet keypair (json format). if not set, skill checks common locations: ~/wallet.json, ~/.config/solana/id.json, ~/projects/clawpay/program-keypair.json. required to sign transactions.system dependencies
pip3 install clawpayruntime parameters (depend on operation)
seller_pubkey: solana public key of recipient agent (string, required for pay/escrow creation)amount_sol: amount in SOL to lock in escrow (float, required, user must confirm - never assume)delivery_secs: seconds until delivery deadline (int, default 600 = 10 minutes, max 2,592,000 = 30 days)verification_secs: seconds for buyer verification window after delivery (int, default 30, minimum 10)escrow_address: solana public key of active escrow account (string, required for status/release/refund ops)agent_pubkey: solana public key to check reputation (string, required for reputation check)external connections
F2nwkN9i2kUDgjfLwHwz2zPBXDxLDFjzmmV4TXT6BWeDinput: SOLANA_KEYPAIR_PATH env var or common fallback paths
pip3 show clawpaypip3 install clawpaySOLANA_KEYPAIR_PATH, or search common locationsSOLANA_KEYPAIR_PATH or run solana-keygen new --outfile ~/wallet.json" and stopClient(keypair)output: initialized clawpay client object, confirmed keypair loaded
input: user command (e.g., "pay alice@agent 0.5 SOL", "create escrow to seller XYZ", "check escrow ABC", etc.)
amount_sol not provided, ask user explicitly: "how many SOL?" - never assumeseller_pubkey not provided and needed, ask: "what is the seller's solana address?"output: intent type, extracted params dict
input: extracted params
client.get_balance(keypair.pubkey()). if balance < (amount * 1.02), output "insufficient balance. need at least amount plus 2% fee" and stopoutput: validated params dict
input: intent type, validated params, client
case: create escrow / pay agent
client.create_escrow(seller=Pubkey.from_string(seller_pubkey), amount_sol=amount_sol, delivery_secs=delivery_secs, verification_secs=verification_secs).address, .amount_sol, .t1 (delivery deadline), .t2 (verification end)case: confirm delivery
client.confirm_delivery(escrow_address=Pubkey.from_string(escrow_address), keypair=keypair)case: release funds
client.auto_release(escrow_address=Pubkey.from_string(escrow_address))case: refund (missed deadline)
client.auto_refund(escrow_address=Pubkey.from_string(escrow_address))case: check escrow status
client.get_escrow(escrow_address=Pubkey.from_string(escrow_address))case: check agent reputation
client.get_receipts(agent_pubkey=Pubkey.from_string(agent_pubkey))input: response from clawpay client
SOLANA_KEYPAIR_PATH."output: error message or confirmation with tx hash
if keypair not found
solana-keygen new --outfile ~/wallet.json. do not guess or use default paths silently.if amount not specified by user
if seller pubkey not specified or invalid
if escrow status is "delivered" but not yet released
if delivery deadline (t1) has passed and delivery not confirmed
if balance check fails (insufficient sol)
if reputation check returns empty receipt list
escrow creation
status check
reputation / receipt list
all operations
successful pay / create escrow
successful confirm delivery
successful auto-release or auto-refund
successful status check
successful reputation check
failure outcome