AIBTC Bitcoin Wallet
A skill for managing Bitcoin L1 wallets with optional Pillar smart wallet and Stacks L2 DeFi capabilities.
Install
One-command installation:
CODEBLOCK0
For testnet:
CODEBLOCK1
Quick Start
Check Balance
Get your Bitcoin balance:
CODEBLOCK2
Uses get_btc_balance - returns total, confirmed, and unconfirmed balances.
Check Fees
Get current network fee estimates:
CODEBLOCK3
Uses get_btc_fees - returns fast (~10 min), medium (~30 min), and slow (~1 hr) rates in sat/vB.
Send BTC
Transfer Bitcoin to an address:
CODEBLOCK4
Uses transfer_btc - requires an unlocked wallet.
Wallet Setup
Before sending transactions, set up a wallet:
- 1. Create new wallet:
wallet_create - generates encrypted BIP39 mnemonic - Import existing:
wallet_import - import from mnemonic phrase - Unlock for use:
wallet_unlock - required before transactions
Wallets are stored encrypted at ~/.aibtc/.
Tool Reference
Read Operations
| Tool | Description | Parameters |
|---|
| INLINECODE7 | Get BTC balance | INLINECODE8 (optional; requires unlocked wallet if omitted) |
| INLINECODE9 |
Get fee estimates | None |
|
get_btc_utxos | List UTXOs |
address (optional; requires unlocked wallet if omitted),
confirmedOnly |
Write Operations (Wallet Required)
| Tool | Description | Parameters |
|---|
| INLINECODE13 | Send BTC | INLINECODE14 , amount (sats), INLINECODE16 |
Wallet Management
| Tool | Description |
|---|
| INLINECODE17 | Generate new encrypted wallet |
| INLINECODE18 |
Import wallet from mnemonic |
|
wallet_unlock | Unlock wallet for transactions |
|
wallet_lock | Lock wallet (clear from memory) |
|
wallet_list | List available wallets |
|
wallet_switch | Switch active wallet |
|
wallet_status | Get wallet/session status |
Units and Addresses
Amounts: Always in satoshis (1 BTC = 100,000,000 satoshis)
Addresses:
- - Mainnet:
bc1... (native SegWit) - Testnet: INLINECODE25
Fee Rates: "fast", "medium", "slow", or custom sat/vB number
Example Workflows
Daily Balance Check
CODEBLOCK5
Send Payment
CODEBLOCK6
Multi-Wallet Management
CODEBLOCK7
Progressive Layers
This skill focuses on Bitcoin L1. Additional capabilities are organized by layer:
Stacks L2 (Layer 2)
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
Pillar Smart Wallet (Layer 3)
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
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
x402 Paid APIs
Pay-per-use APIs with automatic micropayments on Stacks L2:
- - Discover available endpoints with INLINECODE29
- Check cost before paying with INLINECODE30
- Execute endpoints with
execute_x402_endpoint (safe-by-default — probes first) - Send inbox messages with
send_inbox_message (use this instead of executex402endpoint for inbox) - Build new x402 APIs with
scaffold_x402_endpoint and INLINECODE34
Always probe before executing paid endpoints. Never call execute_x402_endpoint with autoApprove: true without checking cost first.
sendinboxmessage — dedicated tool for aibtc.com inbox messages:
- - Parameters:
recipientBtcAddress (bc1...), recipientStxAddress (SP...), content (max 500 chars), paymentTxid (optional) - Uses sponsored transactions: sender pays only the sBTC message cost, relay covers STX gas
- Avoids sBTC settlement timeout issues that affect the generic executex402endpoint 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
Genesis Lifecycle
Agent identity and reputation on Bitcoin and Stacks:
- - L0: Local agent key generation
- L1: Dual-chain plain-message signatures (btcsignmessage + stackssignmessage)
- L2: X claim + BTC airdrop activation
- L3: On-chain identity registration via ERC-8004 (registeridentity)
- L4: Reputation bootstrapping (getreputation, give_feedback)
- Active: 5-minute check-ins to maintain reputation and liveness
See: references/genesis-lifecycle.md
Troubleshooting
"Wallet not unlocked"
Run wallet_unlock with your password before sending transactions.
"Insufficient balance"
Check get_btc_balance - you need enough BTC for amount + fees.
"Invalid address"
Ensure address matches network:
- - Mainnet: starts with INLINECODE43
- Testnet: starts with INLINECODE44
See: references/troubleshooting.md
More Information
This skill follows the Agent Skills open specification.
AIBTC 比特币钱包
用于管理比特币L1钱包的技能,可选配Pillar智能钱包和Stacks L2 DeFi功能。
安装
一键安装:
bash
npx @aibtc/mcp-server@latest --install
测试网络:
bash
npx @aibtc/mcp-server@latest --install --testnet
快速开始
查询余额
获取比特币余额:
我的BTC余额是多少?
使用 getbtcbalance - 返回总余额、已确认余额和未确认余额。
查询手续费
获取当前网络手续费估算:
当前比特币手续费是多少?
使用 getbtcfees - 返回快速(约10分钟)、中等(约30分钟)和慢速(约1小时)费率,单位为 sat/vB。
发送BTC
向地址转账比特币:
向 bc1q... 发送 50000 聪
以快速手续费向 bc1q... 转账 0.001 BTC
使用 transfer_btc - 需要钱包已解锁。
钱包设置
在发送交易前,请先设置钱包:
- 1. 创建新钱包:walletcreate - 生成加密的BIP39助记词
- 导入现有钱包:walletimport - 通过助记词短语导入
- 解锁使用:wallet_unlock - 交易前必须执行
钱包加密存储在 ~/.aibtc/ 目录下。
工具参考
读取操作
| 工具 | 描述 | 参数 |
|---|
| getbtcbalance | 获取BTC余额 | address(可选;省略时需要已解锁钱包) |
| getbtcfees |
获取手续费估算 | 无 |
| get
btcutxos | 列出UTXO | address(可选;省略时需要已解锁钱包),confirmedOnly |
写入操作(需要钱包)
| 工具 | 描述 | 参数 |
|---|
| transfer_btc | 发送BTC | recipient,amount(聪),feeRate |
钱包管理
| 工具 | 描述 |
|---|
| walletcreate | 生成新的加密钱包 |
| walletimport |
从助记词导入钱包 |
| wallet_unlock | 解锁钱包以进行交易 |
| wallet_lock | 锁定钱包(从内存中清除) |
| wallet_list | 列出可用钱包 |
| wallet_switch | 切换活动钱包 |
| wallet_status | 获取钱包/会话状态 |
单位和地址
金额:始终以聪为单位(1 BTC = 100,000,000 聪)
地址:
- - 主网:bc1...(原生SegWit)
- 测试网:tb1...
费率:fast、medium、slow 或自定义 sat/vB 数值
示例工作流
每日余额检查
- 1. 我的BTC余额是多少?
- 显示我最近的UTXO
- 当前手续费是多少?
发送付款
- 1. 解锁我的钱包(提供密码)
- 以中等手续费向 bc1qxyz... 发送 100000 聪
- 锁定我的钱包
多钱包管理
- 1. 列出我的钱包
- 切换到交易钱包
- 解锁它
- 检查余额
渐进式层级
本技能专注于比特币L1。附加功能按层级组织:
Stacks L2(第二层)
支持智能合约和DeFi的比特币L2:
- - STX代币转账
- ALEX DEX代币交换
- Zest Protocol借贷
- x402付费API端点(AI、存储、实用工具)——默认安全,采用先探测后支付的工作流
参见:references/stacks-defi.md
Pillar智能钱包(第三层)
支持收益自动化的sBTC智能钱包:
- - 通行密钥或代理签名交易
- 发送至BNS名称(alice.btc)
- 通过Zest Protocol自动提升收益
参见:references/pillar-wallet.md
比特币铭文
在比特币上铭刻和检索数字艺术品:
- - 提交-揭示铭文工作流
- 获取铭文内容和元数据
- 保护序数UTXO免于意外花费
参见:references/inscription-workflow.md
x402付费API
按使用付费的API,在Stacks L2上自动进行微支付:
- - 使用 listx402endpoints 发现可用端点
- 使用 probex402endpoint 在支付前检查费用
- 使用 executex402endpoint 执行端点(默认安全——先探测)
- 使用 sendinboxmessage 发送收件箱消息(对于收件箱,请使用此工具而非 executex402endpoint)
- 使用 scaffoldx402endpoint 和 scaffoldx402ai_endpoint 构建新的x402 API
在执行付费端点前务必先探测。未经检查费用,切勿使用 autoApprove: true 调用 executex402endpoint。
sendinboxmessage —— 专用于 aibtc.com 收件箱消息的工具:
- - 参数:recipientBtcAddress(bc1...)、recipientStxAddress(SP...)、content(最多500字符)、paymentTxid(可选)
- 使用赞助交易:发送方仅支付sBTC消息费用,中继方承担STX燃料费
- 避免影响通用 executex402endpoint 工具的sBTC结算超时问题
- 实现完整的5步x402 v2支付流程,包含余额预检查
- paymentTxid(可选):提供已确认的链上sBTC转账交易ID,以跳过x402流程并使用该交易ID作为支付证明交付消息——用于结算超时导致sBTC支付已在链上确认但消息未送达时的手动恢复
- 自动恢复:如果重试耗尽,工具会检查是否有已提交的支付交易ID在链上确认,如果是,则自动重新提交消息——无需代理操作
参见:references/stacks-defi.md 获取端点目录
参见:references/x402-inbox.md 获取收件箱特定流程详情
创世生命周期
比特币和Stacks上的代理身份和声誉:
- - L0:本地代理密钥生成
- L1:双链明文消息签名(btcsignmessage + stackssignmessage)
- L2:X声明 + BTC空投激活
- L3:通过ERC-8004进行链上身份注册(registeridentity)
- L4:声誉引导(getreputation、give_feedback)
- 活跃:每5分钟签到以维护声誉和活跃度
参见:references/genesis-lifecycle.md
故障排除
钱包未解锁
在发送交易前,使用密码运行 wallet_unlock。
余额不足
检查 getbtcbalance —— 您需要足够的BTC来支付金额+手续费。
无效地址
确保地址与网络匹配:
- - 主网:以 bc1 开头
- 测试网:以 tb1 开头
参见:references/troubleshooting.md
更多信息
本技能遵循 Agent Skills 开放规范。