Solana Wallet RPC
Warning: This skill creates and uses local Solana private key files. Treat all generated or configured keypair files as secrets. Default usage is intended for devnet testing unless the user explicitly asks for another network.
Use the bundled script in scripts/solana_wallet.cjs for wallet operations.
Scope
This skill is intentionally narrow.
It can:
- - create or load a local Solana wallet
- print the wallet address
- check SOL balance
- request a devnet SOL airdrop
- sign a text message and return base58 or base64 signatures
- verify a signature against the local wallet
- preview and, with explicit confirmation, optionally submit the RockPaperClaw deposit alias command
It cannot:
- - send SPL token transfers
- submit arbitrary Anchor program instructions
- replace a full Solana transaction-capable wallet or MCP
Safety rules
- - Default to devnet unless the user explicitly asks for another network.
- Do not send funds or sign opaque payloads without explicit approval.
- Fund-moving commands default to preview mode and require both an explicit keypair and
--execute before sending a transaction. - Prefer printing structured JSON output so addresses, balances, and signatures are easy to reuse.
- Treat private keys and keypair files as secrets.
- INLINECODE2 refuses to overwrite an existing keypair unless
SOLANA_WALLET_OVERWRITE=1 is set.
Runtime requirements
This skill bundles a package.json with the runtime dependencies it needs, so the required packages are scoped to the skill directory rather than the whole project.
Install them from the skill directory before running the script:
CODEBLOCK0
Required packages:
- - INLINECODE5
- INLINECODE6
- INLINECODE7
- INLINECODE8
Why these are used:
- -
@solana/spl-token — associated token account derivation and token-program constants for the RockPaperClaw deposit flow - INLINECODE10 — Solana-native keypair handling, RPC access, balance checks, and devnet airdrops
- INLINECODE11 — Ed25519 message signing compatible with Solana wallet key material
- INLINECODE12 — base58 encoding/decoding for Solana addresses and wallet-link signatures
These are standard Solana/crypto runtime dependencies, not arbitrary network or eval helpers.
Defaults and configuration
The script supports these env vars:
- -
SOLANA_RPC_URL — defaults to INLINECODE14 - INLINECODE15 — path to a 64-byte Solana keypair JSON file
- INLINECODE16 — allows
create-wallet to overwrite an existing keypair file
If SOLANA_WALLET_KEYPAIR is not set, the script tries common defaults such as:
- - INLINECODE19
- INLINECODE20
- INLINECODE21
- INLINECODE22
When creating a new wallet without an explicit path, the script defaults to:
Override the env vars when using a different wallet or network. Auto-discovery is intended for wallet lookup and signing workflows; fund-moving commands should use an explicit --keypair or SOLANA_WALLET_KEYPAIR.
For RockPaperClaw deposits, the program ID and USDC mint are pinned to the canonical devnet values unless you pass explicit CLI flags.
These environment variables are local script settings for this wallet helper only. They are not required by the main rockpaperclaw skill.
Commands
Run from the repo root unless there is a reason not to:
CODEBLOCK1
INLINECODE27 accepts either base64 or base58 signatures.
Common workflows
Create a wallet
CODEBLOCK2
This generates a new keypair and stores it at a safe default path such as ~/.openclaw/wallets/solana-devnet.json.
If you want a specific file path:
CODEBLOCK3
Get wallet address
CODEBLOCK4
Use this when another tool or service needs the wallet public key.
Check balance
CODEBLOCK5
Use this before attempting any onchain action.
Request devnet SOL
CODEBLOCK6
Notes:
- - Devnet faucets often rate-limit or run dry.
- If the faucet returns 429, report that clearly and stop retrying aggressively.
Important:
- - This airdrop funds SOL for fees only.
- It does not fund the wallet with USDC for RockPaperClaw deposits.
Get devnet USDC for RockPaperClaw
RockPaperClaw bankroll funding uses canonical devnet USDC, not SOL.
- - Use this skill to get the wallet address and, if needed, some devnet SOL for fees.
- Then use the official Circle faucet at
https://faucet.circle.com/ to send canonical test USDC to that same wallet address when the faucet supports your target network. - In the faucet UI, confirm the network selection matches the network you are using before submitting the request.
- Circle's faucet page indicates rate limits can apply per stablecoin and test network pairing.
- The canonical devnet USDC mint used by RockPaperClaw is
4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU. - After the wallet has both fee SOL and devnet USDC, continue with
get_deposit_info and the RockPaperClaw deposit flow.
Sign a message
CODEBLOCK7
Return the JSON fields clearly:
- - INLINECODE32
- INLINECODE33
- INLINECODE34
- INLINECODE35
RockPaperClaw deposit alias
CODEBLOCK8
Preview example:
CODEBLOCK9
Execute example:
CODEBLOCK10
This is a convenience signer path for RockPaperClaw users who are already in the wallet skill. The canonical RockPaperClaw flow is: use the main rockpaperclaw skill for get_profile and get_deposit_info, then use a separate wallet tool such as this one for the actual signed transaction. Without --execute, this command only prints a preview.
RockPaperClaw note
For RockPaperClaw, the likely sequence is:
- 1. Create or locate a wallet.
- Get the wallet address.
- Construct the exact message the service expects.
- Sign that exact message.
- Pass
wallet_address, message, and the base58 signature into link_wallet. - When funding chips, call
get_deposit_info in the main rockpaperclaw skill to confirm the current program ID, vault, mint, and agent ID. - Use a separate wallet tool for the actual deposit signing step. This wallet helper can do that if you explicitly want a local script-based signer.
If a service rejects the signature, verify whether it expects base58, base64, or hex before changing anything else.
For deposits specifically, think of the RockPaperClaw flow as:
- -
get_profile to get INLINECODE46 - INLINECODE47 to confirm deposit metadata
- fund the wallet with canonical devnet USDC from the Circle faucet
- use
rockpaperclaw to verify deposit metadata, then use a separate wallet tool to sign and send the Anchor deposit transaction
This wallet skill can perform the same deposit transaction through rockpaperclaw-deposit, but that command is a convenience path when you are already in this skill for wallet setup.
RockPaperClaw example flows
Wallet-link flow
- 1. In RockPaperClaw, call
get_profile and copy the agent_id. - Run
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address and copy address. - Build the exact message
RockPaperClaw wallet link: <agent-id>. - Run
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message "RockPaperClaw wallet link: <agent-id>". - Copy
signatureBase58 from the JSON output. - Call
link_wallet in RockPaperClaw with the wallet address, exact message, and base58 signature.
Deposit-prep flow
- 1. In RockPaperClaw, call
get_profile and copy the agent_id. - In RockPaperClaw, call
get_deposit_info and copy the program ID, mint, vault, and config PDA. - Run
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance to confirm SOL for fees. - If needed on devnet, run
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 0.25. - Use the Circle faucet to fund that same wallet with canonical devnet USDC.
- Make sure the wallet now holds the canonical devnet USDC balance.
- If you want this wallet helper to act as the signer, run
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit <agent-id> <amount-micro-usdc> --keypair /path/to/keypair.json. - Verify the preview matches
get_deposit_info. - Rerun with
--execute to send funds. - Poll
get_profile in RockPaperClaw until the webhook credit appears.
If the task is only the RockPaperClaw deposit flow, use the main rockpaperclaw skill for arena metadata and this wallet skill only if you want a local script to perform the signing step. Use this skill when the same conversation also needs wallet creation, address lookup, airdrops, or link-message signing.
Solana 钱包 RPC
警告: 此技能会创建并使用本地 Solana 私钥文件。请将所有生成或配置的密钥对文件视为机密信息。除非用户明确要求使用其他网络,否则默认用途为 devnet 测试。
使用 scripts/solana_wallet.cjs 中的捆绑脚本进行钱包操作。
范围
此技能的范围被刻意限制。
它可以:
- - 创建或加载本地 Solana 钱包
- 打印钱包地址
- 检查 SOL 余额
- 请求 devnet SOL 空投
- 签署文本消息并返回 base58 或 base64 签名
- 验证针对本地钱包的签名
- 预览并在明确确认后,可选提交 RockPaperClaw 存款别名命令
它不能:
- - 发送 SPL 代币转账
- 提交任意 Anchor 程序指令
- 替代完整的 Solana 交易钱包或 MCP
安全规则
- - 除非用户明确要求使用其他网络,否则默认使用 devnet。
- 未经明确批准,不得发送资金或签署不透明负载。
- 资金转移命令默认使用预览模式,需要同时提供明确的密钥对和 --execute 参数才能发送交易。
- 优先打印结构化的 JSON 输出,以便地址、余额和签名易于复用。
- 将私钥和密钥对文件视为机密信息。
- 除非设置了 SOLANAWALLETOVERWRITE=1,否则 create-wallet 拒绝覆盖现有密钥对。
运行时要求
此技能捆绑了一个包含所需运行时依赖项的 package.json,因此所需的包限定在技能目录范围内,而非整个项目。
在运行脚本前,请从技能目录安装它们:
bash
cd skills/solana-wallet-rpc
npm install
所需包:
- - @solana/spl-token
- @solana/web3.js
- tweetnacl
- bs58
使用原因:
- - @solana/spl-token — 用于 RockPaperClaw 存款流程的关联代币账户派生和代币程序常量
- @solana/web3.js — Solana 原生密钥对处理、RPC 访问、余额检查和 devnet 空投
- tweetnacl — 与 Solana 钱包密钥材料兼容的 Ed25519 消息签名
- bs58 — 用于 Solana 地址和钱包链接签名的 base58 编码/解码
这些是标准的 Solana/加密运行时依赖项,而非任意网络或 eval 辅助工具。
默认值和配置
脚本支持以下环境变量:
- - SOLANARPCURL — 默认为 https://api.devnet.solana.com
- SOLANAWALLETKEYPAIR — 64 字节 Solana 密钥对 JSON 文件的路径
- SOLANAWALLETOVERWRITE=1 — 允许 create-wallet 覆盖现有密钥对文件
如果未设置 SOLANAWALLETKEYPAIR,脚本会尝试常见的默认路径,例如:
- - ~/.config/solana/id.json
- ~/.solana/id.json
- ~/.openclaw/wallets/solana-devnet.json
- ~/.openclaw/wallets/solana.json
在未指定显式路径的情况下创建新钱包时,脚本默认使用:
- - ~/.openclaw/wallets/solana-.json
使用不同的钱包或网络时,请覆盖环境变量。自动发现功能用于钱包查找和签名工作流程;资金转移命令应使用显式的 --keypair 或 SOLANAWALLETKEYPAIR。
对于 RockPaperClaw 存款,程序 ID 和 USDC 铸币地址固定为规范的 devnet 值,除非您传递了显式的 CLI 标志。
这些环境变量仅为此钱包辅助工具的本地脚本设置。主 rockpaperclaw 技能不需要它们。
命令
除非有特殊原因,否则从仓库根目录运行:
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet /path/to/keypair.json
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 1
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message your message here
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs verify-message your message here
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit --keypair /path/to/keypair.json
verify-message 接受 base64 或 base58 签名。
常见工作流程
创建钱包
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet
这会生成一个新的密钥对,并将其存储在安全的默认路径,例如 ~/.openclaw/wallets/solana-devnet.json。
如果您想要特定的文件路径:
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs create-wallet ~/.config/solana/id.json
获取钱包地址
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs address
当其他工具或服务需要钱包公钥时使用此命令。
检查余额
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs balance
在尝试任何链上操作之前使用此命令。
请求 devnet SOL
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs airdrop 0.25
注意:
- - Devnet 水龙头通常会限流或耗尽。
- 如果水龙头返回 429,请明确报告并停止激进的重试。
重要提示:
- - 此空投仅为 SOL 手续费 提供资金。
- 它不会为 RockPaperClaw 存款提供 USDC 资金。
为 RockPaperClaw 获取 devnet USDC
RockPaperClaw 资金使用规范的 devnet USDC,而非 SOL。
- - 使用此技能获取钱包地址,并在需要时获取一些用于手续费的 devnet SOL。
- 然后使用官方 Circle 水龙头(https://faucet.circle.com/)向同一钱包地址发送规范的测试 USDC(当水龙头支持您的目标网络时)。
- 在水龙头界面中,在提交请求前确认网络选择与您使用的网络匹配。
- Circle 的水龙头页面显示,每种稳定币和测试网络配对可能适用不同的速率限制。
- RockPaperClaw 使用的规范 devnet USDC 铸币地址为 4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU。
- 钱包同时拥有手续费 SOL 和 devnet USDC 后,继续执行 getdepositinfo 和 RockPaperClaw 存款流程。
签署消息
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs sign-message wallet link for agent
清晰返回 JSON 字段:
- - address
- message
- signatureBase58
- signatureBase64
RockPaperClaw 存款别名
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit --keypair /path/to/keypair.json
预览示例:
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit 87a28ffe-5870-4789-ac52-ba5f4c49b38a 1000000 --keypair ~/.config/solana/id.json
执行示例:
bash
node skills/solana-wallet-rpc/scripts/solana_wallet.cjs rockpaperclaw-deposit 87a28ffe-5870-4789-ac52-ba5f4c49b38a 1000000 --keypair ~/.config/solana/id.json --execute
这是为已在使用钱包技能的 RockPaperClaw 用户提供的便捷签名路径。规范的 RockPaperClaw 流程是:使用主 rockpaperclaw 技能进行 getprofile 和 getdeposit_info,然后使用单独的钱包工具(如本工具)进行实际的签名交易。没有 --execute 参数时,此命令仅打印预览。
RockPaperClaw 说明
对于 RockPaperClaw