zeroinit-mcp
Provides tools for issuing invoices on NEAR (testnet) whose addresses are derived from the invoice terms via deterministic account ids, so issuing costs no transaction. Includes invoice_status for checking whether an invoice's account exists and is paid, and verify_invoice for read-only checks over NEAR RPC (payment transaction, merchant/tax-vault split, and that no access keys exist on the invoice account). Never signs transactions.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Invoice addresses that cost nothing until they are paid.
Every invoice gets its own NEAR address, and issuing it needs no transaction. zeroinit.vercel.app · NEAR testnet only · mock token only · MIT
Try it · Claims · How it works · Verify · Limits · AI use
ZeroInit gives every invoice its own NEAR address, computed from the invoice terms, so issuing an invoice sends nothing to the chain. The payer's one transaction creates the account, pays the merchant and sets the tax aside (92/8 in the demo); nobody holds a key to that account.
Why it is new. Designs that give each item (an invoice, an NFT, a job) its own NEAR account create that account first: one transaction and one storage deposit per item, paid before anyone has paid anything. ZeroInit derives the address from the terms with NEAR's deterministic account ids (protocol 88), so issuing costs 0 transactions; the account comes into existence only when someone pays.
Live site: https://zeroinit.vercel.app
The one-transaction payment on testnet:
GFzvAw8t…(invoiceINV-1111-V33-A, contract v3.3: state init +pay, 0.92 to the merchant, 0.08 to the tax vault)For a bookkeeper:
zi exportwrites one CSV row per invoice: status, amount, merchant and tax shares, payer, payment time and due date, all read from the chain. No keys needed:npx -y @erhantrk/zeroinit export --dir invoices/v33 --out invoices.csvFor AI agents: an MCP server with
issue_invoice,invoice_status,verify_invoice,export_invoices(the bookkeeper's CSV) andcheck_address(never signs or sends a transaction; it can save the invoice file and the CSV, and looks invoices up by id). No clone needed:claude mcp add zeroinit -- npx -y -p @erhantrk/zeroinit zeroinit-mcp
Tracks: Real-World Money (primary) · Open Innovation. Testnet only, mock token only, not audited.
The local dashboard (npm run zi -- serve), Chrome, 2026-11-13 UTC, contract v3.3. The first NEAR invoice was paid in one transaction, the second by a plain transfer and a sweep, the third was issued and never paid, so its account does not exist; the tUSDC invoice was paid from the page, with its registration on the token in the same transaction as the payment. Each address shows its check code.
Try it in 2 minutes
Fastest, with no clone (Node 22 or newer, package @erhantrk/zeroinit 0.2.0 or newer, which ships the v3.3 recordings; export needs 0.3.0):
npx -y @erhantrk/zeroinit verify INV-1111-V33-A # read-only live check over testnet RPC: every line PASS, ends INFO status=PAID
npx -y @erhantrk/zeroinit replay fixtures/v33/demo-run.json # the recorded live run, replayed offline: 62 PASS lines, exit 0From a clone, the full check. No keys and no .env needed. Node 22; npm ci needs the npm registry once, everything after that is offline except the last line.
npm ci --include=dev
npm test # 266 tests, all pass
npm run zi -- replay fixtures/v33/demo-run.json # a recorded live testnet run, replayed offline: 62 PASS lines, exit 0
bash scripts/judge-offline.sh # the whole offline check; last line: JUDGE-OFFLINE: ALL PASS
npm run zi -- verify INV-1111-V33-A # one read-only live check over testnet RPC: every line PASS, ends PASS no-access-keys / INFO status=PAIDThe replay prints, among 62 PASS lines, PASS pay-tx-success INV-1111-V33-A GFzvAw8t… [], PASS split-merchant INV-1111-V33-A 0.92 and PASS split-vault INV-1111-V33-A 0.08.
Every step, with its full expected output, is in docs/VERIFY.md.
Related MCP server: hive-mcp-trade
Headline numbers
0 | transactions to issue an invoice |
1 | transaction to create the invoice account, pay and split the money |
0 | access keys on an invoice account ( |
0.0075647 NEAR | measured cost of that one transaction to the payer (gas plus NEAR's 0.007 NEAR account-creation charge) |
266 + 104 | offline JavaScript tests ( |
1 | reproducible build: the deployed code |
What NEAR does here
Deterministic account ids (protocol 88, NEP-655). An account id can be the SHA3-256 hash of its future code and state, so the invoice address is printed before the account exists. The invoice terms are inside the hashed state, so they cannot change after issuing.
One transaction does everything.
[UniversalStateInit, FunctionCall pay]creates the account, runs the contract and splits the payment.Plain transfers work too. A plain NEAR transfer from any wallet or exchange waits in the "uninitialized" account, which only the matching state init can unlock; then anyone calls
sweep. If the payer later pays withpayas well, the contract counts what is already parked and charges the price once.Global contract by hash. The invoice code is published once as a global contract; each invoice only references its hash, and nobody can change what that hash runs.
Details, diagrams and every contract rule: docs/HOW-IT-WORKS.md.
Claims and how to check them
Claim | Command | Expected |
Issuing an invoice sends no transaction |
|
|
One transaction creates the account, pays and splits (NEAR) |
|
|
A plain transfer from a wallet or exchange is safe before the account exists | same replay |
|
A token invoice (tUSDC, a testnet mock) is paid by a plain |
|
|
A payment on top of parked funds is charged once |
|
|
Nobody holds a key to an invoice account |
|
|
An accountant gets a spreadsheet, with every status read from the chain |
|
|
The deployed code is the committed wasm, rebuilt from this source |
|
|
More claims (the address commits to the terms, the token-sweep race, two token payments at once, the private callback, the check code) and the older versions' claims: docs/VERIFY.md.
Limits
Full list with the evidence: docs/LIMITS.md.
Testnet only, mock token only, not audited. The audit rounds were AI reviews. tUSDC is a testnet mock with no value and no issuer.
A token invoice id must be registered on the token before tokens can reach it. That is a rule of the token standard (NEP-145), not of this contract. Our client sends the registration (
storage_deposit, 0.00125 NEAR) in the same transaction as the payment. An exchange withdrawal is a plainft_transferfrom someone else's software, so someone (the merchant, the payer or anyone) must register the id first. For tokens only issuing is free; "no transaction until paid" holds fully for NEAR invoices.Plain-transfer underpayments and overpayments are not refunded (
sweepcannot know the payer).No checksum in the address. The
0u…format belongs to NEAR and has none: a mistyped address is a valid address for other bytes, and funds sent there are lost.zi invoice newprints a 4-character check code (CHECK MVNCforINV-1111-V33-A), andzi check <address> <code>says PASS or FAIL offline. It only helps a payer who checks; a raw address pasted into a wallet is still unprotected.Wallet support is untested. The dashboard was opened in Chrome on v3.3 for NEAR and tUSDC invoices (pay, plain transfer, sweep); the
SETTLING/REFUNDEDbadges and Refund payer were not tried in a browser.Transaction lookups need an archival RPC after about 1.5 days; state checks and offline replays keep working.
Not in this build
Paying from another chain (NEAR Intents, 1Click). Intents has no testnet (hackathon rule Q-007) and ZeroInit runs on testnet only, so a payer pays in NEAR or tUSDC on NEAR. An Intents deposit that ends in a plain transfer or
ft_transferto the0u…address would settle like any plain transfer, but that path was not built or tried.Gasless payment for the payer (meta transactions, a relayer). The payer pays the gas: 0.0075647 NEAR for the measured NEAR payment. The merchant never needs gas: payouts arrive without a merchant transaction, and anyone can run
sweep.Line items. An invoice holds one amount, a tax rate, a due date and an id; line items would live in the merchant's own records next to the invoice id.
Who holds keys
The invoice contract has no owner and no admin call, and invoice accounts have no keys. The tUSDC mock token (zeroinit-tusdc.testnet) and the operator's deployer, merchant, tax-vault, payer and sweeper accounts (zeroinit-deployer.testnet, zeroinit-merchant.testnet and so on, created for v3.3) each hold one full-access key: a token invoice trusts whoever controls the token contract, which on testnet is the operator. The full table and the command to re-check it: docs/LIMITS.md.
Repo map
contract/— the invoice contract (Rust, near-sdk 5.30.1, 104 unit tests).contract/res/v3.3/zeroinit_invoice.wasmis the deployed wasm;contract/res/v3.2r/andcontract/res/v3.2/hold earlier builds (history).contract-v2/is the v2 contract (history, 14 tests).src/— theziCLI, the byte encoders (bytes.ts,stateinit.ts,tx.ts), RPC client, outcome parser, invoice documents, offline replay, and the local dashboard server (server.ts; the page is inweb/).cli/— the npm package@erhantrk/zeroinit: theziCLI, the library and the MCP server as bundled files plus the v3.3 recordings, assembled bynpm run build:cli.mcp/— the MCP server (mcp/dist/zeroinit-mcp.mjsis the bundled single file), shipped in the npm package as thezeroinit-mcpcommand; each GitHub release rebuilds the bundle and checks it is the committed file (.github/workflows/release.yml).fixtures/— recorded live RPC sessions that replay offline:v33/(current),v32r/,v32/,v31/,v3/,v2/,v1/(history), plus synthetic fixtures used by tests only.invoices/— the invoice documents of those runs (v33/current),demo/(the invoices of the dashboard runs:DASH-R3STU-*on v3.3,DASH-53NMD-*on v3.2r) andexamples/INV-0001.json(the frozen test vector). No secrets.scripts/—judge-offline.sh, the demo and recording scripts that produced the fixtures, and small signing helpers.site/— the landing page (Astro), live at https://zeroinit.vercel.app. It shows the v3.3 recordingfixtures/v33/demo-run.json. Build:cd site && npm ci && npm run build(Node >= 22.23.4); the replay data comes frompython3 -I site/scripts/extract-replay.py.docs/— HOW-IT-WORKS, VERIFY, LIMITS, REPRODUCE, RUN-ON-TESTNET (the keyed walkthrough), ARCHITECTURE (measured costs, design by version), STABLECOIN (the token interface spec), HISTORY (v1 to v3.3), SPIKES (every live transaction). SPEC.md is the v1 interface spec.
No code from before the hackathon window
The hackathon counts work from its announcement on 2026-10-19 (rule Q-001). This repository's first commit (ea8d0fb, 2026-11-09 21:52 UTC) is later than that and later than the 2026-11-01 start, so every line here was written during the hackathon and there is no pre-hackathon baseline. The tag hackathon-submission marks the submitted state; the whole history is the hackathon diff: ea8d0fb...hackathon-submission.
The first commit is the plan with a reference implementation drafted with Claude during the planning phase of this hackathon; the next commits copied it into src/ and contract/, and everything after was built on top. The mock token test-usdc is a separate repository, also written during the hackathon. Detail and how to check it: AI_USE.md.
AI use
The code, tests and docs were written and reviewed with AI models (DeepSeek V4.1 Flash, Claude Sonnet 5.5 and Claude Opus 5.5 built and ran it; Claude Fable 5.2 did the final audit and, with Claude Opus 5.5, built v3.3); a human decided, ran the accounts and is responsible. Who did what, round by round: AI_USE.md.
Also by the same author: ProvenExit
ProvenExit is a separate submission to the same hackathon: https://github.com/erhantrk/provenexit (public), site https://provenexit.vercel.app. The two projects share no code.
License
MIT, see LICENSE. The mock token source is test-usdc (public, MIT); the deployed mock zeroinit-tusdc.testnet is built from its commit 94396e4.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Invoicing for businesses and AI agents: invoices, crypto payments, compliance, Invoice Passports.
Free invoice drafts, templates and direct PDF generation for AI agents. No account needed.
An AI treasury agent paying in USDC on Arc: read its decisions, ledger and books; add invoices.
Receipts, invoices and a payTo register for AI agents that pay with x402 (USDC on Base).
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI assistants to deploy, initialize, and upgrade NEAR smart contracts with cost estimation and status checks.5MIT
- AlicenseNot gradedqualityDmaintenanceEnables cross-border SMB invoice settlement on USDT/USDC rails with $0 wire fee and same-block settlement, including fee schedule comparison, invoice creation, status tracking, and dispute arbitration via HiveLaw.MIT
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to create and manage e-invoices through natural language, supporting EU compliance formats like ZUGFeRD and XRechnung, as well as US plain PDF invoices.7-

four02-commerce-mcpofficial
AlicenseAqualityCmaintenanceEnables MCP-capable agents to create, verify, and pay EIP-712 USDC invoices on Ink, and read onchain commerce reputation for ERC-8004 agents.6MIT