用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/Jay0xx/forge0btc-news-agent --skill nonce-manager命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
ERC-8004 on-chain agent identity management — register agent identities, update URI and metadata, manage operator approvals, set/unset agent wallet, transfer identity NFTs, and query identity info.
x402-gated agent inbox — send paid messages to any agent's inbox, read received messages, and check inbox status. Send requires an unlocked wallet with sBTC balance (100 sats per message); sponsored transactions mean no STX gas fees.
Bitcoin mempool monitoring — check transaction confirmation status, retrieve address transaction history, and inspect current mempool state. Data sourced from mempool.space.
基于 SOC 职业分类
正在显示 SKILL.md
| name | nonce-manager |
| description | Cross-process Stacks nonce oracle — atomic acquire/release prevents mempool collisions across skills |
| metadata | {"author":"rising-leviathan","author-agent":"Loom","user-invocable":"false","arguments":"acquire | release | sync | status","entry":"nonce-manager/nonce-manager.ts","mcp-tools":"nonce_health, nonce_heal, nonce_fill_gap","requires":"","tags":"infrastructure, l2"} |
Centralized nonce oracle for all Stacks blockchain transactions. Prevents mempool collisions when multiple skills send transactions concurrently or in rapid succession.
Each skill independently fetches nonce from Hiro API. When tasks fire back-to-back (before mempool clears), they grab the same nonce and collide with SENDER_NONCE_STALE or SENDER_NONCE_DUPLICATE errors.
Single file-locked nonce state at ~/.aibtc/nonce-state.json. Skills call acquire to get the next nonce (atomically incremented), and release after the transaction confirms or fails. If state is stale (>5 min), auto-resyncs from Hiro.
Get the next nonce for a Stacks address. Atomically increments the stored value. Auto-syncs from Hiro if state is missing or stale (>5 min).
bun run nonce-manager/nonce-manager.ts acquire --address SP...
Output:
{ "nonce": 42, "address": "SP...", "source": "local" }
Mark a nonce as confirmed or failed after transaction outcome is known.
bun run nonce-manager/nonce-manager.ts release --address SP... --nonce 42
bun run nonce-manager/nonce-manager.ts release --address SP... --nonce 42 --failed
bun run nonce-manager/nonce-manager.ts release --address SP... --nonce 42 --failed --rejected
Failure kinds (critical distinction):
--rejected — tx never reached mempool (signing error, relay 409 nonce rejection). Nonce NOT consumed, safe to roll back and reuse.--broadcast (default when --failed) — tx reached mempool. Nonce IS consumed even if the tx fails on-chain. Do NOT roll back.Only --failed --rejected triggers a rollback. Default --failed assumes broadcast (safer).
Output:
{ "address": "SP...", "nonce": 42, "action": "confirmed" }
Force re-sync nonce state from Hiro API. Use after manual intervention or mempool clearance.
bun run nonce-manager/nonce-manager.ts sync --address SP...
Output:
{ "nonce": 42, "address": "SP...", "mempoolPending": 3, "lastExecuted": 41, "detectedMissing": [] }
Show current nonce state for one or all tracked addresses.
bun run nonce-manager/nonce-manager.ts status
bun run nonce-manager/nonce-manager.ts status --address SP...
Skills running in the same process can import directly:
import { acquireNonce, releaseNonce, syncNonce } from "../nonce-manager/nonce-store.js";
const { nonce } = await acquireNonce("SP...");
// ... send transaction ...
await releaseNonce("SP...", nonce, true); // true = success
Per landing-page#522, map relay error codes to release actions:
| Relay Response | Release Action |
|---|---|
201 (success or pending) | release --address ... --nonce N (success) |
409 SENDER_NONCE_DUPLICATE | release --address ... --nonce N --failed --broadcast (nonce in mempool) |
409 SENDER_NONCE_STALE | release --address ... --nonce N --failed --rejected + re-sync |
409 SENDER_NONCE_GAP | release --address ... --nonce N --failed --rejected + re-sync |
409 NONCE_CONFLICT | release --address ... --nonce N --failed --broadcast (retry same signed tx) |
502/503 relay error | release --address ... --nonce N --failed --rejected (never broadcast) |