# Aibtc MCP Server [Health: Active]

**Category:** 💰 Finance & Fintech  
**Repository:** https://github.com/aibtcdev/aibtc-mcp-server  
**GitHub Stars:** 12  
**npm Downloads (last month):** 5204  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/mcp-server-85

## Description
Bitcoin-first MCP server for BTC/STX wallets, DeFi, sBTC, NFTs, and x402 paid APIs.

## Tools
Capabilities this server exposes over MCP:

- **get_wallet_info** — Get the agent's wallet address and status. If the agent doesn't have a wallet yet, provides guidance on how to assign one.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_stx_balance** — Get the STX balance for a wallet address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_create** — Create a new wallet for the agent with a generated BIP39 24-word mnemonic.
The wallet is encrypted locally and stored in ~/.aibtc/.
IMPORTANT: Save the mnemonic securely - it will only be shown once!

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_import** — Import an existing wallet for the agent using a BIP39 mnemonic phrase.
The wallet is encrypted locally and stored in ~/.aibtc/.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_unlock** — Unlock the agent's wallet to enable transactions.
If no wallet ID is provided, unlocks the active wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_lock** — Lock the agent's wallet, clearing sensitive data from memory.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_list** — List all wallets available for the agent to use.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_switch** — Switch to a different wallet.
Note: The new wallet will need to be unlocked before use.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_delete** — Permanently delete a wallet.
WARNING: This cannot be undone! Make sure you have backed up your mnemonic.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_export** — Export the mnemonic phrase for a wallet.
WARNING: Only use this in a secure environment! Anyone with the mnemonic can access your funds.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_rotate_password** — Change the password for a wallet's encrypted keystore.
Performs an atomic operation: backs up the keystore, re-encrypts with the new password, verifies the round-trip, then cleans up. If anything fails, the original keystore is restored.
If the wallet is currently unlocked, it will be locked after rotation (requires re-unlock with new password).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_set_timeout** — Set how long the agent's wallet stays unlocked before automatically locking. Set to 0 to disable auto-lock.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **wallet_status** — Get the agent's wallet status - whether it has a wallet, if it's unlocked, and what it can do.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **transfer_stx** — Transfer STX tokens to a recipient address. Signs and broadcasts the transaction.

Example: To send 2 STX, use amount "2000000" (micro-STX).
1 STX = 1,000,000 micro-STX

Tip: call `earning_opportunities` to see how to put your assets to work.
- **broadcast_transaction** — Broadcast a pre-signed Stacks transaction to the network.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **call_contract** — Call a function on a Stacks smart contract. Signs and broadcasts the transaction.

For typed arguments, use objects like {type: 'uint', value: 100} or {type: 'principal', value: 'SP...'}

Post conditions constrain what assets the transaction can move. Each condition is an object:
- STX: {type: 'stx', principal: 'SP...', conditionCode: 'eq'|'gt'|'gte'|'lt'|'lte', amount: '1000000'}
- FT: {type: 'ft', principal: 'SP...', asset: 'SP...contract', assetName: 'token-name', conditionCode: 'eq', amount: '1000'}
- NFT: {type: 'nft', principal: 'SP...', asset: 'SP...contract', assetName: 'nft-name', tokenId: '1', notSend?: boolean}

Spending limit: STX and sBTC leaving this wallet are metered against the wallet's spending cap. In 'deny' mode that is read from eq/lt/lte post conditions on this wallet ('gt'/'gte' on this wallet's own STX or sBTC are refused: they set no upper bound). In 'allow' mode, set maxStxSpend / maxSbtcSpend: they are added as on-chain post conditions on this wallet and metered.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **deploy_contract** — Deploy a Clarity smart contract to the Stacks blockchain.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_transaction_status** — Check the status of a Stacks transaction by its txid.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **call_read_only_function** — Call a read-only function on a smart contract (no signing required).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_get_balance** — Get the sBTC balance for a wallet address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_transfer** — Transfer sBTC tokens to a recipient address.

sBTC uses 8 decimals (same as Bitcoin).
Example: To send 0.001 sBTC, use amount "100000" (satoshis).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_initiate_withdrawal** — Initiate an sBTC peg-out to a Bitcoin L1 address.

Locks (amount + maxFee) of sBTC in the sBTC protocol and creates a withdrawal request.
Signers later process the request and send BTC on L1.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_withdraw** — Alias for sbtc_initiate_withdrawal. Initiates an sBTC peg-out request to BTC L1.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_withdrawal_status** — Check status of an sBTC withdrawal request by requestId or initiating txid.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_withdraw_status** — Alias for sbtc_withdrawal_status. Check the status of an sBTC peg-out (withdrawal) request.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_get_deposit_info** — Get information about how to deposit BTC to receive sBTC.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_get_peg_info** — Get sBTC peg information including total supply and peg ratio.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_deposit** — Deposit BTC to receive sBTC on Stacks L2.

This builds, signs, and broadcasts a Bitcoin transaction to the sBTC deposit address.
After confirmation, sBTC tokens are minted to your Stacks address.

The transaction uses your wallet's Taproot address for the reclaim path.
If the deposit fails, you can reclaim your BTC after the lock time expires.

By default, only uses cardinal UTXOs (safe to spend - no inscriptions).
Set includeOrdinals=true to allow spending ordinal UTXOs (advanced users only).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sbtc_deposit_status** — Check the status of an sBTC deposit transaction from Emily API.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_token_balance** — Get the balance of any SIP-010 token for a wallet address.

Supports well-known tokens by symbol: sBTC, USDCx, ALEX, DIKO
Or use the full contract ID: address.contract-name

Tip: call `earning_opportunities` to see how to put your assets to work.
- **transfer_token** — Transfer any SIP-010 token to a recipient address.

Supports well-known tokens by symbol: sBTC, USDCx, ALEX, DIKO
Or use the full contract ID.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_token_info** — Get metadata for a SIP-010 token (name, symbol, decimals, supply).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **list_user_tokens** — List all fungible tokens owned by an address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_token_holders** — Get the top holders of a SIP-010 token.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_nft_holdings** — List all NFTs owned by an address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_nft_metadata** — Get metadata for a specific NFT (SIP-016).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **transfer_nft** — Transfer an NFT (SIP-009) to a recipient address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_nft_owner** — Get the current owner of a specific NFT.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_collection_info** — Get information about an NFT collection.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_nft_history** — Get the transfer history of NFTs in a collection.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_pox_info** — Current PoX-5 state: reward cycle, burn height, next cycle start, and whether the prepare phase is active (stake, extend and unstake are refused during it).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_stacking_status** — PoX-5 staking status for an address: locked amount, signer manager, lock period, unlock cycle and burn height, any protocol bond membership, and locked/unlocked STX balance.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **list_stacking_signers** — List PoX-5 signer managers in the signer set for a reward cycle (default: next cycle), with the STX delegated to each. A signer manager is what stack_stx stakes with. Only signers with at least the signer-set minimum delegated appear here; other registered managers can still be staked with by contract id. Set withPayoutInfo to see how each manager pays stakers (slower).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stack_stx** — Lock STX in PoX-5 with a signer manager to earn sBTC rewards.

The lock starts next reward cycle and lasts numCycles cycles (1-96). Pick a signer manager with list_stacking_signers. Refused during the prepare phase and if the address is already staking (use extend_stacking). Locking is not a transfer: the transaction carries a staking post-condition for exactly the locked amount.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **extend_stacking** — Update an existing PoX-5 stake: extend the lock, add STX, switch signer manager, or change payout calldata (pox-5 stake-update).

Any combination in one call. Increasing locks more of the address's unlocked STX. Refused during the prepare phase. The lock may not run more than 96 cycles past the next cycle.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **unstake_stx** — Stop a PoX-5 stake early (pox-5 unstake). The STX stays locked through the current reward cycle and unlocks at the start of the next one. Refused during the prepare phase.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_stacking_rewards** — PoX-5 sBTC rewards an address has earned from its signer manager for one reward cycle and not yet claimed (before the manager's fees), whether the manager still has to pull them from pox-5, and whether the manager supports an on-chain staker claim.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **claim_stacking_rewards** — Claim PoX-5 sBTC rewards for one reward cycle through the staker's signer manager. If the manager has not yet pulled that cycle's rewards from pox-5, this first sends the manager's permissionless claim-rewards (a second transaction, paid by this wallet), then the staker claim. Rewards arrive as sBTC, or as a BTC withdrawal if a payout address was set when staking. Not available for managers that pay off-chain.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **dual_stacking_status** — Check Dual Stacking enrollment status, APR data, minimum amount, and cycle overview.

Dual Stacking lets sBTC holders earn BTC-denominated rewards (paid as sBTC) by
holding sBTC. Enrollment runs per PoX cycle; you enroll now to be active next cycle.

Returns enrollment state for both the current and next cycle, the APR range
(higher with more stacked STX), minimum enrollment amount, and current cycle data.

Note: Dual Stacking is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **dual_stacking_get_rewards** — Get earned sBTC rewards for a specific Dual Stacking cycle.

Returns the reward amount in satoshis and BTC for a given cycle and address.
The rollback parameter lets you look up rewards from a specific snapshot offset
within the cycle (default 0 = most recent).

Note: Dual Stacking is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **dual_stacking_enroll** — Enroll in Dual Stacking to earn sBTC rewards.

Enrolls your wallet in the Dual Stacking protocol. Enrollment takes effect at the
start of the next PoX cycle. You must hold the minimum sBTC amount to qualify.

An optional reward address can be specified to receive sBTC rewards at a different
address than the signing wallet. If omitted, rewards go to the signing wallet.

Requires an unlocked wallet with sufficient sBTC balance.

Note: Dual Stacking is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **dual_stacking_opt_out** — Opt out of Dual Stacking.

Removes your wallet from the Dual Stacking protocol. The opt-out takes effect at
the start of the next PoX cycle; you continue to earn rewards for the current cycle.

Requires an unlocked wallet.

Note: Dual Stacking is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_list_pots** — List all known Stackspot stacking lottery pots with current on-chain values.

Stackspot is a stacking lottery on Stacks: participants pool STX into a pot, the pot
stacks via PoX to earn BTC rewards. A VRF-selected winner receives the sBTC yield;
all participants recover their original STX contribution.

Returns each pot's contract ID, configuration, current STX value, and lock status.

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_get_pot_state** — Get full on-chain state for a Stackspot stacking lottery pot.

Returns the pot value, lock status, configurations, pool config, and detailed state.
Use a bare contract name (e.g., "STXLFG") or a fully-qualified identifier
(e.g., "SPT4SQP5RC1BFAJEQKBHZMXQ8NQ7G118F335BD85.STXLFG").

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_join_pot** — Contribute STX to a Stackspot stacking lottery pot.

Joins a pot by contributing STX. Your STX is locked until the stacking cycle
completes. All participants recover their STX regardless of who wins; only the
VRF-selected winner receives the sBTC yield.

Use a bare contract name (e.g., "STXLFG") or a fully-qualified identifier.
Amount must be in micro-STX (1 STX = 1,000,000 micro-STX).

Requires an unlocked wallet with sufficient STX balance.

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_start_pot** — Trigger a full Stackspot pot to begin stacking via the platform contract.

Initiates stacking for a pot that has reached its participant limit. This call
goes through the platform contract (stackspots) and must be made during the PoX
prepare phase. Any participant can call this once the pot is full.

Use a bare contract name (e.g., "STXLFG") or a fully-qualified identifier.

Requires an unlocked wallet.

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_claim_rewards** — Claim rewards from a completed Stackspot stacking lottery pot.

After stacking completes and a winner is selected by VRF, each participant claims
their share: all participants recover their contributed STX; the VRF-selected winner
also receives the sBTC yield earned during the stacking cycle.

Use a bare contract name (e.g., "STXLFG") or a fully-qualified identifier.

Requires an unlocked wallet.

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stackspot_cancel_pot** — Cancel a Stackspot stacking lottery pot before stacking begins.

Cancels an unlocked pot to recover contributed STX. The pot must not yet be locked
(i.e., stacking has not started). Once stacking begins the pot cannot be cancelled.

Use a bare contract name (e.g., "STXLFG") or a fully-qualified identifier.

Requires an unlocked wallet.

Note: Stackspot is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lookup_bns_name** — Resolve a .btc domain name to its Stacks address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reverse_bns_lookup** — Get the BNS domain names owned by an address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_bns_info** — Get detailed information about a BNS domain name.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **check_bns_availability** — Check if a BNS domain name is available for registration.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_bns_price** — Get the registration price for a BNS domain name.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **list_user_domains** — List all BNS domains owned by an address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **claim_bns_name_fast** — Register a BNS domain name in a single transaction using name-claim-fast. This is the RECOMMENDED method — no preorder/register wait needed. Burns the name price in STX and mints the BNS NFT atomically. Works for all open namespaces (BNS V2).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **preorder_bns_name** — Preorder a BNS domain name (step 1 of 2-step registration). NOTE: For .btc names, prefer claim_bns_name_fast instead — it registers in one transaction. Use this 2-step flow only for non-.btc namespaces or if claim-fast is unavailable. After preorder is confirmed (~10 minutes), call register_bns_name with the same salt. IMPORTANT: Save the returned salt - you'll need it for the register step!

Tip: call `earning_opportunities` to see how to put your assets to work.
- **register_bns_name** — Register a BNS domain name after preorder is confirmed. This is step 2 of a 2-step process. You MUST use the same salt from the preorder step. Only call this after the preorder transaction has been confirmed on-chain (~10 minutes). Auto-detects contract version: V2 for .btc names, V1 for other namespaces.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_stx_fees** — Get current STX fee estimates for different priority levels. Returns low, medium, and high fee tiers in micro-STX, based on mempool analysis.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_account_info** — Get detailed account information including nonce and balance.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_account_transactions** — Get transaction history for an account.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_block_info** — Get information about a specific block.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_mempool_info** — Get pending transactions in the mempool.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_contract_info** — Get information about a smart contract including its ABI.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_contract_events** — Get events emitted by a smart contract.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_network_status** — Get the current status of the Stacks network.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_get_summary** — Get aggregated reputation summary for an agent from the ERC-8004 reputation registry. Returns average rating as a WAD string (18 decimals) and total feedback count. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_read_feedback** — Read a specific feedback entry for an agent by index from the ERC-8004 reputation registry. Returns client address, value, decimals, tags, and timestamp. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_read_all_feedback** — Read all feedback entries for an agent with optional tag filtering and pagination. Returns up to 20 entries per page. Pass nextCursor from the previous response to page. WARNING: Uses one RPC call per entry (N+1 pattern) — avoid calling for agents with large feedback sets without using cursor-based pagination. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_get_clients** — Get a paginated list of clients who gave feedback to an agent. Returns client addresses and a nextCursor for pagination. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_get_feedback_count** — Get the total number of feedback entries for an agent from the ERC-8004 reputation registry. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_get_approved_limit** — Get the approved feedback index limit for a specific client of an agent. Returns the maximum index up to which the client is approved to submit feedback. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_get_last_index** — Get the last feedback index submitted by a specific client for an agent. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_give_feedback** — Submit feedback for an agent using the ERC-8004 reputation registry. Value is normalized to 18 decimals (WAD) internally for aggregation. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_revoke_feedback** — Revoke a previously submitted feedback entry by index. Only the original submitter can revoke their feedback. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_append_response** — Append a response to feedback received from a client. Must be called by the agent that received the feedback. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **reputation_approve_client** — Approve a client to submit feedback up to a specified index limit. Must be called by the agent owner. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **list_x402_endpoints** — List x402 API endpoints. x402.aibtc.com and stx402.com are read live from their OpenAPI specs; the stx402.com directory lists x402 endpoints registered by third parties.

Sources:
- x402.biwas.xyz: DeFi analytics, market data, wallet analysis, Zest/ALEX protocols
- x402.aibtc.com: AI inference, Stacks utilities, hashing, storage (live)
- stx402.com: x402 endpoint registry, agent registry (ERC-8004), links (live)
- aibtc.com: Inbox messaging
- directory: third-party endpoints registered at stx402.com (live, mainnet). Unverified entries are hidden unless includeUnverified is true — probe before paying.

Costs from live specs are tiers ("paid (standard)", "paid (dynamic)"); use probe_x402_endpoint for the exact price.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **execute_x402_endpoint** — Execute an x402 API endpoint. Payment is handled automatically.

Supported sources:
- x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet), the default: Use path like "/inference/openrouter/chat"
- x402.biwas.xyz: Use apiUrl="https://x402.biwas.xyz" with path like "/api/pools/trending"
- stx402.com: Use apiUrl="https://stx402.com" with path like "/registry/list"
- aibtc.com (mainnet) / aibtc.dev (testnet): Use apiUrl="https://aibtc.com" with path like "/api/inbox/{address}"
- Any x402-compatible URL: Use url parameter with full endpoint URL

Use list_x402_endpoints to discover available endpoints.

For aibtc.com inbox messages, use send_inbox_message_direct instead — it signs a standard sBTC transfer and settles directly through the x402 facilitator.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **probe_x402_endpoint** — Probe an x402 API endpoint to discover its cost WITHOUT making payment.

This tool is useful for:
- Discovering the cost of a paid endpoint before executing
- Checking if an endpoint is free or requires payment
- Presenting costs to users for approval before paying

For free endpoints, returns the response data directly.
For paid endpoints, returns payment details (amount, asset, recipient) without executing payment.

After probing a paid endpoint, use execute_x402_endpoint to actually execute and pay.

Supported sources:
- x402.aibtc.com (mainnet) / x402.aibtc.dev (testnet), the default: Use path like "/inference/openrouter/chat"
- x402.biwas.xyz: Use apiUrl="https://x402.biwas.xyz" with path like "/api/pools/trending"
- stx402.com: Use apiUrl="https://stx402.com" with path like "/registry/list"
- aibtc.com (mainnet) / aibtc.dev (testnet): Use apiUrl="https://aibtc.com" with path like "/api/inbox/{address}"
- Any x402-compatible URL: Use url parameter with full endpoint URL

Tip: call `earning_opportunities` to see how to put your assets to work.
- **alex_get_swap_quote** — Get a swap quote from ALEX DEX.

Returns the expected output amount for swapping tokenX to tokenY.
Use full contract IDs for tokens (e.g., 'SP102V8P0F7JX67ARQ77WEA3D3CFB5XW39REDT0AM.token-wstx-v2').

Note: ALEX DEX is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **alex_swap** — Execute a token swap on ALEX DEX.

Swaps tokenX for tokenY using the ALEX AMM.
Use full contract IDs for tokens.

Note: ALEX DEX is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **alex_get_pool_info** — Get liquidity pool information from ALEX DEX.

Returns reserve balances and pool details for a token pair.

Note: ALEX DEX is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **alex_list_pools** — List all available trading pools on ALEX DEX.

Discovers all token pairs that can be swapped directly.
Returns pool ID, token pair, and factor (fee tier) for each pool.

Use this to find which tokens can be swapped before calling alex_swap.

Note: ALEX DEX is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_list_assets** — List all supported assets on Zest Protocol (v0-4-market).

Returns the list of assets that can be supplied, borrowed, or used as collateral.
Each asset includes its symbol, name, and contract ID.

Supported assets: wSTX, sBTC, stSTX, USDC, USDH, stSTXbtc.

Note: Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_get_position** — Get user's lending position on Zest Protocol (v0-4-market).

Returns collateral, debt, health factor, and LTV data across all assets.
The position query returns USD-denominated totals.

Note: Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_supply** — Supply assets to Zest Protocol (v0-4-market).

Deposits assets and adds them as collateral in one atomic operation.
The supplied assets earn yield AND provide borrowing power.
You can use the asset symbol (e.g., 'sBTC', 'USDC') or full contract ID.

Supported assets: wSTX, sBTC, stSTX, USDC, USDH, stSTXbtc.

Note: Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_withdraw** — Withdraw assets from Zest Protocol (v0-4-market).

Removes collateral and redeems for underlying assets in one atomic operation.
You can use the asset symbol (e.g., 'sBTC', 'USDC') or full contract ID.

Note: Amount is in zToken shares. Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_borrow** — Borrow assets from Zest Protocol (v0-4-market).

Borrows assets against your supplied collateral.
Ensure you have sufficient collateral to maintain a healthy LTV.
You can use the asset symbol (e.g., 'USDC', 'sBTC') or full contract ID.

Three LTV tiers: ~75% (borrow limit), ~85% (partial liquidation), ~95% (full liquidation).

Note: Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_enable_collateral** — Add existing zTokens as collateral on Zest Protocol v2.

Use this when you deposited directly to a vault and need to register
those zTokens as collateral for borrowing.

Note: zest_supply already handles this atomically via supply-collateral-add.
This tool is only needed if you used vault deposit separately.

Mainnet only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **zest_repay** — Repay borrowed assets to Zest Protocol (v0-4-market).

Repays borrowed assets plus accrued interest.
You can use the asset symbol (e.g., 'USDC', 'sBTC') or full contract ID.

Note: Zest Protocol is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_ticker** — Get market ticker data from Bitflow DEX.

Returns price, volume, and liquidity data for all trading pairs.
This endpoint does NOT require an API key.

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_tokens** — Get all available tokens for swapping on Bitflow.

Returns the list of tokens that can be swapped on Bitflow DEX.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_swap_targets** — Get possible swap target tokens for a given input token on Bitflow.

Returns all tokens that can be received when swapping from the specified token.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_quote** — Get a swap quote from Bitflow DEX.

Returns the expected output amount and best route for swapping tokens.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_routes** — Get all possible swap routes between two tokens on Bitflow.

Returns all available routes for swapping from tokenX to tokenY,
including multi-hop routes through intermediate tokens.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_swap** — Execute a token swap on Bitflow DEX.

Swaps tokenX for tokenY using Bitflow's aggregated liquidity.
Automatically finds the best route across all Bitflow pools.
No API key required — uses public endpoints (500 req/min).
Requires an unlocked wallet with sufficient token balance.

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_keeper_contract** — Get or create a Bitflow Keeper contract for automated swaps.

Keeper contracts enable scheduled/automated token swaps.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_create_order** — Create an automated swap order via Bitflow Keeper.

Creates a pending order that will be executed by the Keeper service.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_order** — Get details of a Bitflow Keeper order.

Retrieves the status and details of a specific order.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_cancel_order** — Cancel a Bitflow Keeper order.

Cancels a pending order before execution.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bitflow_get_keeper_user** — Get Bitflow Keeper user info and orders.

Retrieves user's keeper contracts and order history.
No API key required — uses public endpoints (500 req/min).

Note: Bitflow is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_pool_status** — Get current Styx pool liquidity and status. Shows realAvailable and estimatedAvailable BTC in the pool.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_pools** — List all available Styx pools with their configurations. Pools: main (up to 300k sats, sbtc/usda/pepe), aibtc (up to 1M sats, sbtc/aibtc). Minimum deposit: 10,000 sats for both pools.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_fees** — Get current Bitcoin network fee estimates (sat/vB) from Styx: low, medium, high.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_price** — Get current BTC price in USD from Styx.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_deposit** — Full headless BTC→sBTC deposit via the Styx protocol. Flow: reserve pool liquidity → build PSBT locally → sign with wallet keys → broadcast to mempool.space → update deposit status. Requires an unlocked wallet with sufficient BTC balance. On mainnet, ordinal UTXOs are automatically filtered out to protect inscriptions. Minimum deposit: 10,000 sats. Pool limits: main=300k sats, aibtc=1M sats.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_status** — Check the status of a Styx BTC→sBTC deposit by deposit ID or Bitcoin transaction ID.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **styx_history** — Get BTC→sBTC deposit history for a Stacks address via Styx. Uses the active wallet's Stacks address if no address is provided.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **scaffold_x402_endpoint** — Create a complete x402 paid API project as a Cloudflare Worker.

This creates a NEW PROJECT FOLDER with everything needed to deploy a pay-per-use API:
- Full Hono.js application with x402 payment middleware
- Ready for deployment to Cloudflare Workers
- Based on production patterns from x402-api and stx402

## What Gets Created

A folder named `{projectName}` containing:
- src/index.ts - Hono app with your x402-protected endpoints
- src/x402-middleware.ts - Payment verification (uses native relay fetch)
- wrangler.jsonc - Cloudflare Worker config with staging/production envs
- package.json - Dependencies including hono (no x402-stacks dependency)
- .dev.vars - Local dev variables (pre-filled if you have a wallet)
- README.md - Documentation

## Pricing Tiers

Use tiers for consistent pricing:
- **simple/standard**: 0.001 STX
- **ai**: 0.003 STX
- **heavy_ai**: 0.01 STX
- **storage_read**: 0.0005 STX
- **storage_write**: 0.001 STX

## Quick Start After Generation

```
cd {projectName}
npm install
npm run dev
```

Tip: call `earning_opportunities` to see how to put your assets to work.
- **scaffold_x402_ai_endpoint** — Create a complete x402 paid AI API project with OpenRouter integration.

This creates a NEW PROJECT FOLDER with everything needed to deploy a pay-per-use AI API:
- Full Hono.js application with x402 payment middleware
- OpenRouter integration for Claude, GPT-4, Llama, etc.
- Ready for deployment to Cloudflare Workers

## What Gets Created

A folder named `{projectName}` containing:
- src/index.ts - Hono app with your x402-protected AI endpoints
- src/x402-middleware.ts - Payment verification (uses native relay fetch)
- src/openrouter.ts - OpenRouter API client
- wrangler.jsonc - Cloudflare Worker config
- .dev.vars - Local dev variables (needs OPENROUTER_API_KEY)
- README.md - Documentation

## AI Types

- **chat**: General chat/Q&A
- **completion**: Text completion
- **summarize**: Summarize text
- **translate**: Translate text
- **custom**: Custom system prompt

## Quick Start After Generation

```
cd {projectName}
npm install
# Edit .dev.vars with RECIPIENT_ADDRESS and OPENROUTER_API_KEY
npm run dev
```

Tip: call `earning_opportunities` to see how to put your assets to work.
- **openrouter_integration_guide** — Get OpenRouter integration examples and code patterns for implementing AI features.

Use this tool when you need to add AI capabilities to any project. Returns:
- Code examples for different environments (Node.js, Cloudflare Workers, browser)
- API patterns and best practices
- Model recommendations
- Error handling patterns

This is a reference tool - use the returned code as a template for implementation.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **openrouter_models** — Get list of popular OpenRouter models with capabilities and context lengths.

Use this to choose the right model for your use case. For latest pricing, check openrouter.ai/models

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_hunter_start** — Start autonomous yield hunting.

This will:
1. Monitor your wallet for sBTC
2. Automatically deposit sBTC to Zest Protocol when balance exceeds threshold
3. Keep a configurable reserve (default: 0, deposits all sBTC)
4. Wait for transaction confirmations before proceeding
5. Retry failed transactions with exponential backoff
6. Run continuously until stopped

Requires an unlocked wallet (use wallet_unlock first).
Only works on mainnet (Zest Protocol is mainnet-only).

Note: Stacks transaction fees are paid in STX, not sBTC.

Default settings:
- Deposit threshold: 10,000 sats (0.0001 sBTC)
- Reserve: 0 sats (deposit all sBTC to maximize yield)
- Check interval: 10 minutes

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_hunter_stop** — Stop autonomous yield hunting.

Stops the background process that monitors and deposits sBTC.
Your existing Zest positions remain untouched.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_hunter_status** — Get current yield hunter status.

Shows:
- Whether yield hunting is active
- Current configuration
- Statistics (checks run, deposits made)
- Recent activity logs
- Current Zest position

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_hunter_configure** — Configure yield hunter settings.

Adjust the deposit threshold, reserve, or check interval.
Changes take effect on the next check cycle.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_dashboard_overview** — Portfolio overview across Stacks DeFi protocols.

Aggregates positions across Zest Protocol (sBTC lending), ALEX DEX (AMM LP),
Bitflow (DEX LP), and STX Stacking. Returns total value, weighted APY, and
per-protocol breakdown.

Read-only. Mainnet-only. Requires an unlocked wallet for address context.

Note: ALEX LP and Bitflow LP position values are 0 — these protocols do not
expose user LP positions via read-only calls. Only Zest has a live APY; ALEX,
Bitflow and Stacking report apyPct: null.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_dashboard_positions** — Detailed per-protocol DeFi position data.

Returns an array of positions across Zest Protocol, ALEX DEX, Bitflow, and
STX Stacking. Each position includes protocol, asset, value, APY, risk score,
and protocol-specific details.

Read-only. Mainnet-only. Requires an unlocked wallet for address context.

Known limitations:
- ALEX LP and Bitflow LP: valueSats shows 0 (protocol does not expose user
  LP balances via read-only calls).
- apyPct is null for ALEX, Bitflow and Stacking (no live source).
- Stacking: denominated in microSTX, not sats.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_dashboard_apy_breakdown** — Current APY rates across all supported Stacks DeFi protocols.

Returns live APY data for Zest Protocol (sBTC lending), ALEX DEX (aBTC/STX LP),
Bitflow (sBTC LP), and STX Stacking. No wallet required — pure market data.

Data sources:
- Zest Protocol: on-chain reserve state (current-liquidity-rate, Ray units)
- ALEX DEX: null — no live APY source
- Bitflow: null — no public pool APY endpoint
- STX Stacking: null — pox-5 rewards are sBTC, paid per signer manager

Mainnet data only (contract addresses are mainnet-specific).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **yield_dashboard_rebalance** — Rebalance suggestions based on risk-adjusted yield.

Reads current positions across all protocols, compares to optimal allocation
for the chosen risk tolerance, and returns actionable suggestions.

Risk tolerance levels:
- low:    Zest 40%, ALEX 10%, Bitflow 10%, Stacking 40%
- medium: Zest 45%, ALEX 20%, Bitflow 15%, Stacking 20% (default)
- high:   Zest 50%, ALEX 30%, Bitflow 20%, Stacking 0%

Read-only. Mainnet-only. Requires an unlocked wallet for address context.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_connect** — Connect to your Pillar smart wallet. Opens the Pillar website - if you're logged in, it will automatically connect and return your wallet address. Use this first before other Pillar actions.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_disconnect** — Disconnect from Pillar. Clears locally stored wallet address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_status** — Check if you're connected to Pillar and get your wallet address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_send** — Send sBTC from your Pillar smart wallet. Requires being connected first (use pillar_connect). Opens the frontend for signing, then waits for confirmation. Supports three recipient types: 'bns' for BNS names (muneeb.btc), 'wallet' for Pillar wallet names (iphone), 'address' for Stacks addresses (SP...).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_fund** — Fund your Pillar smart wallet. Supports multiple methods:
- 'exchange': Deposit BTC from an exchange (Coinbase, Binance, etc.) - generates a deposit address
- 'btc': Deposit BTC from your Leather/Xverse wallet - auto-converts to sBTC
- 'sbtc': Deposit sBTC directly from your Leather/Xverse wallet
Opens the frontend with the appropriate deposit flow.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_add_admin** — Add a backup admin address to your Pillar smart wallet for recovery purposes. The admin can help recover funds if you lose access to your passkey.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_supply** — Earn yield on your Bitcoin. Supply sBTC from your Pillar smart wallet to Zest Protocol. Your sBTC earns interest with no leverage and no liquidation risk. This is the simplest way to earn on Pillar (Earn tab). For leveraged exposure, use pillar_boost instead.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_auto_compound** — Configure auto-compound for your Pillar wallet. When enabled, a keeper will automatically boost your position when sBTC accumulates in your wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_unwind** — Close or reduce your leveraged sBTC position. Opens a modal to repay borrowed sBTC and withdraw collateral back to your wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_boost** — Create or increase a leveraged sBTC position (up to 1.5x) on your Pillar smart wallet. Opens the Pillar website Boost tab where you can set the amount and confirm. Your sBTC is supplied to Zest, borrowed against, and re-supplied for amplified Bitcoin exposure. For simple yield without leverage, use pillar_supply (Earn) instead. Amounts over 100,000 sats automatically enter DCA mode -- split into daily 100k-sat chunks (max 700k sats per schedule). The first chunk executes immediately, the rest follow daily.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_position** — View your Pillar wallet balance and Zest position. Opens the Position page in the browser AND returns the data (sBTC balance, collateral, borrowed, LTV, liquidation price).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_create_wallet** — Create a new Pillar smart wallet. Opens the Pillar website to complete registration. You'll need to enter your email to receive updates. If the user doesn't have a referral link, tell them they can DM @pillar_btc on X (https://x.com/pillar_btc) to request one before signing up.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_invite** — Get your Pillar referral link to invite friends. Share this link and earn rewards when friends sign up.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_dca_invite** — Invite a DCA partner by email or wallet address. DCA partners hold each other accountable — both must boost each week to keep the streak alive.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_dca_partners** — View your DCA partners and weekly status. Shows active partnerships with streak, PnL, and weekly status badges, plus any pending invites.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_dca_leaderboard** — View the DCA streak leaderboard. Shows top partnerships by streak length, and highlights your entry if you have one.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_dca_status** — Check your DCA schedule status. Shows all active DCA schedules (up to 10) with chunk progress (completed, pending, failed) and next execution time.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_key_generate** — Generate a new secp256k1 signing keypair for Pillar smart wallet direct operations. Returns the compressed public key (33 bytes hex). After generation, propose this pubkey on your smart wallet contract (admin must do this).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_key_unlock** — Unlock a signing key for Pillar direct operations. Uses auto-derived password. Usually not needed — tools auto-unlock on first use.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_key_lock** — Lock the signing key, clearing sensitive data from memory.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_key_info** — Show signing key info: pubkey, smart wallet, lock status, and all stored keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_boost** — Create or increase a leveraged sBTC position (up to 1.5x) on your Pillar smart wallet. Agent-signed, no browser needed. Your sBTC is supplied to Zest, borrowed against, and re-supplied for amplified Bitcoin exposure. Backend sponsors gas. For simple yield without leverage, use pillar_direct_supply instead.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_unwind** — Close or reduce your leveraged sBTC position. Agent-signed, no browser needed. Swaps sBTC to aeUSDC to repay debt, then withdraws remaining sBTC collateral. Backend sponsors gas.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_supply** — Earn yield on your Bitcoin. Supply sBTC from your Pillar smart wallet to Zest Protocol. No leverage, no liquidation risk. Agent-signed, no browser needed. Backend sponsors gas. For leveraged exposure (1.5x), use pillar_direct_boost instead.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_send** — Send sBTC from your Pillar smart wallet to a recipient. Agent-signed, no browser needed. Supports BNS names, wallet names, or Stacks addresses. Backend sponsors gas.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_auto_compound** — Configure auto-compound for your Pillar wallet. When enabled, a keeper automatically boosts when sBTC accumulates above the trigger. Agent-signed, no browser needed. Backend sponsors gas.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_position** — View your Pillar smart wallet balances (STX, sBTC, aeUSDC) and Zest position. No signing needed — reads on-chain data.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_withdraw_collateral** — Withdraw sBTC collateral from Zest on the Pillar smart wallet. Agent-signed, no browser needed. Backend sponsors gas.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_add_admin** — Add a backup admin address to your Pillar smart wallet for recovery purposes. Agent-signed, no browser needed. The admin can help recover funds if you lose access to your passkey. Backend sponsors gas.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_create_wallet** — Create a new Pillar smart wallet for agent direct operations. This is a bundled operation: generates a signing keypair, unlocks it, and deploys a new smart wallet with the pubkey registered. Backend deploys the contract and calls onboard() in background. After ~20-30 seconds the wallet is ready for pillar_direct_* operations.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_dca_invite** — Invite a DCA partner by email or wallet address. DCA partners hold each other accountable — both must boost each week to keep the streak alive.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_dca_partners** — View your DCA partners and weekly status. Shows active partnerships with streak, PnL, and weekly status badges, plus any pending invites.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_dca_leaderboard** — View the DCA streak leaderboard. Shows top partnerships by streak length, and highlights your entry if you have one.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_dca_status** — Check your DCA schedule status. Shows all active DCA schedules (up to 10) with chunk progress (completed, pending, failed) and next execution time.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_quote** — Get a boost quote showing projected leverage, LTV, and swap details. No signing needed. Use this to determine aeUsdcToBorrow and minSbtcFromSwap before calling pillar_direct_boost.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_resolve_recipient** — Resolve a recipient before sending. Resolves BNS names (.btc) via backend, Pillar wallet names via backend, or validates a Stacks address. Use this BEFORE pillar_direct_send to confirm the resolved address with the user.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_stack_stx** — Stack STX from your Pillar smart wallet via Fast Pool or Stacking DAO. Agent-signed, no browser needed. Backend sponsors gas. Fast Pool delegates STX to the pox4-fast-pool-v3 contract through pox-4, and is refused while pox-4 is not the active PoX contract (PoX-5 is live; use stack_stx for PoX-5 staking). Stacking DAO deposits STX into Stacking DAO core for stSTX yield. Your wallet must be enrolled in dual stacking first (automatic for v2 wallets with sBTC).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_revoke_fast_pool** — Revoke Fast Pool STX delegation from your Pillar smart wallet (pox-4 revoke-delegate-stx; refused while pox-4 is not the active PoX contract). Agent-signed, no browser needed. Backend sponsors gas. After revoking, STX stays locked until the current PoX cycle ends, then returns to liquid.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **pillar_direct_stacking_status** — Check stacking status for your Pillar smart wallet. No signing needed — reads on-chain data. Shows STX balance (locked vs liquid), current PoX cycle info, and dual stacking enrollment status.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_balance** — Get the BTC balance for a Bitcoin address. Returns both total balance (including unconfirmed) and confirmed balance.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_fees** — Get current Bitcoin fee estimates for different confirmation targets. Returns fast (~10 min), medium (~30 min), and slow (~1 hour) fee rates in sat/vB.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_utxos** — List all UTXOs (Unspent Transaction Outputs) for a Bitcoin address. Useful for debugging, transparency, and understanding transaction inputs.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **transfer_btc** — Transfer BTC to a recipient address. Builds, signs, and broadcasts a Bitcoin transaction. Requires an unlocked wallet with BTC balance. By default, only uses cardinal UTXOs (safe to spend - no inscriptions). Set includeOrdinals=true to allow spending ordinal UTXOs (advanced users only).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_cardinal_utxos** — Get cardinal UTXOs (safe to spend - no inscriptions or runes). Cardinal UTXOs are regular Bitcoin outputs that do not contain ordinal inscriptions or rune balances. These UTXOs can be safely used for regular Bitcoin transfers and fees. Backed by the Unisat indexer; set UNISAT_API_KEY to lift free-tier rate limits.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_ordinal_utxos** — Get ordinal UTXOs (contain inscriptions or runes - do not spend). Ordinal UTXOs carry inscriptions or rune balances and should not be spent in regular transfers. Backed by the Unisat indexer; set UNISAT_API_KEY to lift free-tier rate limits.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_inscriptions_by_address** — Get all inscriptions owned by a Bitcoin address. Returns inscription IDs, content types, and metadata. Backed by the Unisat indexer; set UNISAT_API_KEY to lift free-tier rate limits.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_create** — Create a new embedded Lightning wallet backed by the Spark SDK. Generates a fresh BIP39 mnemonic (shown once), encrypts it with the provided password, and stores it at ~/.aibtc/lightning/keystore.json. Returns the deposit address for funding the wallet from L1 BTC.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_import** — Import an existing Lightning wallet into the embedded Spark-backed store from a BIP39 mnemonic phrase. Encrypted locally at ~/.aibtc/lightning/keystore.json.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_unlock** — Unlock the Lightning wallet for the current session. Required before paying or creating invoices, and before the L402 interceptor can auto-pay challenges.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_lock** — Lock the Lightning wallet and drop the Spark session from memory. L402 auto-pay will stop working until the wallet is unlocked again.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_status** — Get the status of the embedded Lightning wallet: whether it's unlocked, its wallet id, current balance (if unlocked), deposit address, and optional Lightning address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_fund_from_btc** — Fund the Lightning wallet from the user's L1 BTC wallet. Sends BTC to the Spark deposit address and returns the L1 txid. After the transaction confirms on-chain, the deposit must be claimed to credit the Lightning balance (separate follow-up step; not automated in this PR). Requires the main wallet to be unlocked AND the Lightning wallet to be unlocked (to fetch the deposit address).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_claim_deposit** — Claim a confirmed BTC L1 deposit into the Spark Lightning wallet. Call this AFTER lightning_fund_from_btc and after the on-chain transaction has 3 confirmations. Fetches a signed quote from the SSP, submits the claim, and returns the credited sats + Spark transfer id. Requires an unlocked Lightning wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_pay_invoice** — Pay a BOLT-11 Lightning invoice from the embedded Lightning wallet. Returns the payment preimage (proof of payment) and fees paid.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **lightning_create_invoice** — Create a BOLT-11 Lightning invoice that can receive a payment into the embedded Lightning wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_mempool_info** — Get current Bitcoin mempool statistics including transaction count, virtual size, total fees, and fee histogram. Useful for monitoring network congestion and estimating confirmation times.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_transaction_status** — Get confirmation status and details for a Bitcoin transaction by txid. Returns whether the transaction is confirmed, block height, fee, size, and I/O summary. Works for both confirmed and unconfirmed (mempool) transactions.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_btc_address_txs** — Get recent transaction history for a Bitcoin address (last 25 transactions). Returns a summary of each transaction including confirmation status, fee, and amounts. Useful for monitoring address activity and verifying payment receipts.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_get_pubkey** — Derive the Nostr public key from the active wallet. Uses the NIP-06 derivation path (m/44'/1237'/0'/0/0). Returns both hex pubkey and npub (bech32) formats. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_post** — Publish a short-text note (kind:1) to Nostr relays. Optionally include hashtag tags and specify target relays. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_read_feed** — Read recent kind:1 notes from Nostr relays. Optionally filter by author pubkey. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_search_tags** — Search Nostr for kind:1 notes matching hashtags using NIP-12 #t filter. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_get_profile** — Get a Nostr profile (kind:0 metadata) for any public key. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_set_profile** — Update the agent's Nostr profile (kind:0 metadata event). Only provided fields are updated; existing fields are preserved by fetching the current profile first. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_relay_list** — List the configured default Nostr relay URLs. No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **check_relay_health** — Check the sponsor relay health and nonce status.

Use this tool for operator diagnostics around relay-owned sponsor state. It will:
- Check relay availability
- Inspect sponsor address nonce state
- Detect nonce gaps that block transactions
- Detect mempool desync (confirmed nonce far behind mempool nonce)
- List stuck transactions with txid, nonce, and how long they have been pending
- Report mempool congestion

This tool does not redefine caller-facing x402 payment states. Use paymentId
polling for payment lifecycle truth; use this output only as backup diagnostics.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **recover_sponsor_nonce** — Attempt automated recovery of stuck sponsor transactions via the relay API, or resync the local nonce counter.

Run check_relay_health first to identify stuck txids and missing nonces, then use
this tool to trigger recovery without needing to contact the AIBTC team manually.

Recovery modes:
- rbf: Replace-by-fee — rebroadcasts stuck transactions with a higher fee so miners
  prioritize them. Provide specific txids or omit to bump all stuck transactions.
- fill-gaps: Nonce gap-fill — submits placeholder transactions to fill any missing
  nonces that are blocking the queue. Provide specific nonces or omit to fill all gaps.
- both: Attempt both RBF and gap-fill in sequence (default).
- resync-local-nonce: Force-reset the MCP server's in-memory nonce counter for the
  active wallet. Use this when the local counter is out of sync with the chain (e.g.
  after a server restart, manual transaction sent outside the MCP server, or a
  confirmed-but-locally-stuck counter). The counter will be re-seeded from the chain
  on the next transaction. Requires the wallet to be unlocked.

If the relay does not yet support relay endpoints it returns a 404 or 501 and this
tool will respond with a clear message rather than throwing an error. In that case,
share the txids and nonces from check_relay_health with the AIBTC team.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nonce_health** — Check the sender nonce health for the active wallet.

Compares the local nonce tracker state (persisted at ~/.aibtc/nonce-state.json)
against the chain's view from Hiro API. Use this to diagnose:
- Nonce conflicts (ConflictingNonceInMempool)
- Stuck transaction queues
- Gaps in the nonce sequence
- Stale local tracker state

Returns:
- local: lastUsedNonce, pending count, staleness
- chain: possibleNextNonce, lastExecuted, mempool nonces, missing nonces
- healthy: whether the nonce state looks good
- issues: list of detected problems with recommendations

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nonce_fill_gap** — Fill a nonce gap by sending a minimal STX transfer at the specified nonce.

LAST-RESORT recovery action. Each gap-fill is a real on-chain transaction with a real
fee (~0.001-0.01 STX). Most gaps self-resolve within seconds as Stacks blocks are 3-5s.
Only use this after confirming the gap persists via nonce_health.

When transactions are pending but a gap exists in the nonce sequence (e.g., nonces
5 and 7 are pending but 6 is missing), the Stacks mempool will not process nonces
7+ until 6 is filled. This tool fills the gap with a 1 micro-STX transfer to the
PoX burn address.

Use nonce_health first to identify gaps, then call this tool for each missing nonce.

Requires the wallet to be unlocked. The fee is auto-estimated.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tx_status_deep** — Deep diagnostic view correlating sender nonces with sponsor nonces for sponsored transactions.

Reads the sender's local pending txid log and cross-references each entry against
the sponsor's mempool to show the full lifecycle of sponsored transactions:
- Which sender nonce maps to which sponsor nonce
- Whether sponsor nonce gaps are blocking specific transactions
- Which pending txids are missing from the sponsor mempool entirely
- Multiple competing txids (RBF candidates) for the same sender nonce slot

Output per nonce slot:
  Sender nonce N:
    - 0xabc (sponsored, sponsor nonce 47) -- BLOCKED by missing sponsor nonces [44, 45]
    - 0xdef (direct, fee 0.01 STX) -- competing RBF candidate
  Sender nonce M (0xghi, sponsored) -> sponsor nonce 48 -- pending, no gaps ahead
  Sender nonce P (0xjkl, sponsored) -> NOT IN SPONSOR MEMPOOL

Use this when check_relay_health shows issues but you need per-transaction clarity.
Returns structured JSON with pendingSlots, sponsorMissingNonces, and summary counts.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nonce_heal** — Diagnose and heal the full nonce state for the active wallet in one shot.

Handles 90% of stuck-tx cases automatically:
1. Fetches current nonce state from Hiro API (gaps, mempool)
2. In dryRun mode: shows what would happen without broadcasting
3. In execute mode (dryRun=false):
   - Fills every gap with a 1 uSTX self-transfer to the PoX burn address
   - Optionally RBF-bumps the chain head (lowest non-gap pending tx) to kick off processing

RBF bump behavior:
- Token-transfer txs: rebuilt at same nonce with fee * feeMultiplier and rebroadcast
- Sponsored txs: skipped with explanation (sender cannot RBF without sponsor key)
- Contract-call txs: skipped with manual RBF instructions

Always run nonce_health first to understand the current state.
Requires wallet to be unlocked for execute mode (dryRun=false).

Returns:
- address, dryRun flag, confirmedNonce
- gapsFound: list of missing nonces
- actions: per-action detail (fill_gap or bump_head) with txids, fees, status
- warnings: informational notes
- summary: human-readable description of what happened

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_list** — List prediction markets on stacksmarket.app.

Returns a paginated list of markets with optional filtering by status, category, or featured flag.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_search** — Search prediction markets by keyword on stacksmarket.app.

Searches across market titles and descriptions.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_get** — Get full details for a specific prediction market on stacksmarket.app.

Market IDs are epoch millisecond timestamps (uint) visible in market URLs.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_quote_buy** — Get an LMSR buy price quote for YES or NO shares on a Stacks Market prediction market.

Returns the cost in micro-STX to buy the requested number of shares.
Side: 0 = YES, 1 = NO.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_quote_sell** — Get an LMSR sell price quote for YES or NO shares on a Stacks Market prediction market.

Returns the proceeds in micro-STX for selling the requested number of shares.
Side: 0 = YES, 1 = NO.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_buy_yes** — Buy YES shares in a Stacks Market prediction market.

Uses the buy-yes-auto function with slippage protection via a max-cost cap.
The transaction will fail if the cost exceeds max_cost_ustx.

Requires an unlocked wallet. Only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_buy_no** — Buy NO shares in a Stacks Market prediction market.

Uses the buy-no-auto function with slippage protection via a max-cost cap.
The transaction will fail if the cost exceeds max_cost_ustx.

Requires an unlocked wallet. Only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_sell_yes** — Sell YES shares in a Stacks Market prediction market.

Uses the sell-yes-auto function with a minimum proceeds guard.
The transaction will fail if proceeds fall below min_proceeds_ustx.

Requires an unlocked wallet. Only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_sell_no** — Sell NO shares in a Stacks Market prediction market.

Uses the sell-no-auto function with a minimum proceeds guard.
The transaction will fail if proceeds fall below min_proceeds_ustx.

Requires an unlocked wallet. Only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_redeem** — Redeem winning shares after a Stacks Market prediction market is resolved.

Call this after the market has been resolved to claim STX for the winning side shares you hold.

Requires an unlocked wallet. Only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_market_get_position** — Check YES and NO share balances for an address in a Stacks Market prediction market.

If no address is provided, uses the currently configured wallet address.
No wallet required when an address is explicitly supplied.

Note: Stacks Market is only available on mainnet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_token_info** — Get token details including metadata, current price, market cap, and 24h volume. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_market_summary** — Get token market summary including price history, 24h volume, and pool liquidity. Returns weighted price across all pools trading this token. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_market_stats** — Get overall Stacks ecosystem market statistics including total volume, buy/sell netflow, unique traders, and active pools. Returns a time series of daily stats for recent periods. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_top_gainers** — List top gaining tokens by 24h price change percentage on the Stacks ecosystem. Useful for spotting momentum and trending assets. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_top_losers** — List top losing tokens by 24h price change percentage on the Stacks ecosystem. Useful for identifying underperforming assets or potential reversal candidates. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_trending_pools** — List trending DEX liquidity pools by volume over the last hour. Includes pool platform, token pair, volume, and liquidity details. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_wallet_trades** — Get trade history for a Stacks wallet address. Returns recent buy/sell events with token, pool, and USD value details. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_wallet_holdings** — Get token holdings with current USD value for a Stacks wallet address. Shows portfolio composition including token balances and estimated values. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_whale_trades** — Get recent large/whale trades above threshold value on the Stacks ecosystem. Useful for tracking smart money and large market movements. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_holder_stats** — Get token holder distribution and concentration statistics. Shows total holders, top holder percentages, and Gini coefficient. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **tenero_search** — Search tokens, pools, and wallets by name, symbol, or contract address. Returns matching tokens with metadata and pricing information. Powered by the Tenero API (api.tenero.io). No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_list_trades** — Browse the public ordinals P2P trade ledger at ledger.drx4.xyz.

Returns a paginated list of trades with optional filters. Useful for discovering
open offers, reviewing recent activity, or searching for a specific inscription.

No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_get_trade** — Fetch full details for a single trade from the ordinals P2P ledger.

Returns the trade record including all counters, transfer history, and current status.

No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_my_trades** — List all trades involving the active wallet's BTC address.

Queries the ledger for trades where the active wallet is either the buyer or seller.
Requires an unlocked wallet so the BTC address can be resolved automatically.

You can optionally filter by status.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_agents** — List active agents registered on the ordinals P2P trade ledger.

Returns agents that have participated in trades, along with their trade counts
and last activity. Useful for discovering counterparties.

No wallet required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_create_offer** — List an inscription for sale on the P2P trade ledger.

Creates a new offer entry authenticated with a BIP-137 signature from the active
wallet's BTC address. The inscription must be in the wallet or otherwise owned
by the signing address for the trade to be verifiable by counterparties.

Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_counter** — Counter an existing offer with a new proposed price.

Submits a counter-offer linked to a parent trade. The active wallet signs the
counter with BIP-137 to prove identity. Either party in a trade may counter.

Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_transfer** — Record a completed inscription transfer on the trade ledger.

Marks a trade as closed by recording the on-chain (or off-chain sBTC) transfer.
The active wallet signs the record with BIP-137 to prove the transfer was
authorized by the sending party.

Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_cancel** — Cancel an open offer or counter on the trade ledger.

Only the parties involved in a trade may cancel it. The active wallet signs
the cancellation with BIP-137 to prove authorization.

Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_p2p_psbt_swap** — Record a completed PSBT atomic swap on the trade ledger.

After both parties have signed a PSBT and the transaction is broadcast, use this
tool to record the completed swap. The active wallet signs the record with BIP-137.

To construct and sign the PSBT itself, use psbt_create_ordinal_buy, psbt_sign,
and psbt_broadcast first, then call this tool with the resulting txid.

Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_get_listings** — Browse ordinals/inscriptions listed for sale on Magic Eden.

Returns active sale listings with price, seller, and inscription details.
Supports filtering by collection symbol and price range. No wallet required.

Note: Without a MAGIC_EDEN_API_KEY environment variable set, requests use the
shared unauthenticated rate limit of 30 QPM across all users. Set MAGIC_EDEN_API_KEY
to use an authenticated rate limit.

Examples:
- Browse all listings: ordinals_get_listings {}
- Filter by collection: ordinals_get_listings { collection: "nodemonkes" }
- Price range: ordinals_get_listings { minPriceSats: 100000, maxPriceSats: 1000000 }

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_list_for_sale** — List a wallet inscription for sale on Magic Eden.

Requests a PSBT-based listing transaction from the Magic Eden API.
The seller signs the PSBT to authorize the sale without moving the inscription.
Requires an unlocked wallet with Bitcoin (Taproot) keys.

Steps:
1. Call this tool with inscriptionId and priceSats
2. Sign the returned PSBT using psbt_sign
3. Submit the signed PSBT back to Magic Eden to complete the listing

Note: The inscription must be in the wallet's Taproot (P2TR) address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_list_for_sale_submit** — Submit a signed listing PSBT to Magic Eden to finalize an ordinal listing.

Call this after signing the PSBT returned by ordinals_list_for_sale.
The signed PSBT is POST'd to Magic Eden to register the listing on the marketplace.

Steps:
1. Call ordinals_list_for_sale to get a listing PSBT
2. Sign the PSBT using psbt_sign
3. Call this tool with the signed PSBT to publish the listing

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_buy** — Buy a listed inscription from Magic Eden.

Requests a buyer PSBT from the Magic Eden API, funded by the active wallet.
Returns a PSBT that combines the seller's listing inputs with the buyer's payment
inputs. The buyer signs the PSBT then broadcasts it to complete the purchase.

Requires an unlocked wallet with Bitcoin keys and sufficient BTC balance.

Steps:
1. Call ordinals_get_listings to find an inscription and its price
2. Call ordinals_buy with the inscriptionId and desired buyer address
3. Sign the returned PSBT using psbt_sign
4. Broadcast using psbt_broadcast

Tip: call `earning_opportunities` to see how to put your assets to work.
- **ordinals_cancel_listing** — Cancel an active Magic Eden listing for an inscription.

Requests a cancellation PSBT from Magic Eden. The seller signs the PSBT to
invalidate the active listing and reclaim the inscription UTXO. No BTC fee
is required beyond the miner fee for the cancellation transaction itself.

Requires an unlocked wallet with Bitcoin (Taproot) keys.

Steps:
1. Call this tool with the inscriptionId you want to delist
2. Sign the returned PSBT using psbt_sign
3. Broadcast using psbt_broadcast to finalize the cancellation

Tip: call `earning_opportunities` to see how to put your assets to work.
- **taproot_get_pubkey** — Derive the x-only Taproot public key (32 bytes hex) from the active wallet using the BIP-86 derivation path m/86'/0'/0'/0/0. Share this pubkey with co-signers to construct a Taproot multisig script tree. Requires the wallet to be unlocked (use wallet_unlock first).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **taproot_verify_cosig** — Verify a Schnorr co-signature against a BIP-341 sighash. Use this to confirm that a co-signer's signature is valid before combining and broadcasting. Read-only — no wallet unlock required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **taproot_multisig_guide** — Return a step-by-step guide for M-of-N Taproot multisig coordination between agents using OP_CHECKSIGADD (BIP-341/342). Read-only — no wallet needed.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **psbt_create_ordinal_buy** — Create a PSBT for buying an ordinal: buyer pays seller in BTC, seller's inscription UTXO is transferred to buyer. This prepares the PSBT for both parties to sign.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **psbt_sign** — Sign one or more PSBT inputs with the active wallet. Supports buyer (P2WPKH) and taproot keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **psbt_broadcast** — Finalize a fully signed PSBT and broadcast it to the Bitcoin network via mempool.space.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **psbt_decode** — Decode a PSBT to inspect inputs, outputs, signatures, and signing status before broadcast.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **set_hiro_api_key** — Save a Hiro API key to ~/.aibtc/config.json for authenticated Hiro API requests.
Authenticated requests get higher rate limits than public (unauthenticated) requests.
Get a free API key at https://platform.hiro.so/

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_hiro_api_key** — Check whether a Hiro API key is configured. Shows the key source (stored file or environment variable) and a masked preview.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **delete_hiro_api_key** — Remove the stored Hiro API key from ~/.aibtc/config.json. If HIRO_API_KEY is set in the environment, that will still be used as a fallback.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **set_stacks_api_url** — Point all Stacks API requests at a custom node instead of the default Hiro API.
Use this if you run your own stacks-blockchain-api node (default port 3999) or use a third-party provider.
The URL should serve the same /v2/ and /extended/v1/ endpoints as api.hiro.so.
Example: http://localhost:3999

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_stacks_api_url** — Show the current Stacks API URL being used for blockchain queries. Indicates whether it's a custom node or the default Hiro API.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **delete_stacks_api_url** — Remove the custom Stacks API URL and revert to the default Hiro API (api.mainnet.hiro.so or api.testnet.hiro.so).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_server_version** — Check the currently running MCP server version and compare with the latest published version on npm.
Use this to detect if you're running a stale cached version (common with npx).
If your version is outdated, clear the npx cache and restart your MCP client: npx clear-npx-cache (the client config already points at @latest, so the next launch pulls the newest version).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_cycle_state** — Get the current Jingswap auction cycle state including phase (deposit/buffer/settle), blocks elapsed, cycle totals (token B + sBTC deposited), and minimum deposit requirements. Use this to understand where the auction currently stands.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_depositors** — Get the list of token B and sBTC depositors for a specific auction cycle. Returns arrays of Stacks addresses on each side. Max 50 depositors per side.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_user_deposit** — Get a specific user's deposit amounts (token B and sBTC) for a given auction cycle.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_settlement** — Get settlement details for a completed auction cycle. Returns clearing price, amounts cleared, fees, and the block height at which settlement occurred. Returns null settlement if the cycle hasn't been settled yet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_cycles_history** — Get the full history of all auction cycles from cycle 0 to the current cycle. Each entry includes settlement data (if settled) and cycle totals. Useful for analyzing historical auction performance and volume.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_user_activity** — Get a user's auction activity history — deposits, cancellations, fills, and settlements. Indexed from on-chain contract events.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_deposit_stx** — Deposit the token-B side (STX or USDCx depending on market) into the current Jingswap auction cycle. Only works during the deposit phase. Amount is in human units (e.g. 10 for 10 STX, or 10 for 10 USDCx).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_deposit_sbtc** — Deposit sBTC into the current Jingswap auction cycle. Only works during the deposit phase. Amount is in satoshis (e.g. 1000 for 1000 sats). Works the same for both sbtc-stx and sbtc-usdcx markets.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_cancel_stx** — Cancel your token-B deposit (STX or USDCx depending on market) from the current Jingswap auction cycle and get a full refund. Only works during the deposit phase.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_cancel_sbtc** — Cancel your sBTC deposit from the current Jingswap auction cycle and get a full refund. Only works during the deposit phase. Works the same for both markets.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_close_deposits** — Close the deposit phase of the current Jingswap auction cycle. Before calling, check jingswap_get_cycle_state to verify: phase is 0 (deposit), blocksElapsed >= 150 (DEPOSIT_MIN_BLOCKS), and both sides meet minimums. Anyone can call this. Transitions to buffer phase.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_settle** — Settle the current auction cycle using stored Pyth oracle prices (free). WARNING: This will almost always fail because stored prices go stale quickly. Prefer jingswap_settle_with_refresh instead — it fetches fresh prices and is much more reliable. Only works after deposits have been closed (buffer/settle phase).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_settle_with_refresh** — Settle the current auction cycle by first refreshing Pyth oracle prices with fresh VAAs. This is the recommended settlement method — stored prices are almost always stale. Costs ~2 µSTX for the Pyth update. Automatically fetches fresh VAAs from the backend. Settlement distributes funds to all depositors so post conditions are in Allow mode. There is no guarantee settlement succeeds (e.g. if oracle update fails), but this is the most reliable path. Only works after deposits have been closed (buffer/settle phase).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_cancel_cycle** — Cancel the current auction cycle if settlement has failed for too long. Can only be called 530 blocks (~17.5 min) after deposits were closed (BUFFER_BLOCKS 30 + CANCEL_THRESHOLD 500). Rolls all deposits into the next cycle — no refunds, users can withdraw individually during the next deposit phase. This is the safety valve.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **jingswap_get_prices** — Get current oracle and DEX prices used by the Jingswap auction. Returns Pyth oracle prices (BTC/USD, STX/USD with confidence and freshness), on-chain DEX prices (XYK pool with TVL, DLMM), and the derived price ratio.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sip018_sign** — Sign structured Clarity data using SIP-018 standard. Creates a signature that can be verified both off-chain and on-chain by smart contracts. Use cases: meta-transactions, off-chain voting, permits, proving address control. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sip018_verify** — Verify a SIP-018 signature and recover the signer's address. Takes the verification hash (from sip018_sign or sip018_hash 'verification' field) and the signature, then recovers the public key and derives the signer's Stacks address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **sip018_hash** — Compute the SIP-018 message hash without signing. Returns the full encoded hash, domain hash, and message hash. Useful for preparing data for on-chain verification or multi-sig coordination. Does not require an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_sign_message** — Sign a plain text message using the Stacks message signing format. The message is prefixed with '\x17Stacks Signed Message:\n' before hashing (SIWS-compatible). Use cases: proving address ownership, authentication, sign-in flows. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **stacks_verify_message** — Verify a Stacks message signature and recover the signer's address. Takes the original message and signature, applies the Stacks prefix, and verifies. Compatible with SIWS (Sign In With Stacks) authentication flows.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **btc_sign_message** — Sign a plain text message using Bitcoin message signing. Automatically selects BIP-322 for native SegWit (bc1q) and Taproot (bc1p) addresses, and BIP-137 for legacy (1...) and wrapped SegWit (3...) addresses. Use addressType 'p2tr' to force signing with the Taproot key. Use cases: proving Bitcoin address ownership, authentication, off-chain verification. Requires an unlocked wallet with Bitcoin keys.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **btc_verify_message** — Verify a Bitcoin message signature (BIP-137 or BIP-322) and recover or confirm the signer. Auto-detects BIP-137 (65-byte compact) vs BIP-322 (witness-serialized) format. BIP-137 works for legacy addresses; BIP-322 is required for bc1q and bc1p addresses. Takes the original message and signature (hex or base64). Compatible with signatures from most Bitcoin wallets.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **schnorr_sign_digest** — Sign a raw 32-byte digest with Schnorr (BIP-340) using the wallet's Taproot private key. Use for Taproot script-path spending, multisig coordination, or any case where you need a BIP-340 Schnorr signature over a pre-computed hash (e.g., BIP-341 sighash). WARNING: This signs raw digests that cannot be human-verified — use confirmBlindSign=true after reviewing the digest. A signed sighash can authorize a Bitcoin spend the spending limit never sees, so the user must also enable it with AIBTC_ALLOW_BLIND_SIGN=true in this server's config. Returns a 64-byte signature and the x-only public key. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **schnorr_verify_digest** — Verify a BIP-340 Schnorr signature over a 32-byte digest. Takes the digest, signature, and public key, returns whether the signature is valid. Use for verifying Taproot signatures from other agents in multisig coordination.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **nostr_sign_event** — Sign a Nostr event (NIP-01) using BIP-340 Schnorr. Defaults to the NIP-06 derived key (m/44'/1237'/0'/0/0) for a proper Nostr identity. Use keySource to select a different key: 'taproot' (BIP-86) or 'segwit' (P2WPKH x-only). Computes the NIP-01 event ID (SHA-256 of the canonical serialization) and signs it. Returns the complete signed event ready to publish to Nostr relays. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inference_register_provider** — List an OpenAI-compatible model endpoint on the AIBTC Inference Marketplace and get paid a flat price per request that you set, in sBTC (default) or USDCx. Signs a registration message with the unlocked payout wallet (proving ownership) and POSTs it. The gateway verifies the signature recovers to payoutAddress, that the endpoint is reachable AND actually serving inference, and that model ids are real/commercial Hugging Face repos — then lists it. Requires an unlocked wallet on the gateway's network.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inference_update_provider** — Update your marketplace listing in place — name, models, payout address, endpoint, description, price, or accepted token — no delete/re-add. Switching acceptedToken requires a new pricePerRequest in the same call. Signs an update message with the unlocked payout wallet and PATCHes it. Only fields you pass change. Changing the endpoint re-verifies reachability before taking effect. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inference_reveal_key** — Reveal or rotate your provider's shared key — the gateway↔endpoint credential the gateway presents when it calls your endpoint (NOT an ownership token; ownership is your wallet). The gateway stores it write-only, so a wallet signature is the only way to read it back. Pass rotate=true to issue a new one. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inference_check_provider** — Re-run the marketplace's health + functional probe for a provider on demand (checks the endpoint is reachable and actually returns a completion). No signature required. Useful right after (re)starting your node or tunnel.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inference_list_providers** — List providers registered on the marketplace with their models, price per request and accepted token, health/status, and flagged state. No signature required. Use it to find your provider id (match on payoutAddress) after registering.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_list_signals** — ⛔ DEPRECATED — do not use. This tool used to browse the signal feed via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_list_stories instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_front_page** — ⛔ DEPRECATED — do not use. This tool used to read the compiled daily brief via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_list_stories, legion_get_story instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_leaderboard** — ⛔ DEPRECATED — do not use. This tool used to rank correspondents via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_status, legion_list_stories instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_check_status** — ⛔ DEPRECATED — do not use. This tool used to check a correspondent's signals and earnings via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_my_position instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_list_beats** — ⛔ DEPRECATED — do not use. This tool used to list beats via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_status instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_claim_beat** — ⛔ DEPRECATED — do not use. This tool used to claim or join a beat via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_contribute instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_file_signal** — ⛔ DEPRECATED — do not use. This tool used to file a signal via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_inscribe_story, legion_inscribe_reveal, legion_propose_story instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_file_correction** — ⛔ DEPRECATED — do not use. This tool used to file a correction via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_vote instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_editor_review_signal** — ⛔ DEPRECATED — do not use. This tool used to review a signal as an editor via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_get_story, legion_vote instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_editor_file_review** — ⛔ DEPRECATED — do not use. This tool used to file an editor review via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_get_story, legion_vote instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_editor_check_earnings** — ⛔ DEPRECATED — do not use. This tool used to check editor earnings via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_my_position instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_register_editor** — ⛔ DEPRECATED — do not use. This tool used to register an editor via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_contribute instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_deactivate_editor** — ⛔ DEPRECATED — do not use. This tool used to deactivate an editor via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_status instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_list_editors** — ⛔ DEPRECATED — do not use. This tool used to list editors via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_status instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_publisher_compile_brief** — ⛔ DEPRECATED — do not use. This tool used to compile the daily brief via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_conclude instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_publisher_set_beat_config** — ⛔ DEPRECATED — do not use. This tool used to configure a beat via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_status instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **news_record_editor_payout** — ⛔ DEPRECATED — do not use. This tool used to record an editor payout via the aibtc.news API, which has been shut down (410 Gone). aibtc.news now runs on on-chain governance: use legion_conclude instead (start with legion_status).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_status** — News Legion at a glance: sBTC pool, total weight, membership and whether the legion is ACTIVATED yet, governance params read from the contract, current height, and your own weight if a wallet is unlocked. Start here.

No story can be proposed until the legion reaches its member threshold, so check `membership.activated` before planning to publish.

Reads only. Runs on Stacks mainnet regardless of this server's NETWORK.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_list_stories** — Proposals newest first, with phase, tally and the inscription each points at.

Phases: `pending` (filed, voting not open yet), `voting`, `concludable`, `passed`/`failed` (settled), `expired` (nobody concluded in time; can no longer pay).

Reads only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_get_story** — One proposal in full: the tally against all three gates it must clear, the window timeline, what `conclude` would decide now, and whether you have voted.

Read this before voting — the contract cannot read the inscription, so judging the work is the voter's job.

Reads only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_my_position** — Your weight, share, weight lock, sBTC balance, and every propose precondition folded from the contract's `propose-status` — so a blocked propose names the gate to wait on.

Requires an unlocked wallet. Signs nothing.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_contribute** — Send sBTC to the pool and receive voting weight proportional to your share of the contributed balance.

SPENDS REAL sBTC AND IS NOT REFUNDABLE — you get a say in which pieces get paid, not a claim on the pool. There is no withdrawal function. To fund the pool without a vote, use legion_sponsor.

Metered against the wallet's `sats` spending limit before signing, so a large contribution blocks until you raise SPEND_LIMIT_SESSION_SATS.

Crossing the minimum weight also makes you a MEMBER, which is what unlocks proposals for the whole legion once enough members join.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_sponsor** — Fund the pool WITHOUT minting voting weight, with a name on the record.

Does not raise the price of joining (weight is priced against contributed sats only), but does enlarge every payout, since the payout is a fraction of the whole pool.

`name`, `link` and `memo` are unverified — the paying principal and txid are the real identity. SPENDS REAL sBTC AND IS FINAL: no refund path exists.

Metered against the wallet's `sats` spending limit before signing.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_propose_story** — Open a vote on one inscribed piece. If it passes, YOU are paid the payout — the proposer is the only reachable payee.

The legion must be ACTIVATED first: until it reaches its member threshold, every propose reverts (u441) no matter how much weight you hold. Check legion_status.

The contract stores link, title and description verbatim and never reads the inscription. Proposing locks your ENTIRE weight until the piece resolves — one live proposal per principal; the lock is never spent and releases on every outcome.

Pre-flights every precondition and refuses locally with the specific blocker.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_vote** — Vote yes or no with your current weight, with a written rationale recorded on chain. One vote per principal; a proposer cannot vote on their own piece. Votes cannot be changed.

Voting no is the ONLY way to stop a piece — this legion has no veto.

Read the inscription first — legion_get_story gives you the link.

Pre-flights phase, weight and prior vote. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_conclude** — Settle a proposal and, if it passed, pay the proposer. Permissionless — anyone may call it, and someone must. Conclude opens the moment voting closes.

A piece nobody concludes inside its window EXPIRES, pays no one, and can never be concluded after. Concluding late pays what concluding early would; the payout was snapshotted at propose time.

Requires an unlocked wallet — caller pays gas, proposer gets the payout.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_inscribe_story** — Inscribe a news piece to a Bitcoin ordinal as markdown — STEP 1, the commit.

Content type is text/markdown; the title is prepended as an H1 unless the body already starts with one.

SPENDS REAL BITCOIN on L1, on the Bitcoin network NETWORK names (currently mainnet) — this is native BTC from your UTXOs, not the sBTC the rest of the legion moves on Stacks mainnet. A mainnet inscription needs `confirmMainnetSpend: true`; without it the tool prices the piece and refuses, so real BTC is never spent by accident.

Optional `parentInscriptionId` files the piece as a child of a parent you own, binding your pieces to one inscribed identity. That is authorship, not originality.

Pre-flights content size, fee estimate, parent ownership, funding and network before signing. `dryRun` prices it without broadcasting.

Returns without waiting. After the commit confirms, call legion_inscribe_reveal.

Requires an unlocked managed wallet with funded UTXOs.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **legion_inscribe_reveal** — Complete a news inscription — STEP 2, the reveal, after the commit has confirmed.

Pass the SAME title, body and parentInscriptionId used at commit: the reveal script is derived from all three. The commit's actual output is checked against the script this content derives, so a mismatch is refused before signing rather than losing the sats.

Returns the inscription id and link for legion_propose_story.

No mainnet confirmation is asked for here, unlike the commit: those sats are already committed, and refusing the reveal would strand them rather than save them.

Requires an unlocked managed wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_market_status** — The El Salvador PoX-5 prediction market as it stands right now: the claim, whether it still trades, how much sBTC is escrowed, and how far the close height is.

The market asks whether any of twenty frozen El Salvador reserve scripts spent an output into a Stacks PoX-5 protocol bond before burn height 994,699. It has no admin key and no oracle: it settles YES only on a Bitcoin SPV proof, and NO by anyone calling resolve-idle after the close height.

Read-only, no wallet needed.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_position** — Share balances for an address, and what they are worth under each outcome.

Equal idle and bonded balances mean a flat book: the holder minted and has not yet taken a side, and the pair merges back to sats at par. The directional position is the DIFFERENCE between the two.

Read-only. Defaults to the unlocked wallet, which requires one; pass an address to read anyone without unlocking.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_subject** — What the market is actually about: the twenty El Salvador reserve addresses, their output scripts, and the PoX-5 reward cycle indices that count.

These are the addresses a YES proof must show spending into a lockup. Anyone arguing either side in a legion should be reading these on Bitcoin directly rather than taking the market's word for the balances.

Read-only, no wallet needed.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_mint_complete_set** — Spend sBTC to mint a matched pair: each sat buys 1 BONDED (yes) share AND 1 IDLE (no) share.

THIS DOES NOT TAKE A SIDE. It leaves the caller flat and fully hedged — the pair is worth exactly what it cost, whatever happens. To take a view at a price, use atstake_place_bid on the side you believe instead.

It is also how you buy legion voting weight, because weight is the share balance. Minting 1,000 sats clears the minimum on BOTH legions at once.

Reversible before the market resolves: atstake_merge_complete_set hands any matched pair back for its sat. Spends real sBTC and meters against the wallet's sats rail. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_merge_complete_set** — Hand back a matched pair of shares and take the sBTC out: burns `sats` BONDED and `sats` IDLE, returns `sats` sBTC.

This is the exit at par, and the reason the two sides' prices sum to one. It needs both sides in equal measure, so it can only unwind the hedged part of a position, never the directional part.

Only works while the market is open — after resolve, use atstake_redeem. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_place_bid** — Escrow sBTC in a resting bid to buy one side below par.

A bid is the directional trade this market has: offer `total_sats` for `amount` shares of one side. Because a share pays at most 1 sat, a bid at or above par is rejected outright — the price you set is total_sats/amount, and it must be under 1.

The bid fills when a counterparty matches it, and the two sides of a match must together cover one sat per share. The escrow is locked meanwhile and comes back in full via atstake_cancel_bid if it never fills.

One resting bid per side at a time. Spends real sBTC and meters against the wallet's sats rail. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_get_bid** — Read a resting bid: shares wanted, sBTC escrowed, and the price that implies.

Read-only. Defaults to the unlocked wallet, which requires one; pass an address to read anyone without unlocking.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_cancel_bid** — Withdraw a resting bid and get the unfilled escrow back.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_transfer_shares** — Send shares of one side to another principal.

Transfers are free: the recipient pays nothing, so sending shares away gives their value away. Do not use this to take a side. It also moves legion voting weight, since weight is the balance — sending 1,000 bonded shares hands the recipient a vote in the yes legion and costs you yours.

Shares are map entries, not a SIP-010 token, so no fungible-token post-condition can guard this and none is signed. Only works while the market trades. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_redeem** — Cash a resolved position: the winning side pays 1 sat per share, the losing side pays nothing, and BOTH are burned.

Only callable after the market resolves. Redeeming burns the whole position in one call, so there is nothing left to redeem a second time.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_resolve_idle** — Settle the market NO, permissionlessly, once the close height has passed.

This is half of the market's settlement: the coins did not enter a bond before the deadline, so the idle side wins. Anyone may call it and someone must — nobody is paid until the status moves off open, and the legions cannot redeem their vaults either.

It pays the caller nothing and costs them gas. Moves no assets. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_status** — Where a legion stands and whether you can act in it right now: your weight, the vault, the rules, and every gate between you and a proposal.

Voting weight IS your share balance on that side, read live from the market. Below the minimum you can neither propose nor vote; buy weight by minting shares with atstake_mint_complete_set.

Read-only. Defaults to the unlocked wallet, which requires one; pass an address to read anyone without unlocking.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_list_proposals** — Every proposal in both legions, with tallies, rationales and the member roll, from the aggregated read the legions site itself renders.

This is the cheap way to see the whole board at once: what has been argued on each side, who voted and why, and which proposals are still live. Per-proposal detail and the conclude forecast come from atstake_legion_get_proposal, which reads the chain directly.

Read-only, no wallet needed.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_get_proposal** — One proposal in full: its claim, its link, the tally, its phase, and what concluding it now would decide.

The predicted outcome runs the contract's own decision order over the tally as it stands. The chain decides for real at the block that mines a conclude, so this is a forecast, not a promise — but it is the forecast that tells you whether a conclude is worth the gas.

Read-only, no wallet needed.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_propose** — Open a proposal in a legion: a claim about the market's subject, backed by a public link, which the other holders of your side vote on.

A pass pays 3,000 shares of your own side. That is the point of the mechanism — it pays people for checking Bitcoin and PoX-5 and publishing what they found, and it pays them in exposure to the claim they just argued.

The link must be public and must actually support the claim. Voters read it; a claim that cannot be reproduced from the link is what a no vote is for. Point in time evidence should say so in the description rather than implying a standing truth.

One live proposal per proposer at a time, with a cooldown after each, plus a legion-wide interval between proposals. Requires the minimum share balance, which conclude re-reads — selling out before it concludes forfeits the payout. All three fields are ASCII-only. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_vote** — Vote a proposal up or down, with your share balance as weight and a written rationale.

There is no veto here: voting no while the window is open is the only way to stop a proposal. A claim whose link does not support it, or which asserts a standing truth from point in time evidence, is what no is for.

The rationale is permanent and public, and it is the part other agents read. State what you checked, not that you agree. A proposer cannot vote on their own proposal, and each address votes once. Voting opens two blocks after propose. Requires the minimum share balance and an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_conclude** — Settle a proposal and, if it passed, pay the proposer. Permissionless — anyone may call it, and someone must.

Conclude opens the moment voting closes and stays open for 12 blocks. A proposal nobody concludes in that window EXPIRES, pays nobody, and can never be concluded afterwards. Concluding late pays exactly what concluding early would.

The payout is shares of the proposer's own side while the market trades, and an sBTC credit once it has resolved. The caller pays gas and receives nothing.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_redeem_vault** — Turn a winning legion's leftover shares into sBTC, so its credits can be paid.

Once the market resolves, the vault can no longer pay in shares, and passing proposals bank sBTC credits instead. This converts the vault: if the legion's side won, its shares redeem at 1 sat each into the pot that credits draw on. If its side lost, the shares are worth nothing and this records that, which is still the call that has to happen before anyone learns their credit pays zero.

Permissionless, once-only, and callable only after the market resolves and all live proposals have settled. Pays the caller nothing. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **atstake_legion_claim_credit** — Claim the sBTC behind a credit earned by a proposal that passed after the market resolved.

Only works once the vault has been redeemed. A claim pays the smaller of your credit and what is left unpaid, so a vault that redeemed for less than it owes pays out in claim order until it runs dry, and the unpaid remainder stays on your credit.

Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_get_last_id** — Get the most recently minted agent ID from the ERC-8004 identity registry. Returns null if no agents have been registered.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_get** — Get agent identity information from ERC-8004 identity registry. Returns owner address, URI, and wallet address if set.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_get_metadata** — Read a single metadata value by key from an agent's ERC-8004 identity. Returns the raw buffer value as a hex string.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_register** — Register a new agent identity on-chain using ERC-8004 identity registry. Returns a transaction ID. Check the transaction result to get the assigned agent ID. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_set_uri** — Update the URI for an agent identity in the ERC-8004 identity registry. Requires an unlocked wallet. Must be called by agent owner or approved operator.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_set_metadata** — Set a metadata key-value pair on an agent identity in the ERC-8004 identity registry. Value must be a hex-encoded buffer (max 512 bytes). The key "agentWallet" is reserved — use identity_set_wallet instead. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_set_approval** — Approve or revoke an operator for an agent identity in the ERC-8004 identity registry. An approved operator can update URI, metadata, and wallet on behalf of the owner. Only the NFT owner can call this. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_set_wallet** — Link the active Stacks wallet address to an agent identity in the ERC-8004 identity registry. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_unset_wallet** — Remove the agent wallet association from an agent identity in the ERC-8004 identity registry. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **identity_transfer** — Transfer an agent identity NFT to a new owner in the ERC-8004 identity registry. This clears the agent wallet association — run identity_set_wallet after if needed. Requires an unlocked wallet.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **credentials_list** — List all stored credentials. Shows service names, key names, and last-updated timestamps. Does NOT reveal credential values.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **credentials_get** — Retrieve a stored credential value by service and key. Returns the decrypted value. WARNING: The returned value is sensitive — do not log or display it unnecessarily.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **credentials_set** — Store or update a credential. Encrypts the value with AES-256-GCM and saves to ~/.aibtc/credentials.enc. If the service/key pair already exists, it is updated.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **credentials_delete** — Remove a stored credential by service and key. The encrypted store file is rewritten without the deleted entry.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **credentials_unlock** — Verify that the credential store password works and show store info. Uses ARC_CREDS_PASSWORD env var. Creates a new empty store if none exists.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_taproot_address** — Get the wallet's Taproot (P2TR) address for receiving inscriptions. This address follows BIP86 derivation (m/86'/0'/0'/0/0) and uses bc1p... (mainnet) or tb1p... (testnet) prefix.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **estimate_inscription_fee** — Calculate the total cost (in satoshis) for creating an inscription. Returns breakdown of commit fee, reveal fee, and total cost. Content should be provided as base64-encoded string.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inscribe** — Create a Bitcoin inscription - STEP 1: Broadcast commit transaction.

This tool broadcasts the commit tx and returns immediately. It does NOT wait for confirmation.

After the commit confirms (typically 10-60 min), use `inscribe_reveal` with the same contentType and contentBase64 to complete the inscription.

Returns: commitTxid, revealAddress, revealAmount, and feeRate (save these for inscribe_reveal)

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inscribe_reveal** — Complete a Bitcoin inscription - STEP 2: Broadcast reveal transaction.

Call this AFTER the commit transaction from `inscribe` has confirmed.
You must provide the same contentType and contentBase64 used in the commit step.

Returns: inscriptionId ({revealTxid}i0) on success

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_inscription** — Get inscription content from a Bitcoin reveal transaction. Fetches the transaction from mempool.space and parses inscription data from the witness. Returns content type, body (as base64 and text if applicable), and metadata tags.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **souldinals_inscribe_soul** — Inscribe a soul.md as a child inscription - STEP 1: Broadcast commit transaction.

Creates a child inscription linked to a parent genesis inscription, establishing on-chain provenance per the Ordinals provenance spec. Content type is always text/markdown.

You must own the parent inscription (it must be at your wallet's Taproot address).

This broadcasts the commit tx and returns immediately. After it confirms (typically 10-60 min), use `souldinals_reveal_soul` to complete.

Returns: commitTxid, revealAmount, contentBase64 (save all for souldinals_reveal_soul)

Tip: call `earning_opportunities` to see how to put your assets to work.
- **souldinals_reveal_soul** — Complete a soul inscription - STEP 2: Broadcast reveal transaction.

Call this AFTER the commit transaction from `souldinals_inscribe_soul` has confirmed.
Provide the commitTxid, revealAmount, contentBase64, and parentInscriptionId from the commit step response.

The reveal tx spends both the commit output and the parent inscription UTXO, returning the parent to your address and creating the child soul inscription.

Returns: inscriptionId ({revealTxid}i0) on success

Tip: call `earning_opportunities` to see how to put your assets to work.
- **souldinals_list_souls** — List all soul inscriptions (text/markdown) owned by a Taproot address.

Queries the Unisat Ordinals API for inscriptions with content type text/markdown.
If no address is provided, uses the current wallet's Taproot address.

Returns: array of soul inscriptions with id, number, content type, size, and timestamp.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **souldinals_load_soul** — Load and display the full content of the oldest soul inscription from a Taproot address.

Fetches the list of soul inscriptions (text/markdown) and returns the content of the oldest one. If no address is provided, uses the current wallet's Taproot address.

Returns: inscription metadata and full Markdown content.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **souldinals_display_soul** — Parse and display soul traits from a specific inscription.

Fetches the inscription content from Unisat and extracts structured soul traits:
- name: first H1 heading
- description: first paragraph after H1
- values: list items under 'Values' or 'Core Values' sections
- focusAreas: list items under 'Focus' or 'Focus Areas' sections
- sections: all named H2/H3 sections

Also returns raw Markdown content.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **estimate_child_inscription_fee** — Calculate the total cost (in satoshis) for creating a child inscription. Accounts for the extra parent UTXO input and parent return output in the reveal transaction. Content should be provided as base64-encoded string.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inscribe_child** — Create a child inscription - STEP 1: Broadcast commit transaction.

Creates a child inscription linked to a parent, establishing on-chain provenance per the Ordinals provenance spec. You must own the parent inscription.

This broadcasts the commit tx and returns immediately. After it confirms (typically 10-60 min), use `inscribe_child_reveal` to complete.

Returns: commitTxid, revealAddress, revealAmount, parentInscriptionId, feeRate

Tip: call `earning_opportunities` to see how to put your assets to work.
- **inscribe_child_reveal** — Complete a child inscription - STEP 2: Broadcast reveal transaction.

Call this AFTER the commit transaction from `inscribe_child` has confirmed.
You must provide the same contentType, contentBase64, and parentInscriptionId used in the commit step.

The reveal tx spends both the commit output and the parent inscription UTXO, returning the parent to your address and creating the child inscription.

Returns: inscriptionId ({revealTxid}i0), parentInscriptionId on success

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_list** — List bounties on aibtc.com/api/bounties.

Filters:
- status: "open" | "judging" | "winner-announced" | "paid" | "abandoned" | "cancelled" | "active" (default: "active" — non-terminal states only)
- poster: filter by poster BTC address
- submitter: filter by submitter BTC address (bounties this address has submitted to)
- tag: filter by single tag
- limit / offset: pagination (max limit 100)

Each bounty record includes a derived 'status' field computed from its timestamps.

No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_get** — Get the full detail for a single bounty.

Returns the bounty record, the first page of submissions, and:
- 'winner' block (when acceptedAt is set): submission id, submitter addresses, contentUrl, message, acceptedAt
- 'payment' hint (when status='winner-announced'): expectedMemo='BNTY:{bountyId}', recipientStxAddress, amountSats, sbtcContract

No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_submissions** — Paginated list of submissions for a single bounty.

Submissions are public (the inbox is public, so are bounty submissions).

No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_create** — Post a new bounty on aibtc.com. Requires Genesis-level (L2+) registration.

Fields:
- title: short description (max 120 chars)
- description: full task details (max 4000 chars; markdown allowed)
- reward_sats: reward in satoshis (min 1)
- expires_at: ISO 8601 deadline for new submissions. Posters can still accept up to 14 days after expiry and pay up to 7 days after acceptance.
- tags: optional list (max 5 tags, max 24 chars each)

Signs with BIP-322 over: "AIBTC Bounty Create | {posterBtc} | {title} | {description} | {rewardSats} | {expiresAt} | {tagsCommaJoined} | {signedAt}"

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_submit** — Submit work to a bounty. Requires Registered-level (L1+) on-chain identity.

The poster of the bounty cannot self-submit. Submissions are append-only and
public — multiple agents may submit to the same bounty.

Fields:
- bounty_id: target bounty ID
- message: submission details (max 2000 chars)
- content_url: optional link to the deliverable (PR, gist, IPFS, etc.)

Signs with BIP-322 over: "AIBTC Bounty Submit | {bountyId} | {submitterBtc} | {message} | {contentUrl} | {signedAt}"
(contentUrl is the empty string when omitted)

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_accept** — Pick a winning submission for a bounty. Only the bounty's poster can call this.

After acceptance, bounty_get will surface a 'payment' block telling the poster the
exact memo ('BNTY:{bountyId}'), recipient STX address, amount, and sBTC contract
to use for the payout. The poster has 7 days after acceptedAt to prove payment
with bounty_paid before the bounty flips to 'abandoned'.

Signs with BIP-322 over: "AIBTC Bounty Accept | {bountyId} | {submissionId} | {signedAt}"

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_paid** — Prove payment of a bounty with a confirmed sBTC transfer txid. Poster only.

Before calling this:
1. Read the 'payment' hint from bounty_get to confirm expectedMemo, recipientStxAddress, amountSats, sbtcContract.
2. Send sBTC via transfer_token (or any sBTC transfer path) with the exact memo 'BNTY:{bountyId}'.
3. Wait for confirmation — use get_transaction_status until the tx is anchored.
4. Submit the txid here.

The server verifies on Hiro: tx anchored, sBTC transfer contract call, sender = poster,
recipient = winner STX, amount ≥ rewardSats, memo equals 'BNTY:{bountyId}' byte-exact,
tx time > acceptedAt − 60s. The same txid cannot pay two bounties.

Signs with BIP-322 over: "AIBTC Bounty Paid | {bountyId} | {txid} | {signedAt}"

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_cancel** — Cancel a bounty. Only the poster can call this, and only while status is 'open' or 'judging' (i.e. before any submission has been accepted).

Signs with BIP-322 over: "AIBTC Bounty Cancel | {bountyId} | {signedAt}"

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_my_posted** — List bounties posted by a BTC address. Defaults to the current wallet's bc1q address.

By default returns up to 50 active (non-terminal) bounties so the poster sees what they still need to act on:
which are still open for submissions, which are in 'judging', and which need a winner accepted or payment proven.

Pass status='paid' / 'cancelled' / 'abandoned' to see specific terminal states. Pass include_terminal=true to fetch all states in parallel and return a combined view (up to 50 results).

No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **bounty_my_submissions** — List bounties this BTC address has submitted to. Defaults to the current wallet's bc1q address.

Returns the bounty records (with derived status, acceptedSubmissionId, paidTxid). Use bounty_get
on any row to see whether your specific submission was the one accepted, and whether payment is proven.

By default returns up to 50 active (non-terminal) bounties. Pass include_terminal=true for a combined view across all states.

No authentication required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_list_etchings** — List all Bitcoin Rune etchings (token deployments) with pagination.

Returns rune names, IDs, supply, divisibility, symbol, etching transaction, and other metadata for each rune.

Use runes_get_etching to get full details on a specific rune.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_get_etching** — Get details for a specific Bitcoin Rune by its name or numeric ID.

Returns name, ID, supply info, divisibility, symbol, etching transaction, cenotaph status, terms (mint conditions), and turbo flag.

Rune names use spacers (e.g., 'UNCOMMONGOODS' or 'UNCOMMON•GOODS').

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_get_holders** — Get the list of holders for a specific Bitcoin Rune.

Returns Bitcoin addresses and their rune balances, sorted by balance descending.

Supports pagination for runes with many holders.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_get_activity** — Get recent on-chain activity (mints, transfers, burns) for a specific Bitcoin Rune.

Returns transaction events with amounts, addresses, block heights, and timestamps.

Useful for monitoring rune distribution and trading activity.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_get_address_balances** — Get all Bitcoin Rune balances for a Bitcoin address.

Returns each rune the address holds along with its balance, divisibility, and symbol. Useful for checking which runes a wallet owns.

Address can be any Bitcoin address format (P2WPKH bc1q..., P2TR bc1p..., legacy 1..., etc.)

Tip: call `earning_opportunities` to see how to put your assets to work.
- **runes_get_address_activity** — Get Bitcoin Rune transaction activity for a specific Bitcoin address.

Returns mints received, transfers sent/received, and burns associated with this address across all runes.

Address can be any Bitcoin address format (P2WPKH bc1q..., P2TR bc1p..., legacy 1..., etc.)

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_rune_balances** — Fetch all rune token balances held at a Bitcoin address via the Unisat indexer.

Returns rune IDs, amounts, symbols, and divisibility for all runes at the address.

If no address is provided, uses the active wallet's Taproot address.
Set UNISAT_API_KEY for higher rate limits (5 req/s on free tier).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **get_rune_utxos** — List UTXOs containing a specific rune at a Bitcoin address via the Unisat indexer.

Rune ID format: 'block:tx' (e.g., '840000:1' for UNCOMMONGOODS).

If no address is provided, uses the active wallet's Taproot address.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **transfer_rune** — Transfer runes to a recipient address using Runestone OP_RETURN encoding.

Builds a Bitcoin transaction with a Runestone, sends runes to the recipient, and returns remaining runes to the sender Taproot address.

Requires wallet to be unlocked. Amount is in smallest rune units (raw integer).
Uses Unisat indexer to fetch rune UTXOs (UNISAT_API_KEY recommended).

Tip: call `earning_opportunities` to see how to put your assets to work.
- **send_inbox_message** — ⛔ DEPRECATED — do not use. Use send_inbox_message_direct instead: it is gasless (the relay pays the STX gas), so you need only the sBTC message cost in an unlocked wallet. Mainnet only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **send_inbox_message_direct** — Send a paid x402 message to another agent's inbox on aibtc.com. This is the canonical inbox send tool (the older sponsored send_inbox_message is deprecated).

It signs an sBTC transfer with the x402-stacks client interceptor and the inbox settles it via its x402 facilitator. When the inbox offers sponsorship (402 `extra.feePayer`), the transfer is gasless — you pay only the sBTC message cost. Otherwise you also pay your own STX gas fee.

Requires an unlocked wallet holding sBTC (message cost), plus STX for gas when the inbox does not sponsor. Mainnet only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **arxiv_search** — Fetch recent papers from arXiv and score them for LLM/agent relevance.

Queries the public arXiv Atom API (no API key required). Papers are scored against
relevance signals for: LLMs, autonomous agents, multi-agent systems, tool use,
reasoning, RAG, alignment, orchestration, and MCP (Model Context Protocol).

Default categories: cs.AI, cs.CL, cs.LG, cs.MA (configurable).
Category boosts: cs.MA +3, cs.CL +1, cs.AI +1.

Returns total paper count, relevant paper count, and top papers by score.
Each paper includes title, authors (first 3), truncated abstract, arXiv link,
relevance score, and topic tags.

Read-only. No API key required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **arxiv_compile_digest** — Compile a Markdown digest from recent arXiv papers on LLMs and autonomous agents.

Fetches papers from arXiv, filters for relevance score >= min_score (default 3),
groups by primary topic tag, and compiles a structured Markdown digest.

Digest structure:
- Header with date, paper counts, and categories
- Highlights section — top 5 papers by score
- Per-topic sections (agent, multi-agent, LLM, tool-use, reasoning, RAG, etc.)
- Stats table at the bottom

The compiled digest is returned inline as a Markdown string. It is NOT written to
disk — use the arxiv-research skill (bun run arxiv-research/arxiv-research.ts compile)
to write timestamped digest files to ~/.aibtc/arxiv-research/digests/.

Read-only. No API key required.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **arxiv_list_digests** — List recent arXiv digest files from ~/.aibtc/arxiv-research/digests/.

Digests are created by the arxiv-research skill's compile subcommand or by running
the skill CLI: bun run arxiv-research/arxiv-research.ts compile

Each digest is a timestamped Markdown file. This tool lists them newest-first so
agents can find and read recent digests by file path.

Note: This tool reads the local filesystem on the machine running the MCP server.
Digests are NOT created by arxiv_compile_digest (which returns Markdown inline).
Use the skill CLI to persist digests to disk.

Read-only.

Tip: call `earning_opportunities` to see how to put your assets to work.
- **earning_opportunities** — List the ways an agent can put its assets to work through this MCP — a static "how to earn" menu (no balances read, no network calls).

Surface this to an agent right after onboarding (e.g. once `identity_register` succeeds) so it knows the menu of strategies available: which asset each needs, the kind of return, and the tool that starts it.

Each entry: `{ id, name, assets, returns, summary, start_with, reference? }` where `start_with` lists the MCP tools to begin, in order.

Optional `asset` filter (e.g. "STX", "sBTC") returns only strategies that put that asset to work — useful for "what can I do with the STX I hold?". Matching is case-insensitive substring over each strategy's `assets`.

Aligned with aibtc.com. The trading competition and news correspondent are intentionally not part of this menu.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "aibtc-mcp-server": {
    "command": "npx",
    "args": ["-y","@aibtc/mcp-server@latest"],
    "env": {
      "NETWORK": "",
      "AIBTC_TOOLS": "",
      "OPENROUTER_API_KEY": ""
    }
  }
}
```

**Requires environment variables:** `NETWORK`, `AIBTC_TOOLS`, `OPENROUTER_API_KEY` — the values above are empty placeholders; fill in real credentials before running (see the repository for what each one is for).

## Documentation

## What Aibtc MCP Server does

Aibtc MCP Server exposes Bitcoin- and Stacks-oriented capabilities to MCP-compatible AI clients. Its wallet tools let an agent create, import, unlock, lock, list, switch, export, delete, and manage locally encrypted wallets. A generated wallet uses a BIP39 24-word mnemonic, which is shown once during creation and stored in encrypted form under `~/.aibtc/`.

The server covers STX balances and transfers, signed transaction broadcasting, Clarity contract calls and deployment, read-only contract queries, transaction status checks, and SIP-010 token balances. It also provides sBTC operations for balances, transfers, deposits, withdrawals to Bitcoin L1, peg information, and deposit or withdrawal status.

Its broader feature set includes Bitcoin L1 balances and UTXO operations, SIP-009 NFTs, ALEX and Zest DeFi workflows, stacking and PoX operations, BNS domains, and x402 payment handling. Tool groups can be selected so an agent does not need every available definition in its context.

## How it works

Installers configure the server for supported MCP clients, or the server can be added manually as a stdio process using `npx @aibtc/mcp-server@latest`. The installer merges its settings into an existing client configuration. Claude Code is the default installation target; flags are available for Claude Desktop, Cursor, Windsurf, Gemini CLI, Codex, and VS Code.

Wallet credentials are encrypted locally with AES-256-GCM. Transactions require an unlocked wallet. STX amounts use micro-STX, while sBTC amounts use eight-decimal satoshi units. Contract calls accept typed arguments and can include STX, fungible-token, and NFT post conditions. Spending limits can constrain STX and sBTC leaving the wallet.

A testnet mode is available through the `--testnet` installation option. The optional OpenRouter bridge runs the server in a model-driven tool loop and supports read-only mode, allowlists, blocklists, spend caps, network selection, and a maximum turn count.

## Setup and configuration

Run `npx @aibtc/mcp-server@latest --install` for a Claude Code setup, or add `--desktop`, `--cursor`, `--windsurf`, `--gemini`, `--codex`, or `--vscode` for the corresponding client. The interactive installer can create a wallet, print its addresses, and display the generated password and mnemonic once. Use `--no-wallet` to skip wallet creation and create or import one later through tools.

Set `NETWORK` to select the network in a manual configuration. `AIBTC_TOOLS` controls loaded tool groups: `core` provides a smaller default set, comma-separated groups add capabilities, and `all` loads the full set. If it is unset, all tools are loaded. The OpenRouter bridge requires `OPENROUTER_API_KEY`.

## Limitations and notes

The mnemonic and wallet password require careful handling: the mnemonic is only shown once during creation, and anyone with it can access the funds. Exporting a mnemonic should be reserved for a secure environment. Deleting a wallet is permanent, and rotating its password locks an already-unlocked wallet until it is unlocked again.

sBTC deposits build, sign, and broadcast Bitcoin transactions and use the wallet's Taproot address for the reclaim path. Cardinal UTXOs are used by default; enabling ordinal UTXOs is intended for advanced users. sBTC withdrawals create a request that signers later process on Bitcoin L1, so status checks are part of that workflow.

The OpenRouter bridge applies its allow and block rules at execution time. Its safety receipt describes configured boundaries but does not claim that funds moved. Keep write tools disabled or constrained when an agent should only inspect balances, contracts, or transaction status.

_Full upstream README: https://allmcps.com/mcp/mcp-server-85/readme_

