Skip to content

Latest commit

 

History

History
112 lines (82 loc) · 12.4 KB

File metadata and controls

112 lines (82 loc) · 12.4 KB

AIBTC Legion — Live Testnet Run Report

A "Legion" is an on-chain agent collective: agents pool sBTC into a shared treasury and govern it by stake-weighted voting. This report documents a complete live run on Stacks testnet — deploy → fund 10 agents → stake → propose → vote → conclude → payout — including the failure paths (quorum-not-met, threshold-not-met) and the non-staked-voter rejection.

All links: https://explorer.hiro.so/txid/<txid>?chain=testnet


1. Contracts (live on testnet)

Deployer / legion owner: STXGASYJR80W8RWNM7R4ENRJAPR75Y5W57J57V0J (legion-agent-01). Clarity version 3, epoch 3.0.

Contract ID Role
legion-treasury STXGAS…​.legion-treasury sBTC vault; moves funds only on gov/payout instruction
legion-gov STXGAS…​.legion-gov stake-weighted proposals + voting
legion-payout STXGAS…​.legion-payout milestone proof + pro-rata distribution

External (referenced, not deployed by us):

  • sBTC token (SIP-010, 8 dp, public faucet): STV9K21TBFAK4KNRJXF5DFP8N7W46G4V9RJ5XDY2.sbtc-token
  • SIP-010 trait: STTWD9SPRQVD3P733V89SV0P8RZRZNQADG034F0A.faktory-trait-v1.sip-010-trait

Governance rules (enforced on-chain): quorum 15% of total staked must vote · threshold 66% of cast votes must be YES · min 2 distinct voters · veto path (≥15% & > yes). Test-fast timing: stacks-block windows VOTING_DELAY=1, VOTING_PERIOD=15.


2. The 10 agents

Agent Address
legion-agent-01 (deployer) STXGASYJR80W8RWNM7R4ENRJAPR75Y5W57J57V0J
legion-agent-02 ST38Y96G7WHWSWY7JTE3DVM77EBCA86WX63HY9HPV
legion-agent-03 STBEMQQVSS3K3SQTF2NRZMF82JHMNTHQKQ2J7DW5
legion-agent-04 ST2KVMAENJ1V64YKT722HNQRPRR0W1A4JDA8KW8A4
legion-agent-05 ST2VN1G6EBXPMMAJKCSY1HR50YQCVFSK68KKP9SKW
legion-agent-06 STGX5YP51NKM69ZMP6DVB6GAJAANCG5WB3718KD9
legion-agent-07 ST34Q5MVC410NTEK8G00G2QZ1JTBB2WJTNABTE6RA
legion-agent-08 ST1QQ1NJMM3MH73X2W2DD7K9K2G9CHW00D9FVX7PD
legion-agent-09 STH2TAB1VE615MXSQ3HSXVACC2ZEEM0EBY1V8GCK
legion-agent-10 ST2BEBZJ8Y2H6F5DK9KC450238Y3HGJCS9B7P2JD3

3. Timeline

Phase A — Deploy & wire

  1. Deployed the 3 contracts at Clarity 3 via Clarinet (the aibtc MCP publishes at Clarity 4, where as-contract is renamed as-contract? → publish aborts; Clarinet pins v3). Contracts confirmed live (addresses above).
  2. Wired the treasury (deployer-only, one-time each):

Phase B — Fund the 10 agents

  1. sBTC faucet (agent-01) → 55350f4b (minted 6.9 test sBTC).
  2. STX for fees → agents 02–10 (from agent-01): 02 · 03 · 04 · 05 · 06 · 07 · 08 · 09 · 10
  3. sBTC distributed 0.6 each → agents 02–10: 02 · 03 · 04 · 05 · 06 · 07 · 08 · 09 · 10

Phase C — Staking (join the legion; weight = stake)

All 10 staked 0.5 sBTC each (total 5.0 sBTC). From agent-03 onward, stakes use deny + explicit sBTC post-conditions.

01 · 02 · 03 · 04 · 05 · 06 · 07 · 08 · 09 · 10

Phase D — Proposals (any staked agent can propose)

# Proposer Pay Amount Description Propose tx
1 agent-01 agent-10 0.3 sBTC Genesis bounty — first inscription d9d954b5
2 agent-03 agent-09 0.2 sBTC Heartbeat relay grant a20e33b8
3 agent-03 agent-08 0.25 sBTC Fund AI research — sBTC yield report 0d73a0f5
4 agent-10 agent-05 0.4 sBTC Research grant — quarterly agent-economy report (all-10 vote) 162231f0

Phase E — Voting, vetoes, conclusions (the test matrix)

#1 — happy path (PASS + payout):

  • YES votes: agent-01, agent-02, agent-03
  • Conclude → (ok true)76883df3 — treasury paid 0.3 sBTC to agent-10 (agent-10 0.6 → 0.9; treasury 1.5 → 1.2).

Negative test — non-staked agent tries to vote:

  • agent-04 (funded, never staked) votes on #3 → abort_by_response (err u401) (ineligible) → 271d3e84

#3 — threshold NOT met (FAIL):

  • NO votes: agent-03, agent-01 (0 YES, quorum met)
  • Conclude → (ok false) (66% threshold not met, no payout) → 65d577e8

#2 — quorum NOT met (FAIL):

  • 0 votes cast → turnout 0% < 15%
  • Conclude → (ok false) (quorum not met, no payout) → b5f91787

#4 — ALL 10 AGENTS PARTICIPATE (PASS + payout): snapshot 5.0 sBTC. All 10 agents voted YES (100% turnout, 100% yes): 01 · 02 · 03 · 04 · 05 · 06 · 07 · 08 · 09 · 10

  • Conclude → (ok true)82a8fc00 — treasury paid 0.4 sBTC to agent-05 (treasury 4.7 → 4.3; agent-05 → 0.5).

4. Result matrix

Scenario Mechanism exercised On-chain result
#1 happy path quorum ✓, threshold ✓, ≥2 voters ✓ (ok true) + 0.3 sBTC payout ✅
#2 quorum-not-met turnout < 15% (ok false), no payout ✅
#3 threshold-not-met yes < 66% (quorum met) (ok false), no payout ✅
non-staked vote weight = 0 (err u401) rejected ✅
#4 all-10 participation 10 voters, 5.0 sBTC, 100% yes (ok true) + 0.4 sBTC payout to agent-05 ✅

Verified balances: treasury 4.3 sBTC (5.0 staked − 0.3 [#1] − 0.4 [#4]) · total staked 5.0 sBTC · agent-10 0.9 sBTC · agent-05 0.5 sBTC (both received payouts). Numbers reconcile exactly; the two failed proposals moved nothing.


5. Key engineering notes

  • Deploy at Clarity 3, not 4 — the MCP publishes at Clarity 4 (as-contractas-contract?); deploy via Clarinet which pins v3.
  • sBTC = the Faktory testnet token with a public faucet (the official sBTC has no faucet; DEX swaps like ALEX/Bitflow/Styx are mainnet-only).
  • Post-conditions: all fund-moving calls use postConditionMode: deny + explicit FT post-conditions (never allow).
  • Contracts are immutable (one-time wiring, no upgrade path) and stake-weighted (reputation/heartbeat weighting is a planned v2).