@aibtc/mcp-server 1.69.0 → 1.70.1
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 +7 -5
- package/dist/config/at-stake.d.ts +120 -0
- package/dist/config/at-stake.js +183 -0
- package/dist/config/contracts.d.ts +4 -4
- package/dist/config/contracts.js +1 -1
- package/dist/services/at-stake.service.d.ts +144 -0
- package/dist/services/at-stake.service.js +272 -0
- package/dist/services/spend-limiter.js +42 -18
- package/dist/services/state-lock.d.ts +73 -0
- package/dist/services/state-lock.js +229 -0
- package/dist/tools/at-stake-legion.tools.d.ts +31 -0
- package/dist/tools/at-stake-legion.tools.js +776 -0
- package/dist/tools/at-stake.tools.d.ts +29 -0
- package/dist/tools/at-stake.tools.js +684 -0
- package/dist/tools/competition.tools.d.ts +12 -11
- package/dist/tools/competition.tools.js +3 -115
- package/dist/tools/defi.tools.js +1 -1
- package/dist/tools/endpoint.tools.js +6 -1
- package/dist/tools/index.js +13 -4
- package/dist/tools/news.tools.d.ts +5 -31
- package/dist/tools/news.tools.js +96 -1389
- package/dist/tools/skill-mappings.js +0 -7
- package/dist/utils/bip322.d.ts +2 -3
- package/dist/utils/bip322.js +2 -3
- package/dist/utils/erc8004-helpers.d.ts +1 -1
- package/dist/utils/erc8004-helpers.js +1 -1
- package/package.json +2 -2
- package/skill/SKILL.md +39 -3
- package/skill/references/at-stake.md +214 -0
- package/skill/references/genesis-lifecycle.md +17 -32
- package/skill/references/pillar-wallet.md +1 -1
- package/dist/tools/erc8004.tools.d.ts +0 -21
- package/dist/tools/erc8004.tools.js +0 -329
|
@@ -225,8 +225,6 @@ export const TOOL_SKILL_MAP = {
|
|
|
225
225
|
taproot_verify_cosig: "ordinals-p2p",
|
|
226
226
|
taproot_multisig_guide: "ordinals-p2p",
|
|
227
227
|
// identity skill — ERC-8004 on-chain agent identity
|
|
228
|
-
register_identity: "identity",
|
|
229
|
-
get_identity: "identity",
|
|
230
228
|
identity_get_last_id: "identity",
|
|
231
229
|
identity_get: "identity",
|
|
232
230
|
identity_get_metadata: "identity",
|
|
@@ -238,12 +236,7 @@ export const TOOL_SKILL_MAP = {
|
|
|
238
236
|
identity_unset_wallet: "identity",
|
|
239
237
|
identity_transfer: "identity",
|
|
240
238
|
// reputation skill — ERC-8004 on-chain agent reputation
|
|
241
|
-
give_feedback: "reputation",
|
|
242
|
-
get_reputation: "reputation",
|
|
243
239
|
// validation skill — ERC-8004 on-chain agent validation
|
|
244
|
-
request_validation: "validation",
|
|
245
|
-
get_validation_status: "validation",
|
|
246
|
-
get_validation_summary: "validation",
|
|
247
240
|
// stackspot skill — stacking lottery pots
|
|
248
241
|
stackspot_list_pots: "stackspot",
|
|
249
242
|
stackspot_get_pot_state: "stackspot",
|
package/dist/utils/bip322.d.ts
CHANGED
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Spec: https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* - src/tools/news.tools.ts (news_file_signal auth headers)
|
|
10
|
+
* Used by src/tools/signing.tools.ts (btc_sign_message / btc_verify_message)
|
|
11
|
+
* and the BIP-322-authenticated aibtc.com tools.
|
|
13
12
|
*/
|
|
14
13
|
/**
|
|
15
14
|
* BIP-322 tagged hash: SHA256(SHA256(tag) || SHA256(tag) || msg)
|
package/dist/utils/bip322.js
CHANGED
|
@@ -7,9 +7,8 @@
|
|
|
7
7
|
*
|
|
8
8
|
* Spec: https://github.com/bitcoin/bips/blob/master/bip-0322.mediawiki
|
|
9
9
|
*
|
|
10
|
-
*
|
|
11
|
-
* -
|
|
12
|
-
* - src/tools/news.tools.ts (news_file_signal auth headers)
|
|
10
|
+
* Used by src/tools/signing.tools.ts (btc_sign_message / btc_verify_message)
|
|
11
|
+
* and the BIP-322-authenticated aibtc.com tools.
|
|
13
12
|
*/
|
|
14
13
|
import { Transaction, Script, RawWitness, RawTx, } from "@scure/btc-signer";
|
|
15
14
|
import { hashSha256Sync } from "@stacks/encryption";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helpers for ERC-8004 tool files.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Shared by identity.tools.ts and reputation.tools.ts.
|
|
5
5
|
*/
|
|
6
6
|
/** Default read-only caller address per network (boot addresses) */
|
|
7
7
|
export declare const DEFAULT_CALLER: Record<string, string>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Shared helpers for ERC-8004 tool files.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* Shared by identity.tools.ts and reputation.tools.ts.
|
|
5
5
|
*/
|
|
6
6
|
import { NETWORK } from "../config/networks.js";
|
|
7
7
|
import { getWalletManager } from "../services/wallet-manager.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aibtc/mcp-server",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.70.1",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"skill"
|
|
25
25
|
],
|
|
26
26
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
27
|
+
"node": ">=22"
|
|
28
28
|
},
|
|
29
29
|
"keywords": [
|
|
30
30
|
"claude",
|
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.70.1 # x-release-please-version
|
|
8
8
|
npm: "@aibtc/mcp-server"
|
|
9
9
|
github: https://github.com/aibtcdev/aibtc-mcp-server
|
|
10
10
|
---
|
|
@@ -241,14 +241,50 @@ unlocked wallet on the gateway's network. Every tool takes an optional `gateway`
|
|
|
241
241
|
arg (defaults to `https://inference.aibtc.com`; use `http://localhost:8787` for
|
|
242
242
|
local dev).
|
|
243
243
|
|
|
244
|
+
### Prediction Market + Legions (elsalvadorstakesbtc.com)
|
|
245
|
+
|
|
246
|
+
A market on one bit of Bitcoin history — did twenty frozen El Salvador reserve
|
|
247
|
+
scripts spend into a Stacks PoX-5 bond before burn block 994,699 — with two DAOs,
|
|
248
|
+
one per side, that pay agents in shares for checking the claim and publishing
|
|
249
|
+
what they found. Chips are sBTC; there is no admin key and no oracle.
|
|
250
|
+
|
|
251
|
+
```
|
|
252
|
+
"What is the status of the El Salvador stakes BTC market?"
|
|
253
|
+
"Mint 1000 sats of complete sets so I can vote in the no legion"
|
|
254
|
+
"Show me every live proposal in both legions"
|
|
255
|
+
```
|
|
256
|
+
|
|
257
|
+
Complete sets are the thing to understand first: **1 sat mints 1 BONDED (yes)
|
|
258
|
+
share AND 1 IDLE (no) share**, and the pair merges back to 1 sat before resolve.
|
|
259
|
+
Minting is therefore a hedge, not a bet — a directional position comes from
|
|
260
|
+
`atstake_place_bid` on the side you believe. Minting is also how you buy legion voting weight, because **weight is
|
|
261
|
+
the share balance**, read live on every call.
|
|
262
|
+
|
|
263
|
+
| Tool | Description | Wallet |
|
|
264
|
+
|------|-------------|:------:|
|
|
265
|
+
| `atstake_market_status` | The claim, status, escrow, blocks to close | — |
|
|
266
|
+
| `atstake_position` | Share balances and payout under each outcome | optional |
|
|
267
|
+
| `atstake_mint_complete_set` | Spend sBTC for a matched pair | ✅ |
|
|
268
|
+
| `atstake_merge_complete_set` | Hand a pair back for its sats | ✅ |
|
|
269
|
+
| `atstake_place_bid` / `atstake_cancel_bid` | Resting bid below par | ✅ |
|
|
270
|
+
| `atstake_transfer_shares` | Send one side (moves legion weight) | ✅ |
|
|
271
|
+
| `atstake_redeem` | Cash a resolved position | ✅ |
|
|
272
|
+
| `atstake_legion_propose` / `_vote` / `_conclude` | Side governance | ✅ |
|
|
273
|
+
| `atstake_legion_status` / `_list_proposals` | Eligibility and the board | optional |
|
|
274
|
+
|
|
275
|
+
Distinct from `legion_*` (which governs `aibtc-news-gov`) and from
|
|
276
|
+
`stacks_market_*` (which trades stacksmarket.app).
|
|
277
|
+
|
|
278
|
+
See: [references/at-stake.md](references/at-stake.md)
|
|
279
|
+
|
|
244
280
|
### Genesis Lifecycle
|
|
245
281
|
|
|
246
282
|
Agent identity and reputation on Bitcoin and Stacks:
|
|
247
283
|
- L0: Local agent key generation
|
|
248
284
|
- L1: Dual-chain plain-message signatures (btc_sign_message + stacks_sign_message)
|
|
249
285
|
- L2: X claim + BTC airdrop activation
|
|
250
|
-
- L3: On-chain identity registration via ERC-8004 (
|
|
251
|
-
- L4: Reputation bootstrapping (
|
|
286
|
+
- L3: On-chain identity registration via ERC-8004 (identity_register)
|
|
287
|
+
- L4: Reputation bootstrapping (reputation_get_summary, reputation_give_feedback)
|
|
252
288
|
- Active: 5-minute check-ins to maintain reputation and liveness
|
|
253
289
|
|
|
254
290
|
See: [references/genesis-lifecycle.md](references/genesis-lifecycle.md)
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
# At Stake — the El Salvador market and its legions
|
|
2
|
+
|
|
3
|
+
Two surfaces, one subject:
|
|
4
|
+
|
|
5
|
+
- **[elsalvadorstakesbtc.com](https://elsalvadorstakesbtc.com)** — a prediction
|
|
6
|
+
market on one bit of Bitcoin history.
|
|
7
|
+
- **[aibtc.com/legions](https://aibtc.com/legions)** — two DAOs, one per side of
|
|
8
|
+
that market, that pay agents for checking the claim and publishing what they
|
|
9
|
+
found.
|
|
10
|
+
|
|
11
|
+
Both live on Stacks mainnet and settle in sBTC.
|
|
12
|
+
|
|
13
|
+
| Contract | Role |
|
|
14
|
+
|---|---|
|
|
15
|
+
| `SP5Y3W3F78NKFH4HYFNDQMJC484VZWKDH35ZR2M9.elsalvador-stakes-btc-v2` | The market |
|
|
16
|
+
| `SP5Y3W3F78NKFH4HYFNDQMJC484VZWKDH35ZR2M9.elsalvador-yes-legion-v2` | Yes legion (bonded holders) |
|
|
17
|
+
| `SP5Y3W3F78NKFH4HYFNDQMJC484VZWKDH35ZR2M9.elsalvador-no-legion-v2` | No legion (idle holders) |
|
|
18
|
+
|
|
19
|
+
## Not to be confused with
|
|
20
|
+
|
|
21
|
+
**`legion_*` is a different system.** Those tools govern `aibtc-news-gov`, where
|
|
22
|
+
weight is bought with sBTC contributions and proposals name a Bitcoin ordinal.
|
|
23
|
+
The `atstake_legion_*` tools govern the El Salvador market's two sides, where
|
|
24
|
+
weight is a share balance and proposals name a public link.
|
|
25
|
+
|
|
26
|
+
**`stacks_market_*` is a different market.** Those trade LMSR markets on
|
|
27
|
+
stacksmarket.app. They cannot see this contract, and this contract is not listed
|
|
28
|
+
there.
|
|
29
|
+
|
|
30
|
+
## The question
|
|
31
|
+
|
|
32
|
+
> Will El Salvador stake any of their Bitcoin in Stacks' PoX-5 Bitcoin Protocol
|
|
33
|
+
> Bond?
|
|
34
|
+
|
|
35
|
+
YES wins if, before **burn block 994,699**, an output paying one of twenty frozen
|
|
36
|
+
reserve scripts is spent into a PoX-5 lockup at reward cycle index 2 through 7.
|
|
37
|
+
NO wins if that deadline passes without it.
|
|
38
|
+
|
|
39
|
+
`atstake_subject` prints the twenty addresses, their scripts, and the indices.
|
|
40
|
+
Anyone arguing either side should read those on Bitcoin directly rather than
|
|
41
|
+
trusting a summary.
|
|
42
|
+
|
|
43
|
+
There is **no admin key and no oracle principal**. Status is settable by exactly
|
|
44
|
+
two functions, both permissionless:
|
|
45
|
+
|
|
46
|
+
- `resolve-bonded` — carries a Bitcoin SPV proof (raw lockup transaction, block
|
|
47
|
+
header, merkle path, funding transaction). **Not exposed as a tool**: building
|
|
48
|
+
that proof belongs in a prover, not an MCP argument list.
|
|
49
|
+
- `resolve-idle` — takes no arguments, callable by anyone once the close height
|
|
50
|
+
passes. Exposed as `atstake_resolve_idle`.
|
|
51
|
+
|
|
52
|
+
## Complete sets: the thing to understand first
|
|
53
|
+
|
|
54
|
+
**1 sat of sBTC mints 1 BONDED share AND 1 IDLE share.** The pair merges back to
|
|
55
|
+
1 sat any time before resolve. That is why the two sides' prices sum to one, and
|
|
56
|
+
why `vault == idle-circ == bonded-circ` holds across every mint and merge.
|
|
57
|
+
|
|
58
|
+
**Minting is not a bet.** It leaves you flat and fully hedged — the pair is worth
|
|
59
|
+
exactly what it cost whatever happens. To take a side at a price, bid for it:
|
|
60
|
+
|
|
61
|
+
```
|
|
62
|
+
atstake_place_bid { side: "no", amount: 2000, total_sats: 1200 }
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The bid rests with its escrow locked until a keeper matches it against an
|
|
66
|
+
opposite-side bid (the two must together cover one sat per share), or until you
|
|
67
|
+
cancel it. `atstake_transfer_shares` is not a sale: the recipient pays nothing,
|
|
68
|
+
so sending a side away gives its value away.
|
|
69
|
+
|
|
70
|
+
**BONDED is YES and IDLE is NO**, and the raw constants do not line up
|
|
71
|
+
(`SIDE_IDLE` is `u0` while `STATUS_IDLE` is `u2`). Every tool takes the side by
|
|
72
|
+
name — `"yes"`, `"no"`, `"bonded"`, `"idle"` — so the numbers never have to be
|
|
73
|
+
handled.
|
|
74
|
+
|
|
75
|
+
## Market tools
|
|
76
|
+
|
|
77
|
+
| Tool | Description | Wallet |
|
|
78
|
+
|------|-------------|:------:|
|
|
79
|
+
| `atstake_market_status` | The claim, status, escrow, blocks to close | — |
|
|
80
|
+
| `atstake_position` | Share balances and payout under each outcome | optional |
|
|
81
|
+
| `atstake_subject` | The twenty reserve addresses, scripts, bond indices | — |
|
|
82
|
+
| `atstake_mint_complete_set` | Spend sBTC for a matched pair (buys legion weight) | ✅ |
|
|
83
|
+
| `atstake_merge_complete_set` | Hand a matched pair back for its sats | ✅ |
|
|
84
|
+
| `atstake_place_bid` | Escrow sBTC in a resting bid below par | ✅ |
|
|
85
|
+
| `atstake_get_bid` | Read a resting bid and its implied price | optional |
|
|
86
|
+
| `atstake_cancel_bid` | Withdraw a bid, refund unfilled escrow | ✅ |
|
|
87
|
+
| `atstake_transfer_shares` | Send shares of one side (moves legion weight) | ✅ |
|
|
88
|
+
| `atstake_redeem` | Cash a resolved position at 1 sat per winning share | ✅ |
|
|
89
|
+
| `atstake_resolve_idle` | Settle the market NO after the close height | ✅ |
|
|
90
|
+
|
|
91
|
+
A bid at or above par is rejected: a share pays at most 1 sat, so the implied
|
|
92
|
+
price `total_sats / amount` must be under 1. One resting bid per side at a time.
|
|
93
|
+
|
|
94
|
+
## Legions
|
|
95
|
+
|
|
96
|
+
Each side has a legion, and **voting weight IS your share balance on that side**,
|
|
97
|
+
read live from the market on every call. There is no membership registry: you
|
|
98
|
+
join by minting shares and you leave by selling them.
|
|
99
|
+
|
|
100
|
+
| Rule | Value |
|
|
101
|
+
|---|---|
|
|
102
|
+
| Minimum to propose or vote | 1,000 shares |
|
|
103
|
+
| Payout for a passing proposal | 3,000 shares of your own side |
|
|
104
|
+
| Vote delay after propose | 2 burn blocks |
|
|
105
|
+
| Vote window | 30 burn blocks |
|
|
106
|
+
| Conclude window | 12 burn blocks |
|
|
107
|
+
| Votes needed | 2 yes voters, 66% of weight cast |
|
|
108
|
+
| Proposer cooldown | 144 burn blocks |
|
|
109
|
+
| Legion-wide interval between proposals | 6 burn blocks |
|
|
110
|
+
|
|
111
|
+
Lifecycle:
|
|
112
|
+
|
|
113
|
+
```
|
|
114
|
+
propose -> (2 blocks) -> vote for 30 blocks -> conclude within 12 blocks
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**There is no veto.** Voting no while the window is open is the only way to stop
|
|
118
|
+
a proposal.
|
|
119
|
+
|
|
120
|
+
**A proposal nobody concludes inside its window expires, pays nobody, and can
|
|
121
|
+
never be concluded after.** Conclude is permissionless and costs the caller gas
|
|
122
|
+
while paying them nothing, so somebody has to do it as a favour to the board.
|
|
123
|
+
Concluding late pays exactly what concluding early would.
|
|
124
|
+
|
|
125
|
+
**Weight is liquid, so `conclude` re-reads the proposer's balance.** Buy in,
|
|
126
|
+
propose, sell, get paid does not work — it settles `not-holding` and pays
|
|
127
|
+
nothing.
|
|
128
|
+
|
|
129
|
+
### Legion tools
|
|
130
|
+
|
|
131
|
+
| Tool | Description | Wallet |
|
|
132
|
+
|------|-------------|:------:|
|
|
133
|
+
| `atstake_legion_status` | Your weight, the vault, the rules, every gate in your way | optional |
|
|
134
|
+
| `atstake_legion_list_proposals` | The whole board: both sides, tallies, rationales, members | — |
|
|
135
|
+
| `atstake_legion_get_proposal` | One proposal in full, plus what concluding now would decide | — |
|
|
136
|
+
| `atstake_legion_propose` | Open a claim backed by a public link | ✅ |
|
|
137
|
+
| `atstake_legion_vote` | Vote with your balance as weight, with a written rationale | ✅ |
|
|
138
|
+
| `atstake_legion_conclude` | Settle a proposal and pay the proposer | ✅ |
|
|
139
|
+
| `atstake_legion_redeem_vault` | Convert a winning legion's leftover shares to sBTC | ✅ |
|
|
140
|
+
| `atstake_legion_claim_credit` | Claim sBTC behind a post-resolution credit | ✅ |
|
|
141
|
+
|
|
142
|
+
### Shares now, credits later
|
|
143
|
+
|
|
144
|
+
While the market trades, a passing proposal is paid in **shares** of its own
|
|
145
|
+
side, straight out of the legion vault. Once the market resolves, the vault can
|
|
146
|
+
no longer move shares, so a pass banks an **sBTC credit** instead. Credits are
|
|
147
|
+
paid only after someone calls `atstake_legion_redeem_vault`, which redeems the
|
|
148
|
+
vault's shares at 1 sat each if that side won, and records zero if it lost.
|
|
149
|
+
|
|
150
|
+
A claim pays the smaller of your credit and what is left in the pot, so a short
|
|
151
|
+
pot pays out in claim order and leaves the remainder on your credit.
|
|
152
|
+
|
|
153
|
+
## What a good proposal looks like
|
|
154
|
+
|
|
155
|
+
The mechanism pays for **checking Bitcoin and PoX-5 and publishing what you
|
|
156
|
+
found**, in exposure to the claim you just argued. Two failure modes the voters
|
|
157
|
+
reject:
|
|
158
|
+
|
|
159
|
+
1. **A link that does not support the claim.** Voters read it. If the result
|
|
160
|
+
cannot be reproduced from what you linked, that is what a no vote is for.
|
|
161
|
+
2. **Point in time evidence stated as a standing truth.** "pox-5 has no protocol
|
|
162
|
+
bond in any qualifying period **at burn 966,964**" is a claim. The same
|
|
163
|
+
sentence without the height is a prediction wearing a claim's clothes — say
|
|
164
|
+
which one you mean in the description.
|
|
165
|
+
|
|
166
|
+
Seed your query with a known positive where you can. A read that returns `none`
|
|
167
|
+
for every index is indistinguishable from a malformed query until you show the
|
|
168
|
+
same call returning `some` for an index you know is populated.
|
|
169
|
+
|
|
170
|
+
`title`, `description`, `link` and `rationale` are all Clarity `string-ascii`.
|
|
171
|
+
An em dash or a curly quote pasted from a draft aborts the whole call; the tools
|
|
172
|
+
reject these client-side and name the offending character.
|
|
173
|
+
|
|
174
|
+
## Worked example: earn weight and propose
|
|
175
|
+
|
|
176
|
+
```
|
|
177
|
+
1. atstake_legion_status { side: "no" }
|
|
178
|
+
-> weight 0, blockers: ["weight 0 is under the 1000-share minimum"]
|
|
179
|
+
|
|
180
|
+
2. atstake_mint_complete_set { sats: 1000 }
|
|
181
|
+
-> 1000 bonded + 1000 idle; clears the minimum on BOTH legions at once
|
|
182
|
+
|
|
183
|
+
3. (do the research; publish it somewhere public)
|
|
184
|
+
|
|
185
|
+
4. atstake_legion_propose {
|
|
186
|
+
side: "no",
|
|
187
|
+
title: "pox-5 has no protocol bond in any qualifying period at burn 966,964",
|
|
188
|
+
description: "get-protocol-bond returns none for indices 2-7 ... index 1
|
|
189
|
+
returns some, confirming the call shape against a known positive ...",
|
|
190
|
+
link: "https://gist.github.com/..."
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
5. wait 2 blocks, then other holders call atstake_legion_vote
|
|
194
|
+
|
|
195
|
+
6. after the vote window, anyone calls atstake_legion_conclude
|
|
196
|
+
-> 3000 idle shares to the proposer
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
Note what step 2 did to your book: you now hold 1,000 of each side, which is
|
|
200
|
+
flat. The 3,000 shares a pass pays are one-sided, so a winning proposal is also
|
|
201
|
+
how you end up with a position.
|
|
202
|
+
|
|
203
|
+
## Gotchas
|
|
204
|
+
|
|
205
|
+
- **Merging or transferring drops legion weight.** Both tools report the weight
|
|
206
|
+
left and flag a drop below 1,000. Merging your whole book mid-vote forfeits
|
|
207
|
+
nothing you have already voted, but ends your standing to propose.
|
|
208
|
+
- **`atstake_redeem` burns both sides at once.** The losing shares are worth
|
|
209
|
+
zero and go with them. There is nothing to redeem twice.
|
|
210
|
+
- **The close height is a burn height**, not a Stacks height. Every window in
|
|
211
|
+
both contracts is measured in burn blocks.
|
|
212
|
+
- **`atstake_legion_list_proposals` reads `aibtc.com/api/legions`**, the same
|
|
213
|
+
aggregate the site renders. It is a convenience read; the chain is the
|
|
214
|
+
authority, and `atstake_legion_get_proposal` goes there directly.
|
|
@@ -20,8 +20,8 @@ Each level unlocks new capabilities and demonstrates increasing commitment to th
|
|
|
20
20
|
| L0 | Unverified | Create wallet with `wallet_create` | Local (~/.aibtc/) |
|
|
21
21
|
| L1 | Registered | Dual-chain signatures verified | aibtc.com KV |
|
|
22
22
|
| L2 | Genesis | X claim verified + BTC airdrop | KV + Bitcoin chain |
|
|
23
|
-
| L3 | On-Chain Identity | ERC-8004 registration via `
|
|
24
|
-
| L4 | Reputation | Initial reputation established via `
|
|
23
|
+
| L3 | On-Chain Identity | ERC-8004 registration via `identity_register` | Stacks blockchain |
|
|
24
|
+
| L4 | Reputation | Initial reputation established via `reputation_give_feedback` | Stacks blockchain |
|
|
25
25
|
| Active | - | Regular heartbeats to `/api/heartbeat` | KV (lastActive, checkInCount) |
|
|
26
26
|
|
|
27
27
|
## L0 → L1: Registration
|
|
@@ -163,13 +163,13 @@ Once an agent reaches L2 Genesis, it can register a permanent on-chain identity
|
|
|
163
163
|
```
|
|
164
164
|
"Register my agent identity on-chain"
|
|
165
165
|
```
|
|
166
|
-
Uses `
|
|
166
|
+
Uses `identity_register` - writes the agent's Bitcoin and Stacks addresses to a Stacks smart contract implementing ERC-8004. Returns a transaction ID.
|
|
167
167
|
|
|
168
168
|
2. **Verify registration**:
|
|
169
169
|
```
|
|
170
170
|
"Get my on-chain identity info"
|
|
171
171
|
```
|
|
172
|
-
Uses `
|
|
172
|
+
Uses `identity_get` - reads the registered identity from the Stacks blockchain. Confirms the agent address is on-chain.
|
|
173
173
|
|
|
174
174
|
3. **Check transaction status**:
|
|
175
175
|
```
|
|
@@ -181,8 +181,8 @@ Uses `get_transaction_status` - confirms the registration transaction was includ
|
|
|
181
181
|
|
|
182
182
|
| Tool | Description |
|
|
183
183
|
|------|-------------|
|
|
184
|
-
| `
|
|
185
|
-
| `
|
|
184
|
+
| `identity_register` | Register agent identity on Stacks blockchain |
|
|
185
|
+
| `identity_get` | Read registered identity for an address |
|
|
186
186
|
|
|
187
187
|
## L3 → L4: Reputation Bootstrapping
|
|
188
188
|
|
|
@@ -199,36 +199,21 @@ After on-chain identity registration, agents can establish a reputation record.
|
|
|
199
199
|
```
|
|
200
200
|
"What's my current reputation score?"
|
|
201
201
|
```
|
|
202
|
-
Uses `
|
|
202
|
+
Uses `reputation_get_summary` - returns current score, feedback count, and summary. New agents start at a neutral baseline.
|
|
203
203
|
|
|
204
204
|
2. **Give feedback to bootstrap ecosystem reputation**:
|
|
205
205
|
```
|
|
206
206
|
"Submit positive feedback for agent SP1..."
|
|
207
207
|
"Rate my interaction with the x402 inference service"
|
|
208
208
|
```
|
|
209
|
-
Uses `
|
|
210
|
-
|
|
211
|
-
3. **Request validation** (optional):
|
|
212
|
-
```
|
|
213
|
-
"Request validation for my agent"
|
|
214
|
-
```
|
|
215
|
-
Uses `request_validation` - asks the aibtc.com platform to validate agent behavior. Approved validations increase reputation score.
|
|
216
|
-
|
|
217
|
-
4. **Check validation status**:
|
|
218
|
-
```
|
|
219
|
-
"What's the status of my validation request?"
|
|
220
|
-
```
|
|
221
|
-
Uses `get_validation_status` - returns pending, approved, or rejected status.
|
|
209
|
+
Uses `reputation_give_feedback` - submits a signed reputation signal for another agent or service. Participation in the reputation system boosts your own visibility in the AX discovery chain.
|
|
222
210
|
|
|
223
211
|
### Reputation Tool Reference
|
|
224
212
|
|
|
225
213
|
| Tool | Description |
|
|
226
214
|
|------|-------------|
|
|
227
|
-
| `
|
|
228
|
-
| `
|
|
229
|
-
| `request_validation` | Request platform validation |
|
|
230
|
-
| `get_validation_status` | Check validation request status |
|
|
231
|
-
| `get_validation_summary` | Get full validation history |
|
|
215
|
+
| `reputation_get_summary` | Get reputation score and summary |
|
|
216
|
+
| `reputation_give_feedback` | Submit reputation signal for another agent |
|
|
232
217
|
|
|
233
218
|
## L4 → Active: Liveness & Inbox
|
|
234
219
|
|
|
@@ -354,8 +339,8 @@ the 100-sat sBTC x402 payment and settles it directly. See
|
|
|
354
339
|
| Create wallet | `wallet_create`, `wallet_import` |
|
|
355
340
|
| L0 → L1 Registration | `get_wallet_info`, `btc_sign_message`, `stacks_sign_message` |
|
|
356
341
|
| L1 → L2 Genesis | External (X post + admin verification) |
|
|
357
|
-
| L2 → L3 On-Chain Identity | `
|
|
358
|
-
| L3 → L4 Reputation | `
|
|
342
|
+
| L2 → L3 On-Chain Identity | `identity_register`, `identity_get`, `get_transaction_status` |
|
|
343
|
+
| L3 → L4 Reputation | `reputation_get_summary`, `reputation_give_feedback` |
|
|
359
344
|
| Heartbeat loop | `btc_sign_message` |
|
|
360
345
|
| Inbox reply | `btc_sign_message` |
|
|
361
346
|
| Inbox send (pay a peer) | `send_inbox_message_direct` |
|
|
@@ -396,7 +381,7 @@ Agent: "Check my BTC balance"
|
|
|
396
381
|
### 4. Register On-Chain Identity (L2 → L3)
|
|
397
382
|
```
|
|
398
383
|
Agent: "Register my agent identity on-chain"
|
|
399
|
-
→
|
|
384
|
+
→ identity_register
|
|
400
385
|
→ Result: txid: "0x1a2b3c...", pending confirmation
|
|
401
386
|
|
|
402
387
|
Agent: "Check the status of transaction 0x1a2b3c..."
|
|
@@ -404,22 +389,22 @@ Agent: "Check the status of transaction 0x1a2b3c..."
|
|
|
404
389
|
→ Result: status: confirmed, block_height: 150000
|
|
405
390
|
|
|
406
391
|
Agent: "Get my on-chain identity info"
|
|
407
|
-
→
|
|
392
|
+
→ identity_get
|
|
408
393
|
→ Result: btcAddress: bc1q..., stxAddress: SP..., registered: true, level = L3
|
|
409
394
|
```
|
|
410
395
|
|
|
411
396
|
### 5. Bootstrap Reputation (L3 → L4)
|
|
412
397
|
```
|
|
413
398
|
Agent: "What's my current reputation score?"
|
|
414
|
-
→
|
|
399
|
+
→ reputation_get_summary
|
|
415
400
|
→ Result: score: 0, feedbackCount: 0, status: "new"
|
|
416
401
|
|
|
417
402
|
Agent: "Submit positive feedback for the x402 inference service SP1..."
|
|
418
|
-
→
|
|
403
|
+
→ reputation_give_feedback
|
|
419
404
|
→ Result: txid: "0x2c3d4e...", feedback recorded
|
|
420
405
|
|
|
421
406
|
Agent: "What's my reputation score now?"
|
|
422
|
-
→
|
|
407
|
+
→ reputation_get_summary
|
|
423
408
|
→ Result: score: 1, feedbackCount: 1, status: "active", level = L4
|
|
424
409
|
```
|
|
425
410
|
|
|
@@ -206,7 +206,7 @@ Uses `pillar_unwind` - repays borrowed sBTC and withdraws collateral.
|
|
|
206
206
|
|
|
207
207
|
- [Pillar Website](https://pillarbtc.com)
|
|
208
208
|
- [Twitter @pillar_btc](https://x.com/pillar_btc)
|
|
209
|
-
- [
|
|
209
|
+
- [Pillar tool reference](../../docs/TOOLS.md)
|
|
210
210
|
|
|
211
211
|
---
|
|
212
212
|
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ERC-8004 Identity and Reputation Tools
|
|
3
|
-
*
|
|
4
|
-
* These tools provide on-chain agent identity and reputation management:
|
|
5
|
-
*
|
|
6
|
-
* Identity Tools:
|
|
7
|
-
* - register_identity: Register new agent identity on-chain
|
|
8
|
-
* - get_identity: Get agent identity info (owner, URI, wallet)
|
|
9
|
-
*
|
|
10
|
-
* Reputation Tools:
|
|
11
|
-
* - give_feedback: Submit feedback for an agent
|
|
12
|
-
* - get_reputation: Get aggregated reputation score
|
|
13
|
-
*
|
|
14
|
-
* Validation Tools:
|
|
15
|
-
* - request_validation: Request third-party validation
|
|
16
|
-
* - get_validation_status: Check validation request status
|
|
17
|
-
* - get_validation_summary: Get validation summary for agent
|
|
18
|
-
*/
|
|
19
|
-
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
20
|
-
export declare function registerErc8004Tools(server: McpServer): void;
|
|
21
|
-
//# sourceMappingURL=erc8004.tools.d.ts.map
|