dgb-digidollar-mcp
Enables AI agents to pay for services in DigiByte/DigiDollar on testnet via the x402 pay-and-retry pattern, with spend limits and security policies.
README
dgb-digidollar-mcp
⚠️ TESTNET ONLY — PROOF OF CONCEPT. This is experimental software for the DigiByte testnet. It moves no real money and is not audited. Do not point it at mainnet or a wallet holding real funds. The testnet-only guard is on by default.
An MCP server that lets an AI agent (Claude, etc.) pay for a service in DigiDollar — DigiByte's collateral-backed, USD-denominated stablecoin — following the x402 pay-and-retry pattern:
- Agent requests a service → service replies
402 Payment Requiredwith a DigiDollar address + price. - Agent calls
pay_invoice→ this server checks the operator's spend policy, then pays. - Agent calls
payment_status→ confirms the tx landed, then retries the request.
The agent never holds keys. The wallet and the spend caps live here, on the operator's machine. Allowance, not custody.
Why DigiDollar, and why this settles the "did I get paid in DD?" question
Agent payments need stable pricing — nobody wants an API call that costs 30% more because the token moved. That's why the rest of the agent economy settles in USDC. But USDC has an issuer-level blacklist, and Base has a single sequencer: two kill switches. DigiDollar has neither — it's minted against locked DGB collateral on a proof-of-work L1, with no freeze function in the protocol.
DGB secures it. DigiDollar spends it.
The obvious worry for a merchant is: "how do I know I was paid in DigiDollar and not just bare DGB sent to the same address?" It turns out the protocol makes that impossible by construction:
- DigiDollar has its own address type (
DD/TD/RDprefix), distinct fromdgb1…/dgbt1…. - It has its own UTXO set (
listdigidollarutxos,getdigidollarbalance). - A plain DGB address fails
validateddaddressoutright — this server refuses to send to one.
So DD and DGB cannot be confused. A merchant checking getdigidollarbalance /
listdigidollarutxos is, by definition, seeing DigiDollar.
Amounts, one sharp edge worth knowing: senddigidollar reads an integer as cents
but a decimal as dollars (10000 = $100, 10000.00 = $10,000). This server always
converts to integer cents internally so that 100x foot-gun can't fire.
Architecture
Your machine Your node host
┌─────────────────────────┐ ┌──────────────────────────┐
│ Claude ── MCP server ───┼── SSH tunnel ──┼─> digibyted (testnet26) │
│ (this repo) │ :14026 │ RPC 127.0.0.1:14026 │
└─────────────────────────┘ └──────────────────────────┘
The node's RPC is bound to localhost on the node host and never exposed to the
internet. tunnel.sh forwards a local port to it over SSH (key-only auth
recommended). If you run the node on the same machine as the MCP server, you can
skip the tunnel and point DGB_RPC_URL straight at the local node.
Try it yourself
You provide your own node and your own keys — that's the point. Nothing here is hosted; there is no shared server to trust.
1. Run a DigiByte DigiDollar testnet node. Install DigiByte Core
v9.26.4+ and start it on
testnet with RPC enabled. Minimal digibyte.conf:
testnet=1
server=1
[test]
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
rpcuser=YOUR_RPC_USER
rpcpassword=YOUR_STRONG_RPC_PASSWORD
Let it sync testnet26 (the DigiDollar test network). Confirm with
digibyte-cli -datadir=... getblockchaininfo → "chain": "test".
2. Create a wallet and get some testnet DGB.
digibyte-cli -datadir=... createwallet mcp-sandbox
digibyte-cli -datadir=... -rpcwallet=mcp-sandbox getnewaddress
Paste that address into the DigiByte testnet faucet and it'll send you free tDGB. (Testnet coins are worthless by design — they exist so you can build and break things without risking anything.)
3. Mint some DigiDollar. DD doesn't exist until someone locks DGB collateral to create it. Check what you'd need, then mint:
# what collateral does $100 of DD cost at lock tier 0 (1 hour)?
digibyte-cli -datadir=... -rpcwallet=mcp-sandbox estimatecollateral 10000 0
# mint $100 (amount is in CENTS; tier 0 = 1h lock, tiers run 0-9 up to 10 years)
digibyte-cli -datadir=... -rpcwallet=mcp-sandbox mintdigidollar 10000 0
Heads-up: the short tiers are heavily over-collateralised (tier 0 is ~1000%), so $100 of DD locks roughly 390,000 tDGB at current prices. Longer locks need less. The faucet won't give you that much in one go — either claim over a few days, ask in the DigiByte community, or use a longer lock tier.
4. Configure and self-test.
npm install
cp .env.example .env # fill in your RPC user/password (+ SSH host if remote)
./tunnel.sh & # only if the node is on another host; leave running
npm run smoke # connectivity + policy self-test — moves no funds
5. Connect it to Claude. Add the server to your MCP client config (see
claude-config-snippet.json, with the paths adjusted to where you cloned this).
Then ask the agent to check the balance and pay a small testnet invoice. Watch
the policy layer block anything over your caps.
Tools
| Tool | What it does |
|---|---|
check_balance |
DigiDollar balance (USD) + DGB balance + node sync + current policy state. |
pay_invoice |
Send amountUsd of DigiDollar to a DD address, subject to policy. Returns txid. |
pay_invoice_dgb |
Secondary path: pay in plain DGB instead. Separate caps. |
payment_status |
Confirmation count for a txid (the x402 retry gate). |
Safety policy (.env)
DGB_REQUIRE_TESTNET=true— server refuses to run unless the node reportschain=test.DD_MAX_PAYMENT_USD/DD_MAX_DAILY_USD— DigiDollar caps, in US dollars.DGB_MAX_PAYMENT/DGB_MAX_DAILY— separate caps for the raw-DGB path.
DigiDollar and DGB get separate ledgers and separate caps — a dollar and a DGB are not interchangeable units, so they are never netted against each other.
Roadmap
- [x] Milestone 1 — pay in plain testnet DGB (
sendtoaddress). - [x] Milestone 2 — pay in DigiDollar (
senddigidollar), USD-denominated, with DD-address validation. Proven live on testnet26. - [ ] Milestone 3 — a 402 merchant library: emit invoices, watch for DD payment, ship on confirm.
- [ ] Milestone 4 — publish to the MCP registry.
Help wanted
Milestone 3 is where collaboration is most welcome: the merchant side. A
drop-in library so any service can emit a 402 Payment Required with a DigiDollar
invoice, watch for the payment, and deliver on confirmation. Issues and PRs welcome.
Status
Proven live on testnet26 — an AI agent paid $2.50 and $1.25 in DigiDollar to a merchant wallet (confirmed on-chain), while the policy layer correctly blocked a payment over the cap and refused to send DigiDollar to a bare DGB address.
This is a rough proof of concept, not production software. It should never touch mainnet or real funds.
Built for the DigiByte community. Testnet only. Not financial software.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。