PetaSats

io.github.BSVanon由 GitHub 帳號 BSVanon 發布v0.2.16更新於 Nov 7, 2026

Buy BSV with USDC on Base through a local non-custodial MCP server.

已驗證STDIO僅桌面金融AI 與機器學習

概覽

AI 產生的概覽

本機非託管的 MCP 伺服器,讓 AI 助理在 Base 上用 USDC 報價並兌換 BSV,金鑰始終留在你自己的機器上。

可以做什麼
  • 報價與檢視錢包:get_quote、wallet_info、list_liquidity、fund_wallet(僅報價)。
  • 執行與追蹤兌換:swap_asset_to_bsv、wait_for_swap、swap_status。
  • 轉出資金:withdraw_bsv 與 withdraw_base。
  • 控制支出:stop_spending 立即停止新的兌換與提領,需在命令列恢復。
  • 讀取你自建的限額檔案,限制收款地址與每日兌換金額。
適用情境
當你希望 AI 助理用 Base 上的 USDC 買入 BSV 並傳送到指定地址,同時金鑰與簽章都留在本機時使用。適合在你自設限額下的小額兌換(約 5 至 100 美元),不適合大額或高頻交易。
執行需求
需要 Node.js 22 或更新版本,透過 npx 以 stdio 在本機執行。首次啟動會在 ~/.petasats 產生金鑰(可用 PETASATS_HOME 變更位置)。需向 wallet_info 顯示的 Base 地址轉入 Base 上的 USDC 和少量 ETH 作為手續費。未宣告需要 API 金鑰或帳號。
安裝前請注意
涉及真實資金:swap_asset_to_bsv、withdraw_bsv、withdraw_base 會轉出資金,且兌換一旦開始不會再要求確認。請備份 keys.json,它是唯一副本,同一個 kit 目錄只執行一份。可選的快速結算若做市商雙花,可能損失兌換金額。限額檔案只能約束無法編輯檔案或執行命令的 AI。兌換期間保持伺服器執行,一次只做一筆兌換。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 PetaSats,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[PetaSats]

PetaSats MCP

Buy BSV with USDC on Base from your AI app through a local, non-custodial MCP server.

What it does

PetaSats supports USDC on Base to BSV only. Keys are made and kept on your machine.

  1. You lock USDC in the swap contract on Base.
  2. The market maker locks BSV.
  3. The kit verifies the lock against a merkle proof and block headers, then claims BSV and reveals the secret.
  4. The market maker uses that secret to claim USDC.

Swaps are about $5 to $100. Each buyer may make three swaps and $200 per day; a shared daily total also applies. Standard speed is the default and waits for one BSV confirmation. An explicit speed: "fast" request can reduce that wait for at most $25 only when both sides agree.

Install and connect

Use Node.js 22 or newer. Every command here runs this release, [email protected]. Use one version in your client's entry and in terminal commands; to move to a later release, change it while no swap is running and restart the client.

sh
claude mcp add petasats -- npx -y [email protected]

Claude Desktop (claude_desktop_config.json), Cursor (~/.cursor/mcp.json):

json
{"mcpServers":{"petasats":{"command":"npx","args":["-y","[email protected]"]}}}

VS Code (.vscode/mcp.json):

json
{"servers":{"petasats":{"type":"stdio","command":"npx","args":["-y","[email protected]"]}}}

Codex (CLI, IDE extension, or app):

sh
codex mcp add petasats -- npx -y [email protected]

Any client that starts local stdio servers can use command npx and args -y [email protected]. First start creates keys in ~/.petasats; PETASATS_HOME changes that location. Back up keys.json: it is the only copy. Run only one copy of a kit home, because two copies of the same keys can each sign Base payments the other cannot see.

Fund the kit

wallet_info shows the Base address. Send it USDC on Base and a little ETH for gas; 0.0002 ETH covers many swaps.

Use it

Ask: “Buy $20 of BSV and send it to 1...”

ToolMoves funds
get_quoteNo
swap_asset_to_bsvYes
wait_for_swapNo
swap_statusNo
wallet_infoNo
stop_spendingNo
withdraw_bsvYes
withdraw_baseYes
fund_walletNo — it only plans a USDC-to-BSV swap and returns a quote
list_liquidityNo

Limits you control

You can create ~/.petasats/limits.json to restrict where an AI may send funds and how much it may swap per UTC day:

json
{  "format": "petasats.limits/1",  "bsvDestinations": ["1BoatSLRHtKNngkdXEeobR76b53LETtpyT"],  "baseDestinations": ["0x1111111111111111111111111111111111111111"],  "maxSwapUsdPerDay": 50,  "allowFastSettlement": false}

Keep this file private to your user account: chmod 600 ~/.petasats/limits.json. The kit refuses a limits file that other users can read or write. It rereads the file before every money operation. A refusal says that it was refused by your limits file and that nothing was sent. Use npx [email protected] limits to inspect it.

stop_spending stops new swaps and withdrawals immediately. Only you can resume with npx [email protected] resume; recovery for swaps already started keeps working.

allowFastSettlement: false forbids fast settlement for new swaps. If the field is missing, an explicitly requested fast swap is permitted to negotiate it; standard remains the default.

These controls protect against an AI that can only use the kit's tools. An AI app that can run shell commands or edit files as you can also edit limits.json or STOP.

Progress and reporting

The server gives the AI an operating guide. With a person watching, it reports one line per stage and a final summary with transaction IDs. For a program it returns only the result. Reporting never holds up a swap, and nothing asks for confirmation after a swap starts.

Safety model

Funds can go only to the swap contract on Base, the kit’s own addresses, or an address you provide. The kit verifies before reveal. The standard Base gate is 60 confirmations (about 12 seconds). The market maker’s BSV can return about four hours (24 blocks) after lock; your USDC refunds after about 16 hours (288,000 Base blocks) if the swap does not finish. Recovery resumes after restart. Run one swap at a time and keep the server running during a swap.

Fast mode makes the kit reveal its secret against an unconfirmed BSV lock. If the market maker double-spends that lock, you can lose the swap amount. It is available only when both sides agree and the amount is at most $25; otherwise the swap waits for one BSV confirmation. Fast is the buyer’s explicit choice; omitting speed uses standard settlement.

Costs

get_quote shows the rate and comparison with market mid. You pay Base gas in ETH, the BSV claim fee, and a small extra BSV fee with deliver_to. See get_quote for protocol fees.

Verify what you run

The npm package is built by GitHub Actions from a tagged commit and published with npm provenance. Run npm audit signatures; the npm page links the build to its commit and workflow run. dist/petasats-mcp.mjs is not minified. Source under src/ is exported from the development repository for each release with internal development comments removed and internal names replaced by neutral ones; apart from that it is identical.

Files, status, and recovery

The kit uses ~/.petasats. Run npx [email protected] status for status and npx [email protected] recover after interruption.

A Base withdrawal left pending (for example after a fee rise) is re-sent unchanged; new swaps and Base withdrawals wait until it confirms. Run npx [email protected] withdrawals to list pending withdrawals. If a finalized nonce was consumed but its receipt cannot be found, check the transaction in a Base explorer, then explicitly record the outcome with npx [email protected] withdrawal <hash> sent or npx [email protected] withdrawal <hash> not-sent.

Repeating the same Base withdrawal (same asset, amount, and address) within an hour is refused as a likely retry. Do not run two AI apps using the kit on the same folder at the same time.

A swap started with version 0.2.0 or 0.2.1 whose USDC lock never landed can stay at "Waiting for BSV lock" and block new swaps and withdrawals. If no other copy of the kit used the same folder while that swap ran, set PETASATS_RESOLVE_OLD_STUCK_SWAPS=1 in the kit's environment (for example "env":{"PETASATS_RESOLVE_OLD_STUCK_SWAPS":"1"} in your client's server entry) and restart the kit. It then sends a zero-value transaction to its own Base address so the old lock can never land, and marks the swap failed once that transaction is final, usually within 30 minutes. Swaps started with 0.2.2 or later resolve without this setting.

Troubleshooting

busy, limit, rate_limited, unavailable, and declined mean nothing was locked. If keys-file permissions are wrong, restore owner-only access. For RPC trouble, check your network connection and retry.

Security, license, and disclaimer

See SECURITY.md. PetaSats uses the Open BSV License v4; third-party notices are in THIRD_PARTY_NOTICES.md. This is experimental software: use small amounts and there is no warranty.

來源:README.md,提交 a7c22ce

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

12
  1. v0.2.16最新Nov 7, 2026
  2. v0.2.15Nov 5, 2026
  3. v0.2.14Nov 5, 2026
  4. v0.2.12Nov 4, 2026
  5. v0.2.11Nov 4, 2026
  6. v0.2.10Nov 4, 2026
  7. v0.2.9Nov 3, 2026
  8. v0.2.5Oct 31, 2026
  9. v0.2.4Oct 31, 2026
  10. v0.2.3Oct 30, 2026
  11. v0.2.2Oct 30, 2026
  12. v0.2.1Oct 29, 2026

評分

已滿足適用檢查項的 40%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分

    請在儲存庫或註冊中心條目中宣告授權條款。