skills$openclaw/solana-pay
0xterrybit6.6k

by 0xterrybit

solana-pay – OpenClaw Skill

solana-pay is an OpenClaw Skills integration for coding workflows. Solana Pay protocol integration. Generate payment requests, QR codes, and verify transactions on Solana blockchain.

6.6k stars4.0k forksSecurity L1
Updated Feb 7, 2026Created Feb 7, 2026coding

Skill Snapshot

namesolana-pay
descriptionSolana Pay protocol integration. Generate payment requests, QR codes, and verify transactions on Solana blockchain. OpenClaw Skills integration.
owner0xterrybit
repository0xterrybit/solana-pay
languageMarkdown
licenseMIT
topics
securityL1
installopenclaw add @0xterrybit/solana-pay
last updatedFeb 7, 2026

Maintainer

0xterrybit

0xterrybit

Maintains solana-pay in the OpenClaw Skills directory.

View GitHub profile
File Explorer
3 files
.
_meta.json
276 B
README.md
822 B
SKILL.md
7.0 KB
SKILL.md

name: solana-pay description: Solana Pay protocol integration. Generate payment requests, QR codes, and verify transactions on Solana blockchain. metadata: {"clawdbot":{"emoji":"⚡","requires":{"bins":["solana","curl","jq","qrencode"],"env":["SOLANA_KEYPAIR_PATH"]}}}

Solana Pay ⚡

Decentralized payment protocol built on Solana. Instant, near-zero fee payments.

Environment Variables

VariableDescriptionRequired
SOLANA_KEYPAIR_PATHPath to merchant wallet keypairYes
SOLANA_RPC_URLCustom RPC endpointNo
MERCHANT_NAMEDisplay name for paymentsNo

Features

  • 💸 Instant Payments - Sub-second finality (~400ms)
  • 🆓 Near-Zero Fees - ~$0.00025 per transaction
  • 🔗 QR Code Payments - Generate scannable payment requests
  • 🛒 Point of Sale - Merchant integrations
  • 📱 Wallet Support - Phantom, Solflare, Backpack

Payment URL Specification

Solana Pay uses a URL scheme for payment requests:

solana:<recipient>?amount=<amount>&spl-token=<mint>&reference=<reference>&label=<label>&message=<message>&memo=<memo>

Generate Payment Request (SOL)

RECIPIENT=$(solana address --keypair "$SOLANA_KEYPAIR_PATH")
AMOUNT="1.5"
REFERENCE=$(solana-keygen new --no-bip39-passphrase --silent --outfile /dev/stdout | head -1)
LABEL="My Store"
MESSAGE="Order #12345"

# Build Solana Pay URL
PAY_URL="solana:${RECIPIENT}?amount=${AMOUNT}&reference=${REFERENCE}&label=${LABEL}&message=${MESSAGE}"

echo "Payment URL: $PAY_URL"

# Generate QR code (requires qrencode)
echo "$PAY_URL" | qrencode -o payment_qr.png -s 10
echo "QR code saved to payment_qr.png"

Generate Payment Request (SPL Token)

RECIPIENT=$(solana address --keypair "$SOLANA_KEYPAIR_PATH")
AMOUNT="100"
SPL_TOKEN="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"  # USDC
REFERENCE=$(openssl rand -hex 32)
LABEL="My Store"
MESSAGE="Order #12345"

# Build Solana Pay URL with SPL token
PAY_URL="solana:${RECIPIENT}?amount=${AMOUNT}&spl-token=${SPL_TOKEN}&reference=${REFERENCE}&label=${LABEL}&message=${MESSAGE}"

echo "Payment URL: $PAY_URL"
echo "$PAY_URL" | qrencode -o payment_qr.png -s 10

Common Token Addresses

TokenMint Address
USDCEPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
USDTEs9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB
BONKDezXAZ8z7PnrnRJjz3wXBoRgixCa6xjnB7YaB1pPB263
JUPJUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN

Verify Payment by Reference

REFERENCE="<REFERENCE_PUBKEY>"
RPC_URL="${SOLANA_RPC_URL:-https://api.mainnet-beta.solana.com}"

# Find transaction with reference
curl -s -X POST "$RPC_URL" \
  -H "Content-Type: application/json" \
  -d "{
    \"jsonrpc\": \"2.0\",
    \"id\": 1,
    \"method\": \"getSignaturesForAddress\",
    \"params\": [\"${REFERENCE}\", {\"limit\": 1}]
  }" | jq '.result[0]'

Validate Transaction

SIGNATURE="<TX_SIGNATURE>"
EXPECTED_RECIPIENT="<MERCHANT_WALLET>"
EXPECTED_AMOUNT="1000000"  # in lamports or token units

# Get transaction details
TX=$(curl -s -X POST "$RPC_URL" \
  -H "Content-Type: application/json" \
  -d "{
    \"jsonrpc\": \"2.0\",
    \"id\": 1,
    \"method\": \"getTransaction\",
    \"params\": [\"${SIGNATURE}\", {\"encoding\": \"jsonParsed\", \"maxSupportedTransactionVersion\": 0}]
  }")

# Verify recipient and amount
echo "$TX" | jq '.result.transaction.message.instructions[] | select(.parsed.type == "transfer")'

Transaction Request (Interactive Payments)

For complex payments requiring server interaction:

# Server endpoint that returns transaction
TRANSACTION_URL="https://your-server.com/api/pay"

# Solana Pay URL pointing to transaction endpoint
PAY_URL="solana:${TRANSACTION_URL}"

Transaction Request Server Example

// POST /api/pay
// Returns serialized transaction for wallet to sign

app.post('/api/pay', async (req, res) => {
  const { account } = req.body;  // Payer's wallet
  
  // Build transaction
  const transaction = new Transaction();
  transaction.add(
    SystemProgram.transfer({
      fromPubkey: new PublicKey(account),
      toPubkey: MERCHANT_WALLET,
      lamports: LAMPORTS_PER_SOL * 0.1
    })
  );
  
  // Serialize and return
  const serialized = transaction.serialize({
    requireAllSignatures: false,
    verifySignatures: false
  });
  
  res.json({
    transaction: serialized.toString('base64'),
    message: 'Payment for Order #123'
  });
});

Point of Sale Integration

Generate Dynamic QR

#!/bin/bash
# pos_payment.sh - Generate payment QR for POS

AMOUNT="$1"
ORDER_ID="$2"
TOKEN="${3:-SOL}"

RECIPIENT=$(solana address --keypair "$SOLANA_KEYPAIR_PATH")
REFERENCE=$(openssl rand -hex 32)

if [[ "$TOKEN" == "SOL" ]]; then
  PAY_URL="solana:${RECIPIENT}?amount=${AMOUNT}&reference=${REFERENCE}&memo=Order-${ORDER_ID}"
else
  # Get token mint
  case "$TOKEN" in
    USDC) MINT="EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v" ;;
    USDT) MINT="Es9vMFrzaCERmJfrF4H2FYD4KCoNkY11McCe8BenwNYB" ;;
  esac
  PAY_URL="solana:${RECIPIENT}?amount=${AMOUNT}&spl-token=${MINT}&reference=${REFERENCE}&memo=Order-${ORDER_ID}"
fi

# Display QR in terminal (requires qrencode)
echo "$PAY_URL" | qrencode -t ANSIUTF8

# Save reference for verification
echo "$REFERENCE" > "/tmp/order_${ORDER_ID}_ref.txt"
echo "Reference saved. Waiting for payment..."

Poll for Payment

#!/bin/bash
# wait_payment.sh - Wait for payment confirmation

ORDER_ID="$1"
REFERENCE=$(cat "/tmp/order_${ORDER_ID}_ref.txt")
RPC_URL="${SOLANA_RPC_URL:-https://api.mainnet-beta.solana.com}"

echo "Waiting for payment (reference: ${REFERENCE:0:8}...)"

while true; do
  RESULT=$(curl -s -X POST "$RPC_URL" \
    -H "Content-Type: application/json" \
    -d "{
      \"jsonrpc\": \"2.0\",
      \"id\": 1,
      \"method\": \"getSignaturesForAddress\",
      \"params\": [\"${REFERENCE}\", {\"limit\": 1}]
    }")
  
  SIG=$(echo "$RESULT" | jq -r '.result[0].signature // empty')
  
  if [[ -n "$SIG" ]]; then
    echo "✅ Payment received!"
    echo "Transaction: $SIG"
    echo "Explorer: https://solscan.io/tx/$SIG"
    break
  fi
  
  sleep 2
done

Fee Comparison

NetworkFeeTime
Solana Pay~$0.00025~400ms
Visa/MC2-3%1-3 days
PayPal2.9% + $0.30Instant
Wire Transfer$25-501-5 days

Safety Rules

  1. ALWAYS verify transaction signature before fulfilling orders
  2. ALWAYS check recipient matches merchant wallet
  3. ALWAYS verify amount matches expected payment
  4. USE unique reference for each payment request
  5. NEVER reuse reference keys
ErrorCauseSolution
No transaction foundPayment not madeContinue polling
Wrong recipientSpoofed paymentReject, alert user
Wrong amountPartial paymentRequest remaining
Transaction failedInsufficient fundsRequest retry
README.md

Solana Pay ⚡

Decentralized payment protocol skill for Clawdbot.

Features

  • 💸 Instant Payments - Sub-second finality
  • 🆓 Near-Zero Fees - ~$0.00025 per transaction
  • 🔗 QR Code Payments - Generate payment requests
  • 🛒 Point of Sale - Merchant integrations
  • 📱 Mobile Wallets - Phantom, Solflare support

Installation

clawdhub install solana-pay

Configuration

export SOLANA_KEYPAIR_PATH="~/.config/solana/id.json"
export SOLANA_RPC_URL="https://api.mainnet-beta.solana.com"

Usage Examples

"Generate payment request for 10 USDC"
"Create QR code for 0.5 SOL payment"
"Verify transaction signature ABC123"
"Check payment status for reference XYZ"

Supported Tokens

SOL, USDC, USDT, BONK, JUP

License

MIT

Permissions & Security

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

Requirements

  • OpenClaw CLI installed and configured.
  • Language: Markdown
  • License: MIT
  • Topics:

FAQ

How do I install solana-pay?

Run openclaw add @0xterrybit/solana-pay in your terminal. This installs solana-pay 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/0xterrybit/solana-pay. Review commits and README documentation before installing.