A skill for OpenClaw / Claude Code / OpenCode to make and receive payments. Currently supports USDC payments on the Base chain.
Send the following message to your agent. It will guide you to setup a wallet if you have not done so.
Read https://raw.githubusercontent.com/second-state/payment-skill/refs/heads/main/install.md and follow the instructions to set up USDC payments.
This project provides four CLI tools for Ethereum wallet management and token payments:
Creates a new Ethereum-compatible wallet with a secure random private key. The wallet is encrypted using the Web3 Secret Storage standard (keystore format) and saved to disk.
create-wallet [OPTIONS]Key features:
- Generates cryptographically secure private keys
- Encrypts wallet using scrypt + AES-128-CTR
- Auto-generates secure password if not provided
- Outputs the wallet address to stdout
Retrieves the Ethereum address and token balance from an existing wallet without requiring the password.
get-address [OPTIONS]Key features:
- Reads address directly from keystore (no decryption needed)
- Queries current token balance from blockchain (if network configured)
- Outputs JSON with address, balance, token info, and network
- Creates a new wallet automatically if none exists
Transfers ERC-20 tokens or native ETH from your wallet to a recipient address.
pay --to <ADDRESS> --amount <AMOUNT> [OPTIONS]Key features:
- Supports ERC-20 token transfers (USDC, etc.)
- Supports native ETH/gas token transfers
- Checks balance before sending
- Waits for transaction confirmation by default
- Uses configuration for network and token defaults
Manages configuration for all x402 tools. Stores settings in ~/.payment/config.toml.
payment-config <COMMAND>Commands:
show- Display all current configurationget <KEY>- Get a specific config valueset <KEY> <VALUE>- Set config valuesuse-network <PROFILE>- Apply a predefined network profile (base-sepolia, base-mainnet, etc.)list-networks- List available network profileslist-keys- List all valid config keys
All personal data is stored in the ~/.payment/ folder:
~/.payment/
├── config.toml # Network, token, and payment settings
├── wallet.json # Encrypted wallet keystore (Web3 Secret Storage format)
└── password.txt # Wallet password (auto-generated, 600 permissions)
This folder persists across skill reinstalls, so your wallet and configuration are preserved.
The skill/ directory contains everything needed for Claude agents to use x402 payments:
skill/
├── bootstrap.sh # Downloads platform-specific binaries on first run
├── SKILL.md # Instructions for Claude on how to use the tools
└── scripts/ # CLI binaries installed here by bootstrap.sh
├── create-wallet
├── get-address
├── pay
└── payment-config
-
Clone skill files: The install script copies the
skill/directory to~/.claude/skills/payment/ -
Bootstrap binaries: Running
bootstrap.shdetects your platform (OS + architecture) and downloads the appropriate pre-compiled binaries from GitHub Releases -
Binary installation: Binaries are extracted to
~/.claude/skills/payment/skill/scripts/and made executable
Supported platforms:
- Linux x86_64 / aarch64
- macOS x86_64 / aarch64 (Apple Silicon)
- Windows x86_64
~/.claude/skills/payment/
└── skill/
├── bootstrap.sh
├── SKILL.md
└── scripts/
├── create-wallet
├── get-address
├── pay
└── payment-config
This is a Rust workspace with the following crates:
| Crate | Description |
|---|---|
payment-common |
Shared library for configuration, errors, and utilities |
create-wallet |
Wallet creation CLI |
get-address |
Address retrieval CLI |
pay |
Token payment CLI |
payment-config |
Configuration management CLI |
x402curl |
HTTP client with x402 payment support (coming soon) |
cargo build --releasecargo testThe project uses GitHub Actions to build binaries for all supported platforms. See .github/workflows/release.yml for the CI configuration.
See LICENSE for details.