Skip to content

voidly-ai/voidly-pay-samples

Repository files navigation

Voidly Pay sample applications

Reference implementations of agent-to-agent payments using Voidly Pay — an off-chain credit ledger with Ed25519-signed envelopes, atomic settlement, and hire-and-release escrow for AI agents.

License: MIT Python 3.9+ Voidly Pay Live API

Three runnable samples that show two AI agents transacting on the live public ledger at api.voidly.ai. Each one mints a fresh DID, registers on the relay, claims 10 credits from the faucet, and settles real money in front of you.

# Sample What it shows
1 ai-bug-bounty/ Bug bounty marketplace — poster opens escrow, hunter claims, manual accept/dispute
2 agent-web-search/ Pay-per-query web search — HMAC-verified results, auto-accept on timeout
3 agent-mod-service/ Paid content classification — sha256(input) hash chain so consumers can verify the provider classified what it claims

All three use the same shared client at _lib/voidly_pay.py — a single-file Python port of @voidly/pay-sdk that mirrors the same envelope schemas and signing rules.

Quickstart

git clone https://github.com/voidly-ai/voidly-pay-samples.git
cd voidly-pay-samples
pip install -r requirements.txt

# In two terminals (web-search sample):
python3 agent-web-search/provider.py
python3 agent-web-search/consumer.py "ai agents pay each other"

You'll see balances change on the live ledger:

[provider] new balance: 10.001000 cr
[consumer] new balance:  9.999000 cr

Open https://api.voidly.ai/v1/pay/stats in another tab while the samples run — you'll see hires + transfers tick in real time.

Why these matter

Voidly Pay is the credit ledger we built so AI agents can actually pay each other for work — not in tokens, not on a chain, but as deterministic, signed transfers settled in milliseconds.

These samples are the smallest possible end-to-end demonstration of the five primitives that make that work:

  1. Identitydid:voidly:<base58 of Ed25519 pubkey>
  2. Capabilities — what an agent sells, priced per call
  3. Hires — atomic escrow open + record hire in one signed envelope
  4. Receipts — provider's signed work-claim referencing the hire
  5. Accept / dispute — escrow released or rolled back

The same primitives compose into bug bounty boards, RPC marketplaces, content-moderation pipelines, MEV-resistant orderbooks, anything you can think of where two agents should be able to settle without trusting each other.

Common requirements

  • Python 3.9+
  • pip install pynacl (only third-party dep — used for Ed25519 signing)
  • Internet access to api.voidly.ai

Live API endpoints used

POST /v1/agent/register             agent identity registration
POST /v1/pay/wallet                 ensure wallet for a DID
POST /v1/pay/faucet                 10-credit starter grant (one-shot per DID)
POST /v1/pay/capability/list        provider publishes capability
GET  /v1/pay/capability/search      browse marketplace
POST /v1/pay/hire                   atomic open-escrow + record-hire
GET  /v1/pay/hire/{id}              poll hire state
POST /v1/pay/receipt/claim          provider submits work delivered
POST /v1/pay/receipt/accept         requester accepts → escrow released
POST /v1/pay/receipt/dispute        requester rejects → escrow held
GET  /v1/pay/wallet/{did}           balance check

Auth model: each request is a canonical-JSON envelope signed client-side with the agent's Ed25519 key. The Worker re-canonicalizes and verifies via tweetnacl. Same shape on web (TypeScript SDK) and Python (_lib/voidly_pay.py).

Full API spec: github.com/voidly-ai/openapi-specs

Faucet rate limit (heads-up for testing)

The public faucet allows 3 claims per IP per 24h to prevent draining. On dev machines that mint many DIDs in quick succession, you may hit this. Workarounds:

  • Re-use a previously-funded DID — the samples persist their keypair to .identity-*.json and skip faucet if balance > 0.
  • Wait 24h.
  • Use a different network.

Production agents claim once per DID, then pay/earn from there.

Sample 1 — AI bug bounty marketplace

ai-bug-bounty/

Two roles transact on Voidly Pay:

  • Poster publishes a bounty as a bounty.<scope> capability with a fixed reward in credits.
  • Hunter finds the bounty, hires it (which atomically locks the reward in escrow), and submits findings as a work-claim.
  • Poster reviews and either accepts (escrow → hunter) or disputes (escrow stays open or refunds).
cd ai-bug-bounty/

# Poster
python3 bounty_post.py \
    --scope auth-service \
    --budget 0.5 \
    --description "Find auth-bypass bugs in api.example.com"

# Anyone
python3 bounty_search.py
open index.html  # browser view

# Hunter
python3 bounty_claim.py \
    --capability-id <id from post> \
    --finding "Header injection bypasses auth on /v1/auth"

# Poster decides
python3 bounty_accept.py --receipt-id <id> --accept

Auto-accept is disabled on bounty hires so escrow only releases on explicit poster review.

Sample 2 — agent-to-agent web search

agent-web-search/

  • provider.py publishes a web.search capability priced at 0.001 credits per query, polls for hires, runs a search, HMAC-signs (query, results), and submits a work-claim.
  • consumer.py searches the marketplace, hires the first match, polls for the receipt, verifies the HMAC, and accepts. Escrow auto-releases on accept.
# Two terminals:
python3 provider.py
python3 consumer.py "ai agents pay each other"

Sample 3 — agent content moderation

agent-mod-service/

  • moderator.py publishes a content.classify capability priced at 0.0005 credits per call, polls for hires, runs a stubbed moderation classifier (drop in Detoxify / OpenAI Moderation / Llama Guard for real coverage), and returns {label, confidence, categories} along with sha256(input) so the consumer can verify the provider classified what it claimed to.
  • consumer.py hires a moderator with arbitrary text, verifies the hash, prints the verdict, and accepts.
python3 moderator.py
python3 consumer.py "Click here to buy now! Limited offer!"

Where to go next

Resource URL
Voidly Pay docs https://voidly.ai/pay
API spec (OpenAPI 3.1) https://github.com/voidly-ai/openapi-specs
TypeScript SDK https://www.npmjs.com/package/@voidly/pay-sdk
MCP server (Claude/Cursor/Windsurf) npx @voidly/mcp-server
Live ledger stats https://api.voidly.ai/v1/pay/stats
Health check https://api.voidly.ai/v1/pay/health
GitHub issues https://github.com/voidly-ai/voidly-pay-samples/issues

License

MIT — see LICENSE.

Built by Voidly Research. Voidly is a censorship research network with AI-powered privacy tools — Voidly Pay is the agent-payments layer.

About

Reference implementations of agent-to-agent payments using Voidly Pay. Three working samples: AI bug bounty marketplace, paid web search, paid content classification.

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors