aibtc-bitcoin-wallet
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAIBTC Bitcoin Wallet
AIBTC Bitcoin钱包
A skill for managing Bitcoin L1 wallets with optional Pillar smart wallet and Stacks L2 DeFi capabilities.
一款用于管理比特币L1钱包的技能,可选支持Pillar智能钱包及Stacks L2去中心化金融功能。
Install
安装
One-command installation:
bash
npx @aibtc/mcp-server@latest --installFor testnet:
bash
npx @aibtc/mcp-server@latest --install --testnet一键安装:
bash
npx @aibtc/mcp-server@latest --install测试网安装:
bash
npx @aibtc/mcp-server@latest --install --testnetQuick Start
快速开始
Check Balance
查询余额
Get your Bitcoin balance:
"What's my BTC balance?"Uses - returns total, confirmed, and unconfirmed balances.
get_btc_balance查询你的比特币余额:
"我的BTC余额是多少?"使用工具——返回总余额、已确认余额和未确认余额。
get_btc_balanceCheck Fees
查询手续费
Get current network fee estimates:
"What are the current Bitcoin fees?"Uses - returns fast (~10 min), medium (~30 min), and slow (~1 hr) rates in sat/vB.
get_btc_fees获取当前网络手续费预估:
"当前比特币手续费是多少?"使用工具——返回快速(约10分钟)、中等(约30分钟)、慢速(约1小时)三个档位的费率,单位为sat/vB。
get_btc_feesSend BTC
发送BTC
Transfer Bitcoin to an address:
"Send 50000 sats to bc1q..."
"Transfer 0.001 BTC with fast fees to bc1q..."Uses - requires an unlocked wallet.
transfer_btc向指定地址转账比特币:
"向bc1q...发送50000聪"
"以快速手续费向bc1q...转账0.001 BTC"使用工具——需要钱包处于解锁状态。
transfer_btcWallet Setup
钱包设置
Before sending transactions, set up a wallet:
- Create new wallet: - generates encrypted BIP39 mnemonic
wallet_create - Import existing: - import from mnemonic phrase
wallet_import - Unlock for use: - required before transactions
wallet_unlock
Wallets are stored encrypted at .
~/.aibtc/发送交易前,请先设置钱包:
- 创建新钱包:——生成加密的BIP39助记词
wallet_create - 导入现有钱包:——通过助记词导入钱包
wallet_import - 解锁钱包:——交易前必须执行此操作
wallet_unlock
钱包将加密存储在目录下。
~/.aibtc/Tool Reference
工具参考
Read Operations
只读操作
| Tool | Description | Parameters |
|---|---|---|
| Get BTC balance | |
| Get fee estimates | None |
| List UTXOs | |
| 工具 | 描述 | 参数 |
|---|---|---|
| 查询BTC余额 | |
| 获取手续费预估 | 无 |
| 列出UTXO | |
Write Operations (Wallet Required)
写入操作(需钱包)
| Tool | Description | Parameters |
|---|---|---|
| Send BTC | |
| 工具 | 描述 | 参数 |
|---|---|---|
| 发送BTC | |
Wallet Management
钱包管理
| Tool | Description |
|---|---|
| Generate new encrypted wallet |
| Import wallet from mnemonic |
| Unlock wallet for transactions |
| Lock wallet (clear from memory) |
| List available wallets |
| Switch active wallet |
| Get wallet/session status |
| 工具 | 描述 |
|---|---|
| 生成新的加密钱包 |
| 通过助记词导入钱包 |
| 解锁钱包以进行交易 |
| 锁定钱包(从内存中清除) |
| 列出可用钱包 |
| 切换活跃钱包 |
| 获取钱包/会话状态 |
Units and Addresses
单位与地址
Amounts: Always in satoshis (1 BTC = 100,000,000 satoshis)
Addresses:
- Mainnet: (native SegWit)
bc1... - Testnet:
tb1...
Fee Rates: , , , or custom sat/vB number
"fast""medium""slow"金额:始终以聪为单位(1 BTC = 100,000,000聪)
地址:
- 主网:(原生隔离见证)
bc1... - 测试网:
tb1...
费率:可选择、、,或自定义sat/vB数值
"fast""medium""slow"Example Workflows
示例工作流
Daily Balance Check
每日余额查询
1. "What's my BTC balance?"
2. "Show my recent UTXOs"
3. "What are current fees?"1. "我的BTC余额是多少?"
2. "显示我最近的UTXO"
3. "当前手续费是多少?"Send Payment
发送付款
1. "Unlock my wallet" (provide password)
2. "Send 100000 sats to bc1qxyz... with medium fees"
3. "Lock my wallet"1. "解锁我的钱包"(输入密码)
2. "向bc1qxyz...发送100000聪,使用中等手续费"
3. "锁定我的钱包"Multi-Wallet Management
多钱包管理
1. "List my wallets"
2. "Switch to trading wallet"
3. "Unlock it"
4. "Check balance"1. "列出我的钱包"
2. "切换到交易钱包"
3. "解锁它"
4. "查询余额"Progressive Layers
渐进式扩展层
This skill focuses on Bitcoin L1. Additional capabilities are organized by layer:
本技能聚焦于比特币L1。额外功能按层级划分:
Stacks L2 (Layer 2)
Stacks L2(第二层)
Bitcoin L2 with smart contracts and DeFi:
- STX token transfers
- ALEX DEX token swaps
- Zest Protocol lending/borrowing
- x402 paid API endpoints (AI, storage, utilities) — safe-by-default with probe-before-pay workflow
See: references/stacks-defi.md
支持智能合约与去中心化金融的比特币L2:
- STX代币转账
- ALEX DEX代币兑换
- Zest Protocol借贷
- x402付费API端点(AI、存储、工具类)——默认采用“先探测后支付”的安全流程
详见:references/stacks-defi.md
Pillar Smart Wallet (Layer 3)
Pillar智能钱包(第三层)
sBTC smart wallet with yield automation:
- Passkey or agent-signed transactions
- Send to BNS names (alice.btc)
- Auto-boost yield via Zest Protocol
See: references/pillar-wallet.md
具备收益自动化功能的sBTC智能钱包:
- 密钥或Agent签名交易
- 支持发送至BNS名称(如alice.btc)
- 通过Zest Protocol自动提升收益
详见:references/pillar-wallet.md
Bitcoin Inscriptions
比特币铭文
Inscribe and retrieve digital artifacts on Bitcoin:
- Commit-reveal inscription workflow
- Get inscription content and metadata
- Protect ordinal UTXOs from accidental spending
See: references/inscription-workflow.md
在比特币上铭刻与检索数字资产:
- 提交-揭示铭文流程
- 获取铭文内容与元数据
- 保护序数UTXO避免意外花费
详见:references/inscription-workflow.md
x402 Paid APIs
x402付费API
Pay-per-use APIs with automatic micropayments on Stacks L2:
- Discover available endpoints with
list_x402_endpoints - Check cost before paying with
probe_x402_endpoint - Execute endpoints with (safe-by-default — probes first)
execute_x402_endpoint - Send inbox messages with (use this instead of execute_x402_endpoint for inbox)
send_inbox_message - Build new x402 APIs with and
scaffold_x402_endpointscaffold_x402_ai_endpoint
Always probe before executing paid endpoints. Never call with without checking cost first.
execute_x402_endpointautoApprove: truesend_inbox_message — dedicated tool for aibtc.com inbox messages:
- Parameters: (bc1...),
recipientBtcAddress(SP...),recipientStxAddress(max 500 chars),content(optional)paymentTxid - Uses sponsored transactions: sender pays only the sBTC message cost, relay covers STX gas
- Avoids sBTC settlement timeout issues that affect the generic execute_x402_endpoint tool
- Implements the full 5-step x402 v2 payment flow with balance pre-check
- paymentTxid (optional): provide a confirmed on-chain sBTC transfer txid to skip the x402 flow and deliver the message using that txid as payment proof — use for manual recovery when a settlement timeout left the sBTC payment confirmed on-chain but the message undelivered
- Automatic recovery: if retries are exhausted, the tool checks whether any submitted payment txid confirmed on-chain and, if so, resubmits the message automatically — no agent action required
See: references/stacks-defi.md for endpoint catalog
See: references/x402-inbox.md for inbox-specific flow details
在Stacks L2上自动完成微支付的按次付费API:
- 使用发现可用端点
list_x402_endpoints - 使用在支付前查询成本
probe_x402_endpoint - 使用执行端点(默认安全——先探测)
execute_x402_endpoint - 使用发送收件箱消息(替代execute_x402_endpoint用于收件箱场景)
send_inbox_message - 使用和
scaffold_x402_endpoint构建新的x402 APIscaffold_x402_ai_endpoint
执行付费端点前务必先探测。未查询成本前,切勿使用调用。
autoApprove: trueexecute_x402_endpointsend_inbox_message —— 专为aibtc.com收件箱消息设计的工具:
- 参数:(格式:bc1...),
recipientBtcAddress(格式:SP...),recipientStxAddress(最大500字符),content(可选)paymentTxid - 使用赞助交易:发送方仅需支付sBTC消息费用,中继方承担STX Gas费
- 避免了通用execute_x402_endpoint工具存在的sBTC结算超时问题
- 实现完整的5步x402 v2支付流程,并包含余额预检查
- paymentTxid(可选):提供已确认的链上sBTC转账交易ID,可跳过x402流程,直接使用该交易ID作为支付凭证交付消息——用于结算超时导致sBTC支付已上链但消息未送达时的手动恢复
- 自动恢复:若重试次数耗尽,工具会检查是否有已提交的支付交易ID已上链确认,若是则自动重新提交消息——无需Agent干预
详见:references/stacks-defi.md获取端点目录
详见:references/x402-inbox.md获取收件箱专属流程细节
Genesis Lifecycle
Genesis生命周期
Agent identity and reputation on Bitcoin and Stacks:
- L0: Local agent key generation
- L1: Dual-chain plain-message signatures (btc_sign_message + stacks_sign_message)
- L2: X claim + BTC airdrop activation
- L3: On-chain identity registration via ERC-8004 (register_identity)
- L4: Reputation bootstrapping (get_reputation, give_feedback)
- Active: 5-minute check-ins to maintain reputation and liveness
See: references/genesis-lifecycle.md
比特币与Stacks上的Agent身份与声誉:
- L0:本地Agent密钥生成
- L1:双链明文消息签名(btc_sign_message + stacks_sign_message)
- L2:X声明 + BTC空投激活
- L3:通过ERC-8004进行链上身份注册(register_identity)
- L4:声誉引导(get_reputation, give_feedback)
- 活跃状态:每5分钟签到以维护声誉与在线状态
详见:references/genesis-lifecycle.md
Troubleshooting
故障排除
"Wallet not unlocked"
"钱包未解锁"
Run with your password before sending transactions.
wallet_unlock发送交易前,请执行并输入密码。
wallet_unlock"Insufficient balance"
"余额不足"
Check - you need enough BTC for amount + fees.
get_btc_balance调用查询——你需要足够的BTC来覆盖金额+手续费。
get_btc_balance"Invalid address"
"无效地址"
Ensure address matches network:
- Mainnet: starts with
bc1 - Testnet: starts with
tb1
See: references/troubleshooting.md
确保地址与网络匹配:
- 主网:以开头
bc1 - 测试网:以开头
tb1
详见:references/troubleshooting.md
More Information
更多信息
This skill follows the Agent Skills open specification.