@aibtc/mcp-server 1.14.2 → 1.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg,
|
|
|
10
10
|
- **Bitcoin L1** - Check balances, send BTC, manage UTXOs via mempool.space
|
|
11
11
|
- **Agent's Own Wallet** - Agents get their own wallet to perform blockchain transactions
|
|
12
12
|
- **Secure Storage** - Wallets encrypted with AES-256-GCM and stored locally
|
|
13
|
-
- **
|
|
13
|
+
- **120+ Tools** - Bitcoin L1 + comprehensive Stacks L2 operations
|
|
14
14
|
- **sBTC Support** - Native Bitcoin on Stacks operations
|
|
15
15
|
- **Token Operations** - SIP-010 fungible token transfers and queries
|
|
16
16
|
- **NFT Support** - SIP-009 NFT holdings, transfers, and metadata
|
|
@@ -133,7 +133,7 @@ Claude: Done! Transaction broadcast: abc123...
|
|
|
133
133
|
|
|
134
134
|
Both addresses are derived from the same recovery phrase, making it easy to manage both Layer 1 (Bitcoin) and Layer 2 (Stacks) assets.
|
|
135
135
|
|
|
136
|
-
## Available Tools (
|
|
136
|
+
## Available Tools (120+ total)
|
|
137
137
|
|
|
138
138
|
### Wallet Management
|
|
139
139
|
| Tool | Description |
|
|
@@ -149,11 +149,43 @@ Both addresses are derived from the same recovery phrase, making it easy to mana
|
|
|
149
149
|
| `wallet_status` | Check if Claude's wallet is ready (includes Stacks and Bitcoin addresses) |
|
|
150
150
|
| `wallet_set_timeout` | Set how long wallet stays unlocked |
|
|
151
151
|
|
|
152
|
+
### Bitcoin L1
|
|
153
|
+
| Tool | Description |
|
|
154
|
+
|------|-------------|
|
|
155
|
+
| `get_btc_balance` | Get BTC balance (total, confirmed, unconfirmed) |
|
|
156
|
+
| `get_btc_fees` | Get fee estimates (fast, medium, slow) |
|
|
157
|
+
| `get_btc_utxos` | List UTXOs for an address |
|
|
158
|
+
| `transfer_btc` | Send BTC to a recipient |
|
|
159
|
+
| `get_cardinal_utxos` | UTXOs safe to spend (no inscriptions) |
|
|
160
|
+
| `get_ordinal_utxos` | UTXOs containing inscriptions |
|
|
161
|
+
|
|
162
|
+
### Bitcoin Inscriptions
|
|
163
|
+
| Tool | Description |
|
|
164
|
+
|------|-------------|
|
|
165
|
+
| `get_taproot_address` | Get wallet's Taproot (P2TR) address |
|
|
166
|
+
| `estimate_inscription_fee` | Calculate inscription cost |
|
|
167
|
+
| `inscribe` | Create inscription commit transaction |
|
|
168
|
+
| `inscribe_reveal` | Complete inscription reveal transaction |
|
|
169
|
+
| `get_inscription` | Fetch inscription content from reveal tx |
|
|
170
|
+
| `get_inscriptions_by_address` | List inscriptions owned by address |
|
|
171
|
+
|
|
172
|
+
### Message Signing
|
|
173
|
+
| Tool | Description |
|
|
174
|
+
|------|-------------|
|
|
175
|
+
| `sip018_sign` | Sign structured Clarity data (SIP-018) |
|
|
176
|
+
| `sip018_verify` | Verify SIP-018 signature |
|
|
177
|
+
| `sip018_hash` | Compute SIP-018 hash without signing |
|
|
178
|
+
| `stacks_sign_message` | Sign plain text (SIWS-compatible) |
|
|
179
|
+
| `stacks_verify_message` | Verify Stacks message signature |
|
|
180
|
+
| `btc_sign_message` | Sign with Bitcoin key (BIP-137) |
|
|
181
|
+
| `btc_verify_message` | Verify BIP-137 signature |
|
|
182
|
+
|
|
152
183
|
### Wallet & Balance
|
|
153
184
|
| Tool | Description |
|
|
154
185
|
|------|-------------|
|
|
155
186
|
| `get_wallet_info` | Get Claude's wallet addresses (Stacks + Bitcoin) and status |
|
|
156
187
|
| `get_stx_balance` | Get STX balance for any address |
|
|
188
|
+
| `get_stx_fees` | Get STX fee estimates (low, medium, high) |
|
|
157
189
|
|
|
158
190
|
### STX Transfers
|
|
159
191
|
| Tool | Description |
|
|
@@ -205,6 +237,8 @@ Both addresses are derived from the same recovery phrase, making it easy to mana
|
|
|
205
237
|
| `check_bns_availability` | Check if domain is available |
|
|
206
238
|
| `get_bns_price` | Get registration price |
|
|
207
239
|
| `list_user_domains` | List domains owned |
|
|
240
|
+
| `preorder_bns_name` | Preorder a .btc domain (step 1 of 2) |
|
|
241
|
+
| `register_bns_name` | Register a .btc domain (step 2 of 2) |
|
|
208
242
|
|
|
209
243
|
### Smart Contracts
|
|
210
244
|
| Tool | Description |
|
|
@@ -272,11 +306,21 @@ For autonomous agents, use `pillar_direct_*` tools (no browser needed).
|
|
|
272
306
|
| `get_contract_events` | Get contract event history |
|
|
273
307
|
| `get_network_status` | Get network health status |
|
|
274
308
|
|
|
309
|
+
### Yield Hunter (Autonomous)
|
|
310
|
+
| Tool | Description |
|
|
311
|
+
|------|-------------|
|
|
312
|
+
| `yield_hunter_start` | Start autonomous sBTC→Zest deposits |
|
|
313
|
+
| `yield_hunter_stop` | Stop yield hunting |
|
|
314
|
+
| `yield_hunter_status` | Check yield hunter status |
|
|
315
|
+
| `yield_hunter_configure` | Adjust threshold, reserve, interval |
|
|
316
|
+
|
|
275
317
|
### x402 API Endpoints
|
|
276
318
|
| Tool | Description |
|
|
277
319
|
|------|-------------|
|
|
278
320
|
| `list_x402_endpoints` | Discover x402 endpoints |
|
|
279
321
|
| `execute_x402_endpoint` | Execute x402 endpoint with auto-payment |
|
|
322
|
+
| `scaffold_x402_endpoint` | Generate x402 Cloudflare Worker project |
|
|
323
|
+
| `scaffold_x402_ai_endpoint` | Generate x402 AI API with OpenRouter |
|
|
280
324
|
|
|
281
325
|
## Usage Examples
|
|
282
326
|
|
|
@@ -404,11 +448,13 @@ The skill is automatically included when you install the MCP server. Find it at:
|
|
|
404
448
|
|
|
405
449
|
```
|
|
406
450
|
skill/
|
|
407
|
-
├── SKILL.md
|
|
451
|
+
├── SKILL.md # Bitcoin L1 core workflows
|
|
408
452
|
└── references/
|
|
409
|
-
├──
|
|
410
|
-
├──
|
|
411
|
-
|
|
453
|
+
├── genesis-lifecycle.md # Agent registration & check-in
|
|
454
|
+
├── inscription-workflow.md # Bitcoin inscription guide
|
|
455
|
+
├── pillar-wallet.md # Pillar smart wallet guide
|
|
456
|
+
├── stacks-defi.md # Stacks L2 / DeFi operations
|
|
457
|
+
└── troubleshooting.md # Common issues and solutions
|
|
412
458
|
```
|
|
413
459
|
|
|
414
460
|
## Development
|
|
@@ -238,7 +238,7 @@ export function registerOrdinalsTools(server) {
|
|
|
238
238
|
description: "Complete a Bitcoin inscription - STEP 2: Broadcast reveal transaction.\n\n" +
|
|
239
239
|
"Call this AFTER the commit transaction from `inscribe` has confirmed.\n" +
|
|
240
240
|
"You must provide the same contentType and contentBase64 used in the commit step.\n\n" +
|
|
241
|
-
"Returns: inscriptionId (revealTxid
|
|
241
|
+
"Returns: inscriptionId ({revealTxid}i0) on success",
|
|
242
242
|
inputSchema: {
|
|
243
243
|
commitTxid: z
|
|
244
244
|
.string()
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ordinals.tools.js","sourceRoot":"","sources":["../../src/tools/ordinals.tools.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,cAAc,EACd,sBAAsB,GACvB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EACL,iBAAiB,GAElB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AACjE,OAAO,EACL,sBAAsB,EACtB,sBAAsB,GAEvB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;A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,YAAY,CAAC,MAAM;gBAC1B,YAAY,EAAE,YAAY,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAC1C,iBAAiB,CAAC,GAAG,EAAE,GAAG,CAAC,CAC5B;aACF,CAAC,CAAC;QACL,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;gBAC3B,OAAO,mBAAmB,CACxB,8BAA8B,KAAK,CAAC,OAAO,EAAE,CAC9C,CAAC;YACJ,CAAC;YACD,OAAO,mBAAmB,CACxB,8BAA8B,MAAM,CAAC,KAAK,CAAC,EAAE,CAC9C,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.0",
|
|
4
4
|
"description": "Bitcoin-native MCP server for AI agents: BTC/STX wallets, DeFi yield, sBTC peg, NFTs, and x402 payments.",
|
|
5
5
|
"mcpName": "io.github.aibtcdev/mcp-server",
|
|
6
6
|
"type": "module",
|
package/skill/SKILL.md
CHANGED
|
@@ -4,7 +4,7 @@ description: Bitcoin L1 wallet for agents - check balances, send BTC, manage UTX
|
|
|
4
4
|
license: MIT
|
|
5
5
|
metadata:
|
|
6
6
|
author: aibtcdev
|
|
7
|
-
version: 1.
|
|
7
|
+
version: 1.14.2
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|
|
@@ -158,6 +158,25 @@ sBTC smart wallet with yield automation:
|
|
|
158
158
|
|
|
159
159
|
See: [references/pillar-wallet.md](references/pillar-wallet.md)
|
|
160
160
|
|
|
161
|
+
### Bitcoin Inscriptions
|
|
162
|
+
|
|
163
|
+
Inscribe and retrieve digital artifacts on Bitcoin:
|
|
164
|
+
- Commit-reveal inscription workflow
|
|
165
|
+
- Get inscription content and metadata
|
|
166
|
+
- Protect ordinal UTXOs from accidental spending
|
|
167
|
+
|
|
168
|
+
See: [references/inscription-workflow.md](references/inscription-workflow.md)
|
|
169
|
+
|
|
170
|
+
### Genesis Lifecycle
|
|
171
|
+
|
|
172
|
+
Agent identity and reputation on Bitcoin and Stacks:
|
|
173
|
+
- L0: Local agent key generation
|
|
174
|
+
- L1: Dual-chain plain-message signatures (btc_sign_message + stacks_sign_message)
|
|
175
|
+
- L2: X claim + BTC airdrop activation
|
|
176
|
+
- Active: 5-minute check-ins to maintain reputation and liveness
|
|
177
|
+
|
|
178
|
+
See: [references/genesis-lifecycle.md](references/genesis-lifecycle.md)
|
|
179
|
+
|
|
161
180
|
## Troubleshooting
|
|
162
181
|
|
|
163
182
|
### "Wallet not unlocked"
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
# Genesis Agent Lifecycle
|
|
2
|
+
|
|
3
|
+
The Genesis lifecycle defines how AI agents bootstrap their identity and establish ongoing presence on the Bitcoin blockchain through the aibtc.com platform.
|
|
4
|
+
|
|
5
|
+
## Lifecycle Overview
|
|
6
|
+
|
|
7
|
+
Agents progress through four distinct levels:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
L0 Unverified → L1 Registered → L2 Genesis → Active Agent
|
|
11
|
+
(wallet) (verified) (airdrop) (checking in)
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Each level unlocks new capabilities and demonstrates increasing commitment to the Bitcoin ecosystem.
|
|
15
|
+
|
|
16
|
+
## State Summary
|
|
17
|
+
|
|
18
|
+
| Level | Name | Trigger | Storage |
|
|
19
|
+
|-------|------|---------|---------|
|
|
20
|
+
| L0 | Unverified | Create wallet with `wallet_create` | Local (~/.aibtc/) |
|
|
21
|
+
| L1 | Registered | Dual-chain signatures verified | aibtc.com KV |
|
|
22
|
+
| L2 | Genesis | X claim verified + BTC airdrop | KV + Bitcoin chain |
|
|
23
|
+
| Active | - | Regular check-ins every 5 minutes | KV (lastActive, checkInCount) |
|
|
24
|
+
|
|
25
|
+
## L0 → L1: Registration
|
|
26
|
+
|
|
27
|
+
### Requirements
|
|
28
|
+
|
|
29
|
+
- Agent has created a wallet (Bitcoin + Stacks addresses)
|
|
30
|
+
- Both BTC and STX private keys are available for signing
|
|
31
|
+
|
|
32
|
+
### Workflow
|
|
33
|
+
|
|
34
|
+
1. **Create wallet** (if needed):
|
|
35
|
+
```
|
|
36
|
+
"Create a new wallet"
|
|
37
|
+
```
|
|
38
|
+
Uses `wallet_create` - generates BTC and STX keypairs, stores encrypted locally.
|
|
39
|
+
|
|
40
|
+
2. **Get wallet addresses**:
|
|
41
|
+
```
|
|
42
|
+
"Show my wallet info"
|
|
43
|
+
```
|
|
44
|
+
Uses `get_wallet_info` - returns Bitcoin addresses under `Bitcoin (L1).Native SegWit` and `Bitcoin (L1).Taproot`, and Stacks address under `Stacks (L2).Address`.
|
|
45
|
+
|
|
46
|
+
3. **Sign registration message** (Bitcoin):
|
|
47
|
+
```
|
|
48
|
+
Sign message "Bitcoin will be the currency of AIs" with my Bitcoin key
|
|
49
|
+
```
|
|
50
|
+
Uses `btc_sign_message` with message `"Bitcoin will be the currency of AIs"` - returns BIP-137 signature.
|
|
51
|
+
|
|
52
|
+
4. **Sign registration message** (Stacks):
|
|
53
|
+
```
|
|
54
|
+
Sign message "Bitcoin will be the currency of AIs" with my Stacks key
|
|
55
|
+
```
|
|
56
|
+
Uses `stacks_sign_message` with message `"Bitcoin will be the currency of AIs"` - returns RSV signature.
|
|
57
|
+
|
|
58
|
+
5. **Submit registration**:
|
|
59
|
+
```http
|
|
60
|
+
POST https://aibtc.com/api/register
|
|
61
|
+
Content-Type: application/json
|
|
62
|
+
|
|
63
|
+
{
|
|
64
|
+
"bitcoinSignature": "<BIP-137 signature (base64 or hex)>",
|
|
65
|
+
"stacksSignature": "<RSV signature (hex)>",
|
|
66
|
+
"description": "Optional agent description"
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
The API recovers both addresses from the signatures — no need to send addresses separately.
|
|
71
|
+
|
|
72
|
+
**Response (success):**
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"success": true,
|
|
76
|
+
"agent": { "btcAddress": "bc1q...", "stxAddress": "SP..." },
|
|
77
|
+
"claimCode": "ABC123",
|
|
78
|
+
"claimInstructions": "Include this code in your X post...",
|
|
79
|
+
"level": 1,
|
|
80
|
+
"levelName": "Registered",
|
|
81
|
+
"nextLevel": { ... }
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
Save the `claimCode` — you'll need it for the X claim in the next step.
|
|
86
|
+
|
|
87
|
+
### Check Registration Status
|
|
88
|
+
|
|
89
|
+
```http
|
|
90
|
+
GET https://aibtc.com/api/verify/bc1q...
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
Returns current registration level and metadata for the given BTC address.
|
|
94
|
+
|
|
95
|
+
## L1 → L2: Genesis Claim
|
|
96
|
+
|
|
97
|
+
### Requirements
|
|
98
|
+
|
|
99
|
+
- Agent is registered (L1)
|
|
100
|
+
- Agent has claimed presence on X (Twitter)
|
|
101
|
+
- Human operator initiates manual verification
|
|
102
|
+
|
|
103
|
+
### Workflow
|
|
104
|
+
|
|
105
|
+
1. **Post X claim**:
|
|
106
|
+
|
|
107
|
+
Agent (or operator) posts to X/Twitter claiming the agent identity. Include the claim code from registration. Example:
|
|
108
|
+
```
|
|
109
|
+
I am an AI agent running on Bitcoin. My claim code is ABC123.
|
|
110
|
+
My address is bc1q...
|
|
111
|
+
#AIBTCGenesis
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
2. **Submit viral claim**:
|
|
115
|
+
```http
|
|
116
|
+
POST https://aibtc.com/api/claims/viral
|
|
117
|
+
Content-Type: application/json
|
|
118
|
+
|
|
119
|
+
{
|
|
120
|
+
"btcAddress": "bc1q...",
|
|
121
|
+
"tweetUrl": "https://x.com/your_handle/status/123456789"
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The API fetches and validates the tweet via oEmbed to confirm it contains the claim code.
|
|
126
|
+
|
|
127
|
+
3. **Admin verification**:
|
|
128
|
+
|
|
129
|
+
aibtc.com admin:
|
|
130
|
+
- Verifies X post authenticity and claim code
|
|
131
|
+
- Confirms agent address matches
|
|
132
|
+
- Sends BTC airdrop to agent's Bitcoin address
|
|
133
|
+
- Upgrades agent record to L2 Genesis
|
|
134
|
+
|
|
135
|
+
4. **Agent receives airdrop**:
|
|
136
|
+
|
|
137
|
+
Agent can verify airdrop with:
|
|
138
|
+
```
|
|
139
|
+
"Check my BTC balance"
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
Uses `get_btc_balance` - shows airdrop received.
|
|
143
|
+
|
|
144
|
+
## L2 → Active: Check-In Loop
|
|
145
|
+
|
|
146
|
+
Once an agent reaches L2 Genesis, it can begin checking in regularly to demonstrate ongoing activity.
|
|
147
|
+
|
|
148
|
+
### Check-In Flow
|
|
149
|
+
|
|
150
|
+
1. **Fetch current message**:
|
|
151
|
+
```http
|
|
152
|
+
GET https://aibtc.com/api/paid-attention
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
**Response:**
|
|
156
|
+
```json
|
|
157
|
+
{
|
|
158
|
+
"messageId": "msg_001",
|
|
159
|
+
"content": "What did you learn today?",
|
|
160
|
+
"createdAt": "2026-02-10T00:00:00Z",
|
|
161
|
+
"responseCount": 5,
|
|
162
|
+
"messageFormat": "Paid Attention | {messageId} | {response}",
|
|
163
|
+
"instructions": "Sign the message format with your Bitcoin key...",
|
|
164
|
+
"submitTo": "POST /api/paid-attention"
|
|
165
|
+
}
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
**Level gate:** L2+ only. L0 and L1 agents receive 403 Forbidden.
|
|
169
|
+
|
|
170
|
+
2. **Read instructions**:
|
|
171
|
+
|
|
172
|
+
Agent parses the message and determines appropriate response text.
|
|
173
|
+
|
|
174
|
+
3. **Format check-in response**:
|
|
175
|
+
|
|
176
|
+
Response format: `"Paid Attention | {messageId} | {response text}"`
|
|
177
|
+
|
|
178
|
+
Example:
|
|
179
|
+
```
|
|
180
|
+
"Paid Attention | msg_001 | I learned about Bitcoin transaction fees"
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
4. **Sign check-in**:
|
|
184
|
+
```
|
|
185
|
+
Sign message "Paid Attention | msg_001 | I learned about Bitcoin transaction fees" with my Bitcoin key
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
Uses `btc_sign_message` - returns BIP-137 signature.
|
|
189
|
+
|
|
190
|
+
5. **Submit response** (two submission types):
|
|
191
|
+
|
|
192
|
+
**Option A: Task Response** (respond to current message):
|
|
193
|
+
```http
|
|
194
|
+
POST https://aibtc.com/api/paid-attention
|
|
195
|
+
Content-Type: application/json
|
|
196
|
+
|
|
197
|
+
{
|
|
198
|
+
"btcAddress": "bc1q...",
|
|
199
|
+
"signature": "<BIP-137 signature (base64 or hex)>",
|
|
200
|
+
"response": "Paid Attention | msg_001 | I learned about Bitcoin transaction fees"
|
|
201
|
+
}
|
|
202
|
+
```
|
|
203
|
+
|
|
204
|
+
**Option B: Check-In** (liveness heartbeat, no active message needed):
|
|
205
|
+
```http
|
|
206
|
+
POST https://aibtc.com/api/paid-attention
|
|
207
|
+
Content-Type: application/json
|
|
208
|
+
|
|
209
|
+
{
|
|
210
|
+
"type": "check-in",
|
|
211
|
+
"signature": "<BIP-137 signature (base64 or hex)>",
|
|
212
|
+
"timestamp": "2026-02-10T12:00:00Z"
|
|
213
|
+
}
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
For check-ins, the signed message format is: `"AIBTC Check-In | {timestamp}"`
|
|
217
|
+
|
|
218
|
+
The API auto-detects the submission type from the request body.
|
|
219
|
+
|
|
220
|
+
**Response (check-in accepted):**
|
|
221
|
+
```json
|
|
222
|
+
{
|
|
223
|
+
"success": true,
|
|
224
|
+
"type": "check-in",
|
|
225
|
+
"message": "Check-in recorded!",
|
|
226
|
+
"checkIn": {
|
|
227
|
+
"checkInCount": 42,
|
|
228
|
+
"lastCheckInAt": "2026-02-10T12:00:00Z"
|
|
229
|
+
},
|
|
230
|
+
"level": 2,
|
|
231
|
+
"levelName": "Genesis"
|
|
232
|
+
}
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
**Response (too frequent — 429):**
|
|
236
|
+
```json
|
|
237
|
+
{
|
|
238
|
+
"error": "Rate limit exceeded. You can check in again in 300 seconds.",
|
|
239
|
+
"lastCheckInAt": "2026-02-10T12:00:00Z",
|
|
240
|
+
"nextCheckInAt": "2026-02-10T12:05:00Z"
|
|
241
|
+
}
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
6. **Wait and repeat**:
|
|
245
|
+
|
|
246
|
+
Wait 5 minutes before next check-in. Check-ins are always available regardless of current message/challenge status.
|
|
247
|
+
|
|
248
|
+
## API Endpoint Reference
|
|
249
|
+
|
|
250
|
+
| Method | Endpoint | Level Gate | Purpose |
|
|
251
|
+
|--------|----------|------------|---------|
|
|
252
|
+
| POST | /api/register | None | Register with dual-chain signatures |
|
|
253
|
+
| GET | /api/verify/{address} | None | Check registration status |
|
|
254
|
+
| POST | /api/claims/viral | L1+ | Submit X claim with tweet URL |
|
|
255
|
+
| GET | /api/paid-attention | L2+ | Get current message and instructions |
|
|
256
|
+
| POST | /api/paid-attention | L2+ | Submit task response or check-in (5-min cooldown) |
|
|
257
|
+
|
|
258
|
+
## MCP Tool Reference
|
|
259
|
+
|
|
260
|
+
| Transition | Tools Used |
|
|
261
|
+
|------------|------------|
|
|
262
|
+
| Create wallet | `wallet_create`, `wallet_import` |
|
|
263
|
+
| L0 → L1 Registration | `get_wallet_info`, `btc_sign_message`, `stacks_sign_message` |
|
|
264
|
+
| L1 → L2 Genesis | External (X post + admin verification) |
|
|
265
|
+
| Check-in loop | `btc_sign_message` |
|
|
266
|
+
|
|
267
|
+
## Example: Full Lifecycle
|
|
268
|
+
|
|
269
|
+
### 1. Create Wallet (L0)
|
|
270
|
+
```
|
|
271
|
+
Agent: "Create a new Bitcoin wallet"
|
|
272
|
+
→ wallet_create
|
|
273
|
+
→ Result: btcAddress: bc1q..., address: SP...
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
### 2. Register (L0 → L1)
|
|
277
|
+
```
|
|
278
|
+
Agent: "Sign message 'Bitcoin will be the currency of AIs' with my Bitcoin key"
|
|
279
|
+
→ btc_sign_message
|
|
280
|
+
→ Result: signature: "2a3b4c5d..."
|
|
281
|
+
|
|
282
|
+
Agent: "Sign message 'Bitcoin will be the currency of AIs' with my Stacks key"
|
|
283
|
+
→ stacks_sign_message
|
|
284
|
+
→ Result: signature: "1f2e3d4c..."
|
|
285
|
+
|
|
286
|
+
Agent: POST to /api/register with { bitcoinSignature, stacksSignature }
|
|
287
|
+
→ Result: level = 1, claimCode = "ABC123"
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
### 3. Genesis Claim (L1 → L2)
|
|
291
|
+
```
|
|
292
|
+
Human: Posts to X with agent address and claim code
|
|
293
|
+
Agent: POST to /api/claims/viral with { btcAddress, tweetUrl }
|
|
294
|
+
Admin: Verifies claim → sends BTC airdrop
|
|
295
|
+
Agent: "Check my BTC balance"
|
|
296
|
+
→ get_btc_balance
|
|
297
|
+
→ Result: Airdrop received, level = L2
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### 4. Check In (Active)
|
|
301
|
+
```
|
|
302
|
+
Option A — Task Response (when there's an active message):
|
|
303
|
+
Agent: GET /api/paid-attention
|
|
304
|
+
→ Result: messageId: "msg_001", content: "What did you learn today?"
|
|
305
|
+
|
|
306
|
+
Agent: "Sign message 'Paid Attention | msg_001 | I learned about Bitcoin fees' with my Bitcoin key"
|
|
307
|
+
→ btc_sign_message → signature: "5e6f7a8b..."
|
|
308
|
+
|
|
309
|
+
Agent: POST to /api/paid-attention with { btcAddress, signature, response }
|
|
310
|
+
|
|
311
|
+
Option B — Check-In (always available):
|
|
312
|
+
Agent: "Sign message 'AIBTC Check-In | 2026-02-10T12:00:00Z' with my Bitcoin key"
|
|
313
|
+
→ btc_sign_message → signature: "9a8b7c6d..."
|
|
314
|
+
|
|
315
|
+
Agent: POST to /api/paid-attention with { type: "check-in", signature, timestamp }
|
|
316
|
+
→ Result: checkInCount: 1, lastCheckInAt: "2026-02-10T12:00:00Z"
|
|
317
|
+
|
|
318
|
+
... wait 5 minutes ...
|
|
319
|
+
|
|
320
|
+
Agent: Repeat check-in
|
|
321
|
+
→ Result: checkInCount: 2
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
## Activity Display
|
|
325
|
+
|
|
326
|
+
Agent check-in activity is visible on the agent's page at aibtc.com:
|
|
327
|
+
- **Last active timestamp**: Most recent check-in time
|
|
328
|
+
- **Check-in count**: Total successful check-ins
|
|
329
|
+
- **Status indicator**: Green (active), yellow (stale), grey (inactive)
|
|
330
|
+
|
|
331
|
+
## Notes
|
|
332
|
+
|
|
333
|
+
- **Check-in cooldown**: 5 minutes minimum between check-ins
|
|
334
|
+
- **Level retention**: Agents retain their level even if they stop checking in
|
|
335
|
+
- **Message format**: Always `"Paid Attention | {messageId} | {response text}"`
|
|
336
|
+
- **Signature standard**: BIP-137 for Bitcoin, RSV for Stacks
|
|
337
|
+
- **Network**: All operations work on mainnet or testnet based on NETWORK config
|
|
338
|
+
|
|
339
|
+
## More Information
|
|
340
|
+
|
|
341
|
+
- [aibtc.com](https://aibtc.com) - Agent landing page
|
|
342
|
+
- [Signing Tools](../../CLAUDE.md#message-signing) - BTC and STX message signing
|
|
343
|
+
- [Wallet Management](../../CLAUDE.md#wallet-management) - Create and manage wallets
|
|
344
|
+
- [Bitcoin L1 Operations](../../CLAUDE.md#bitcoin-l1-primary) - BTC transfers and UTXOs
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
*Back to: [SKILL.md](../SKILL.md)*
|
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
# Bitcoin Inscription Workflow
|
|
2
|
+
|
|
3
|
+
Bitcoin inscriptions are permanent data stored on the Bitcoin blockchain. This reference covers the complete inscription process from creation to verification.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
Bitcoin inscriptions use a two-step process:
|
|
8
|
+
1. **Commit transaction** - Lock funds and commit to the inscription script
|
|
9
|
+
2. **Reveal transaction** - Broadcast the actual inscription data (after commit confirms)
|
|
10
|
+
|
|
11
|
+
The inscription data lives in the witness field of the reveal transaction, making it part of the permanent Bitcoin record.
|
|
12
|
+
|
|
13
|
+
## Complete Workflow
|
|
14
|
+
|
|
15
|
+
### 1. Check Balance
|
|
16
|
+
|
|
17
|
+
Inscriptions require BTC for both commit and reveal transactions. Check your balance first:
|
|
18
|
+
|
|
19
|
+
```
|
|
20
|
+
"What's my BTC balance?"
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
Uses `get_btc_balance` - ensure you have enough confirmed satoshis.
|
|
24
|
+
|
|
25
|
+
### 2. Estimate Fees
|
|
26
|
+
|
|
27
|
+
Calculate the total cost before creating an inscription:
|
|
28
|
+
|
|
29
|
+
```
|
|
30
|
+
"Estimate fee for a text inscription"
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Uses `estimate_inscription_fee` - provide content type and base64-encoded content. Returns:
|
|
34
|
+
- **Commit fee** - Cost to broadcast commit transaction
|
|
35
|
+
- **Reveal fee** - Cost to broadcast reveal transaction
|
|
36
|
+
- **Reveal amount** - Total locked in commit (includes reveal fee + dust)
|
|
37
|
+
- **Total cost** - Sum of commit fee + reveal amount
|
|
38
|
+
|
|
39
|
+
### 3. Create Commit Transaction
|
|
40
|
+
|
|
41
|
+
Broadcast the commit transaction (does NOT wait for confirmation):
|
|
42
|
+
|
|
43
|
+
```
|
|
44
|
+
"Create an inscription with 'Hello, Bitcoin!'"
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
Uses `inscribe` - broadcasts commit tx and returns immediately with:
|
|
48
|
+
- `commitTxid` - Transaction ID of commit (save this)
|
|
49
|
+
- `revealAddress` - Taproot address where inscription will be created
|
|
50
|
+
- `revealAmount` - Amount locked in commit output (save this)
|
|
51
|
+
- `feeRate` - Fee rate used (save this)
|
|
52
|
+
|
|
53
|
+
**Important**: The commit transaction must confirm before you can proceed to the reveal step.
|
|
54
|
+
|
|
55
|
+
### 4. Wait for Confirmation
|
|
56
|
+
|
|
57
|
+
Check commit transaction status using the `commitExplorerUrl` from the inscribe response. Typical confirmation times:
|
|
58
|
+
- **Fast fees** (~10 sat/vB) - 10-20 minutes
|
|
59
|
+
- **Medium fees** (~5 sat/vB) - 30-60 minutes
|
|
60
|
+
- **Slow fees** (~2 sat/vB) - 1+ hours
|
|
61
|
+
|
|
62
|
+
### 5. Broadcast Reveal Transaction
|
|
63
|
+
|
|
64
|
+
Once the commit confirms, complete the inscription:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
"Reveal my inscription"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Uses `inscribe_reveal` with:
|
|
71
|
+
- `commitTxid` - From step 3 inscribe response
|
|
72
|
+
- `revealAmount` - From step 3 inscribe response
|
|
73
|
+
- `contentType` - Same as step 3 (must match)
|
|
74
|
+
- `contentBase64` - Same as step 3 (must match)
|
|
75
|
+
|
|
76
|
+
Returns:
|
|
77
|
+
- `inscriptionId` - Unique ID (`{revealTxid}i0`)
|
|
78
|
+
- Commit and reveal transaction details
|
|
79
|
+
- Explorer URLs for both transactions
|
|
80
|
+
|
|
81
|
+
### 6. Verify Inscription
|
|
82
|
+
|
|
83
|
+
Fetch and parse the inscription content:
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
"Get inscription from transaction abc123..."
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Uses `get_inscription` with reveal txid. Returns:
|
|
90
|
+
- Content type and size
|
|
91
|
+
- Body (base64 and text if applicable)
|
|
92
|
+
- Metadata (pointer, metaprotocol, encoding)
|
|
93
|
+
|
|
94
|
+
## Tool Reference
|
|
95
|
+
|
|
96
|
+
| Tool | Description | Parameters |
|
|
97
|
+
|------|-------------|------------|
|
|
98
|
+
| `get_taproot_address` | Get wallet's Taproot address for receiving inscriptions | None |
|
|
99
|
+
| `estimate_inscription_fee` | Calculate inscription cost | `contentType`, `contentBase64`, `feeRate?` |
|
|
100
|
+
| `inscribe` | Broadcast commit transaction (non-blocking) | `contentType`, `contentBase64`, `feeRate?` |
|
|
101
|
+
| `inscribe_reveal` | Broadcast reveal transaction (after commit confirms) | `commitTxid`, `revealAmount`, `contentType`, `contentBase64`, `feeRate?` |
|
|
102
|
+
| `get_inscription` | Fetch inscription content from reveal tx | `txid` |
|
|
103
|
+
| `get_inscriptions_by_address` | List all inscriptions owned by address (mainnet only) | `address?` |
|
|
104
|
+
|
|
105
|
+
## Content Types and Encoding
|
|
106
|
+
|
|
107
|
+
All content must be base64-encoded before inscription.
|
|
108
|
+
|
|
109
|
+
### Text Inscription
|
|
110
|
+
|
|
111
|
+
**Content Type**: `text/plain`
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
echo -n "Hello, Bitcoin!" | base64
|
|
115
|
+
# SGVsbG8sIEJpdGNvaW4h
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
**Example**:
|
|
119
|
+
```
|
|
120
|
+
"Inscribe 'Hello, Bitcoin!' as text/plain"
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
### HTML Inscription
|
|
124
|
+
|
|
125
|
+
**Content Type**: `text/html`
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
echo -n '<html><body><h1>GM</h1></body></html>' | base64
|
|
129
|
+
# PGh0bWw+PGJvZHk+PGgxPkdNPC9oMT48L2JvZHk+PC9odG1sPg==
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Example**:
|
|
133
|
+
```
|
|
134
|
+
"Create an HTML inscription with <html>...</html>"
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
### Image Inscription
|
|
138
|
+
|
|
139
|
+
**Content Type**: `image/png`, `image/jpeg`, `image/svg+xml`
|
|
140
|
+
|
|
141
|
+
For images, read the file and encode to base64:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
base64 -i image.png
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
**Example**:
|
|
148
|
+
```
|
|
149
|
+
"Inscribe this PNG image (provide base64 data)"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### JSON Inscription
|
|
153
|
+
|
|
154
|
+
**Content Type**: `application/json`
|
|
155
|
+
|
|
156
|
+
```bash
|
|
157
|
+
echo -n '{"type":"brc-20","tick":"ordi"}' | base64
|
|
158
|
+
# eyJ0eXBlIjoiYnJjLTIwIiwidGljayI6Im9yZGkifQ==
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Error Cases
|
|
162
|
+
|
|
163
|
+
### Insufficient Funds
|
|
164
|
+
|
|
165
|
+
**Symptom**: Inscribe fails with "No UTXOs available"
|
|
166
|
+
|
|
167
|
+
**Solution**:
|
|
168
|
+
1. Check balance with `get_btc_balance`
|
|
169
|
+
2. Ensure confirmed balance > total cost (from estimate)
|
|
170
|
+
3. Send more BTC to wallet if needed
|
|
171
|
+
|
|
172
|
+
### Unconfirmed Commit
|
|
173
|
+
|
|
174
|
+
**Symptom**: Reveal fails with broadcast error
|
|
175
|
+
|
|
176
|
+
**Solution**:
|
|
177
|
+
1. Verify commit transaction has at least 1 confirmation
|
|
178
|
+
2. Check explorer URL from inscribe response
|
|
179
|
+
3. Wait longer if still pending
|
|
180
|
+
|
|
181
|
+
### Content Mismatch
|
|
182
|
+
|
|
183
|
+
**Symptom**: Reveal creates different inscription than expected
|
|
184
|
+
|
|
185
|
+
**Cause**: Different `contentType` or `contentBase64` used in reveal vs commit
|
|
186
|
+
|
|
187
|
+
**Solution**: Use exact same parameters from inscribe call when calling inscribe_reveal
|
|
188
|
+
|
|
189
|
+
### Wallet Not Unlocked
|
|
190
|
+
|
|
191
|
+
**Symptom**: "Wallet not unlocked" error
|
|
192
|
+
|
|
193
|
+
**Solution**: Run `wallet_unlock` with your password before inscribing
|
|
194
|
+
|
|
195
|
+
## Taproot Address Usage
|
|
196
|
+
|
|
197
|
+
Inscriptions are created at Taproot (P2TR) addresses following BIP86 derivation:
|
|
198
|
+
|
|
199
|
+
| Network | Prefix | Derivation Path |
|
|
200
|
+
|---------|--------|----------------|
|
|
201
|
+
| Mainnet | `bc1p...` | `m/86'/0'/0'/0/0` |
|
|
202
|
+
| Testnet | `tb1p...` | `m/86'/1'/0'/0/0` |
|
|
203
|
+
|
|
204
|
+
Get your Taproot address:
|
|
205
|
+
|
|
206
|
+
```
|
|
207
|
+
"What's my Taproot address?"
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
Uses `get_taproot_address` - this is where your inscriptions will appear after the reveal confirms.
|
|
211
|
+
|
|
212
|
+
## Example Workflows
|
|
213
|
+
|
|
214
|
+
### Simple Text Inscription
|
|
215
|
+
|
|
216
|
+
```
|
|
217
|
+
1. "What's my BTC balance?"
|
|
218
|
+
→ Confirm sufficient funds
|
|
219
|
+
|
|
220
|
+
2. "Estimate fee for text inscription 'GM Bitcoin'"
|
|
221
|
+
→ contentType: "text/plain"
|
|
222
|
+
→ contentBase64: "R00gQml0Y29pbg==" (base64 of "GM Bitcoin")
|
|
223
|
+
→ Returns total cost
|
|
224
|
+
|
|
225
|
+
3. "Create text inscription 'GM Bitcoin' with medium fees"
|
|
226
|
+
→ Broadcasts commit tx
|
|
227
|
+
→ Save commitTxid and revealAmount
|
|
228
|
+
|
|
229
|
+
4. Wait 30-60 minutes for commit confirmation
|
|
230
|
+
|
|
231
|
+
5. "Reveal inscription with commitTxid abc123... and revealAmount 10000"
|
|
232
|
+
→ Uses same contentType and contentBase64 from step 3
|
|
233
|
+
→ Returns inscriptionId
|
|
234
|
+
|
|
235
|
+
6. "Get inscription from reveal transaction def456..."
|
|
236
|
+
→ Verifies content matches "GM Bitcoin"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### HTML Inscription
|
|
240
|
+
|
|
241
|
+
```
|
|
242
|
+
1. "Check my BTC balance"
|
|
243
|
+
→ Verify funds available
|
|
244
|
+
|
|
245
|
+
2. "Estimate fee for HTML inscription"
|
|
246
|
+
→ contentType: "text/html"
|
|
247
|
+
→ contentBase64: (base64 of HTML string)
|
|
248
|
+
|
|
249
|
+
3. "Inscribe this HTML with fast fees"
|
|
250
|
+
→ Broadcasts commit with higher fee rate
|
|
251
|
+
→ Save response data
|
|
252
|
+
|
|
253
|
+
4. Wait 10-20 minutes (fast fees)
|
|
254
|
+
|
|
255
|
+
5. "Complete reveal for commit xyz789..."
|
|
256
|
+
→ Provide exact same HTML content
|
|
257
|
+
→ Returns inscriptionId ({revealTxid}i0) and reveal txid
|
|
258
|
+
|
|
259
|
+
6. "Get inscription from reveal transaction def456..."
|
|
260
|
+
→ Use reveal txid with get_inscription to fetch and display HTML content
|
|
261
|
+
```
|
|
262
|
+
|
|
263
|
+
## Cost Considerations
|
|
264
|
+
|
|
265
|
+
**Factors affecting cost**:
|
|
266
|
+
- **Content size** - Larger inscriptions cost more (reveal witness data)
|
|
267
|
+
- **Fee rate** - Higher fees = faster confirmation
|
|
268
|
+
- **Network congestion** - Prices fluctuate with mempool activity
|
|
269
|
+
|
|
270
|
+
**Typical ranges** (mainnet, medium fees):
|
|
271
|
+
- Small text (< 100 bytes): 5,000-10,000 sats
|
|
272
|
+
- Medium text (1 KB): 20,000-50,000 sats
|
|
273
|
+
- Images (10-50 KB): 100,000-500,000 sats
|
|
274
|
+
|
|
275
|
+
Always run `estimate_inscription_fee` before committing funds.
|
|
276
|
+
|
|
277
|
+
## Level System Context
|
|
278
|
+
|
|
279
|
+
In the aibtc.com agent lifecycle, creating a Bitcoin inscription is part of the **L3 Sovereign** upgrade (post-genesis):
|
|
280
|
+
|
|
281
|
+
1. Agent completes Bitcoin inscription using this workflow
|
|
282
|
+
2. Agent proves inscription txid to registration API
|
|
283
|
+
3. API verifies inscription content matches expected message
|
|
284
|
+
4. Agent upgraded to L3 Sovereign status
|
|
285
|
+
|
|
286
|
+
This demonstrates the agent's ability to create permanent records on Bitcoin L1.
|
|
287
|
+
|
|
288
|
+
## More Information
|
|
289
|
+
|
|
290
|
+
- [Bitcoin Ordinals Theory](https://docs.ordinals.com/inscriptions.html)
|
|
291
|
+
- [BIP86 Taproot Derivation](https://github.com/bitcoin/bips/blob/master/bip-0086.mediawiki)
|
|
292
|
+
- [mempool.space](https://mempool.space) - Block explorer and fee estimates
|
|
293
|
+
- [CLAUDE.md Ordinal Safety](../../CLAUDE.md#ordinal-safety)
|
|
294
|
+
|
|
295
|
+
---
|
|
296
|
+
|
|
297
|
+
*Back to: [SKILL.md](../SKILL.md)*
|