🧩 Wallet Connectors

Connect your app
to the BB84 Wallet

Ask a BB84 Wallet user for read access to their profile, balances and transactions, and optionally to propose payments. The user approves in the app under Settings → Connectors — no API key, no registration.

🧩 Wallet connectors (user data and payment proposals)

Ask a BB84 Wallet user for read access to their profile, balances and transactions. The user approves the request in the app under Settings → Connectors and can disconnect at any time. By default access tokens can only read. With the optional scope payment_requests they can also propose payments, which the user confirms in the app. Only if the user sets up an AI budget for a connection can it pay from that budget without confirmation. It can never move the user's other funds.

Connectors use the standard OAuth 2.0 Device Authorization Grant (RFC 8628), so any OAuth library that supports the device flow works out of the box. Clients are public: pick your own client_id (e.g. acme-books), no registration or client secret. Endpoints are discoverable via server metadata (RFC 8414, issuer https://bb84.com/api/connect).

1. Start the device authorization

curl -X POST https://bb84.com/api/connect/oauth/device_authorization \
  -d client_id=acme-books \
  -d client_name="Acme Books" \
  -d client_uri=https://acme.example \
  -d scope="profile balances transactions"

# {"device_code":"bb84_dc_…","user_code":"K7QM-2XPA",
#  "verification_uri":"https://bb84.com/connect",
#  "verification_uri_complete":"https://bb84.com/connect?code=K7QM-2XPA",
#  "expires_in":600,"interval":5}

Show the user the user_code and verification_uri, or a QR code of verification_uri_complete. The user enters the code in the app under Settings → Connectors. On their phone, bb84://connect/K7QM2XPA opens that screen directly. scope is optional (default: all three). The wallet shows client_name (or your client_id) and client_uri to the user. These values are self-declared, so users decide whom to trust.

2. Poll the token endpoint

curl -X POST https://bb84.com/api/connect/oauth/token \
  -d grant_type=urn:ietf:params:oauth:grant-type:device_code \
  -d device_code=bb84_dc_… \
  -d client_id=acme-books

# {"access_token":"bb84_conn_…","token_type":"Bearer","scope":"profile balances transactions"}
#   ← returned once, store it securely. Tokens do not expire; they stay valid until the user (or you) disconnects.
#     Exception: a token that is never used within 7 days of approval is removed.

Poll every interval seconds until you get a token or a final error. Errors are returned as HTTP 400 with {"error":"…","error_description":"…"}:

errorMeaning
authorization_pendingThe user has not decided yet. Keep polling.
slow_downYou polled too fast. Add 5 seconds to your interval for all further polls.
access_deniedThe user rejected the request. Stop.
expired_tokenThe code expired after 10 minutes. Start again with step 1.
invalid_grantUnknown device_code, a different client_id, or the token was already issued. Stop.

Example in Python with plain requests. OAuth libraries with device-flow support, such as Authlib, work too:

import requests, time
B = "https://bb84.com/api/connect/oauth"
d = requests.post(f"{B}/device_authorization",
                  data={"client_id": "acme-books", "client_name": "Acme Books"}).json()
print("Enter", d["user_code"], "in the BB84 Wallet (Settings → Connectors)")
interval = d["interval"]
while True:
    time.sleep(interval)
    r = requests.post(f"{B}/token", data={"grant_type": "urn:ietf:params:oauth:grant-type:device_code",
                                          "device_code": d["device_code"], "client_id": "acme-books"}).json()
    if "access_token" in r: token = r["access_token"]; break
    if r["error"] == "slow_down": interval += 5
    elif r["error"] != "authorization_pending": raise SystemExit(r["error"])

Disconnect from your side

curl -X POST https://bb84.com/api/connect/oauth/revoke -d token=bb84_conn_…

Token revocation per RFC 7009. The connection disappears from the user's wallet as well. The response is always HTTP 200, even for unknown tokens.

3. Read data

Method & PathDescription
GET /api/connect/v1/accountGranted scopes, the user's addresses, profile (name, bb84 name, photo) if granted
GET /api/connect/v1/balancesUSDC/EURC balance per address and in total (base units, 6 decimals)
GET /api/connect/v1/transactions?limit=100&fromBlock=…&toBlock=…USDC/EURC transfers in/out, newest first (max 500). fromBlock/toBlock are optional (decimal or 0x-hex); without them the whole history is returned. The response contains toBlock (last block covered) and nextFromBlock — pass that as fromBlock next time to fetch only new transfers. If total is larger than the returned list, only the newest were returned: narrow the range with toBlock before advancing.
curl https://bb84.com/api/connect/v1/balances \
  -H "Authorization: Bearer bb84_conn_…"
🔷
Rate limit: 60 requests/minute per access token. A revoked connection returns HTTP 401. The address list follows the user's wallet automatically (new or renewed OTAs). Addresses are shared by the user, not cryptographically proven — do not treat them as proof of ownership. For proof, use the ownership proofs below.

🤖 MCP server for AI assistants

The connector data is also available over the Model Context Protocol, so AI assistants and agents (Claude, Cursor, ChatGPT and others) can answer questions like “How much EURC did I spend in October?” directly. The MCP server uses the same access token, scopes and rate limit as /v1. By default it only offers read tools. With the optional payment_requests scope it can propose payments, which the user confirms in the app. An AI can never send, sign or approve a payment itself, except from an AI budget the user set up for this connection (pay_from_budget, limited to the budget address).

EndpointTransport
POST https://bb84.com/api/connect/mcpStreamable HTTP, stateless, JSON responses (no SSE stream). tools.listChanged: when your tool list changes, the next response arrives as a short SSE body with notifications/tools/list_changed before the result (send the Mcp-Session-Id from initialize and accept text/event-stream). Authorization: Bearer bb84_conn_…

Tools

ToolScopeDescription
get_account–The connection in one call: shared addresses, granted scopes, profile snapshot (scope profile), balances per address and in total, raw and human-readable (scope balances), the AI budget if the user set one up (address, name, balances, paymentsLeft/paymentsTotal, payments so far; null otherwise) and standingOrders as last shared by the app (scope payment_requests). ownership says whether the addresses are cryptographically proven
list_transactionstransactionsTransfers, newest first. Filters: since/until (ISO date or Unix seconds), direction, asset, limit, fromBlock/toBlock. Payments carry counterpartyName (the other side's bb84 name, if any); the fee collector of merchant payments is marked with counterpartyNote. With summary: true a statement for the period instead: totals in/out/net per asset, by type (payment, deposit, withdrawal), per month, top counterparties with bb84 names, plus up to limit transactions (since/until then also take YYYY-MM; default: the current month)
list_eventstransactionsWhat happened since a point in time {since?, limit?}, newest first: payments in/out, deposits, withdrawals (with the counterparty's bb84 name), name changes of the addresses, decided proposals, payments from the AI budget. Returns cursor; pass it as since next time. Also readable as MCP resource bb84://events (last 24 h)
list_contacts–The user's dynamic contact list {query?, kind?, limit?}: everyone the shared addresses paid or were paid by (scope transactions), the own addresses, AI budgets (agents), merchants of paid calls, merged with the contact book the app shares (nicknames, notes, pins, manual entries — scope payment_requests). Each entry: address, bb84 name, nickname, displayName, kind (person, merchant, agent, own, service), sources, last use, sent/received counts, public profile. Also readable as MCP resource bb84://contacts
search_directory–The public directory of the name service as a queryable database {query?, kind?, city?, country?, addresses?, sort?, limit?, offset?}: every named address (<name>.bb84.eth) with its public profile (display name, city, country, avatar — never e-mail, phone, street, postal code or birthdate; a private profile shows only name and address), the on-chain merchant flag, AI-budget addresses as agents, website, payment link, first-seen and last-activity day; kind is person, merchant or agent, sort name | newest | active, pages carry nextOffset. Entries of this connection's own addresses carry isOwn, entries in the shared contact book contact (nickname, note). Also readable as MCP resource bb84://directory (first 100 by name)
resolve_name–Name ↔ address {query, suggest?}: a bb84 name (alice or alice.bb84.eth), a 0x address, a mainnet .eth name or a DNS domain imported into ENS via DNSSEC (shop.example → kind: "dns", verified: "dnssec", address = the bb84 address its owner published; status no_bb84_address / not_found otherwise). Returns address, name, website <name>.bb84.com, public profile (display name, location, avatar; nothing if the owner set it private), merchant flag, whether it is one of the connection's own addresses, ENS records, EFP counts; status reserved, deleted or not_found for names without an address. For a name nobody has, availability says whether it can be claimed for a new address or a rename (available, reserved, auto — adjective-noun-number names are assigned automatically —, invalid) with up to three free alternatives when it cannot; suggest: true does the same for a taken name. Checking claims nothing
request_payment–Lets someone else pay the user {amount?, asset?, note?, address?}: payment link + QR code (bb84.com/pay/…), nothing is created on the server, the payment shows up in list_transactions (use the returned fromBlock). With items, description, customer, number, dueDays, issuer, language or invoice: true an invoice as well: the link plus a one-page PDF (pdfUrl, public but unguessable) with items, total, QR code and link; paid status via get_proposal with the inv_… id. The result says kind link or invoice
propose_paymentpayment_requestsProposes a payment {to, amount, asset, note}, or one taken from a bb84 payment link {payLink}. Nothing is paid until the user confirms it in the app; status via get_proposal
proposepayment_requestsProposes a wallet action the user carries out in the app (or on the proposal page with a passkey). kind picks the fields: create (a new address: asset, name?), rename (address, name), profile (name?, city?, country?, avatarUrl?, private?), delete (address), recurring (standing order: to, amount | "max", asset, frequency, runDay?), cheque (amount ≤ 250, asset), credit_line (grantee, amount, asset, frequency?, periodLimit?, maxPerTx?, expiryDays?); note for all. Fields of another kind are refused together with the list of the right ones. Details below
get_proposal–Status of any proposal by its id: pr_… (payment) pending, paid (with txHash), rejected or expired, for pay_and_call also call (its state and, once delivered, the merchant's answer); or_… (action) pending, created / renamed / saved / deleted (with result), rejected or expired; inv_… (invoice) open or paid (≥ 99 % of the amount received after creation)
pay_and_callpayment_requestsCalls a paid HTTP API or a paid tool of another MCP server and pays the merchant's bb84 price {url, maxAmount, method?, body?, headers?, mcpTool?, asset?, payFromBudget?, idempotencyKey?} — or turns an x402 PaymentRequired the client already received into a payment proposal {paymentRequired, maxAmount?} (afterwards get_proposal returns the x402 proof). See Paid calls
pay_from_budgetAI budget{to, amount, asset, note?, goodsAndServices?, idempotencyKey?} → pays immediately from the AI budget, no confirmation in the app. Only listed once the user set up a budget for this connection; see AI budget
scan_code–Shows a scan card (MCP Apps) with which the user scans a bb84 triangle code (ΔQR) or a QR code like in the bb84 app: a photo with the phone camera, a picture, a pasted screenshot or the live camera. The code is read in the browser (nothing is uploaded); its content — payment link, shop checkout link, proposal link, address or name — reaches the assistant with the user's next message, which then proposes the payment or asks get_proposal for the status. The card pays nothing
get_docs–The user guide How the bb84 wallet works {topic?, lang?}, for explaining bb84 to the user: accounts and hash chains, money in and out, payments, wallet features, names, the app, passkey and recovery, security, AI assistants, merchants, fees and limits, glossary, FAQ. Without topic the overview plus the topic list; topic is one id (overview, accounts, money, payments, features, names, app, backup, security, ai, merchants, fees, glossary, faq), several separated by commas, or all; lang en (default) or de. Also the resources bb84://docs and bb84://docs/de, and public at bb84.com/api/connect/docs/wallet.en.md / wallet.de.md
get_protocol–The bb84 protocol specification and the reference clients for autonomous agents that hold a wallet themselves (part: spec, python, typescript, all); see Autonomous agents without MCP

Older tool names. Until 17 November 2026 the server listed 28 tools, one per endpoint: get_balances, get_budget, list_recurring (now in get_account), get_statement (list_transactions with summary), check_ens_name (resolve_name), create_payment_link, create_invoice (request_payment), propose_ota, propose_rename, propose_recurring, propose_cheque, propose_credit_line, propose_delete, propose_profile (propose), get_payment_request, get_action_request, get_invoice (get_proposal) and pay_x402 (pay_and_call with paymentRequired). tools/call still accepts every one of them with its old arguments and answer; they are just no longer in tools/list. The REST endpoints are unchanged.

Payment proposals (scope payment_requests)

With the optional scope payment_requests, an app or AI assistant can propose payments. It can never execute them. Each proposal appears in the user's bb84 app (bell → Connectors). The user opens it in the normal Send flow, checks recipient and amount and confirms with their passkey. Only after the payment is sent does the server verify it on-chain and report paid with the transaction hash.

Address proposals (scope payment_requests)

An assistant can also propose a new address (a fresh OTA) for the user, for example “a EURC address named shop.bb84.eth for the web shop”. A bb84 address is a hash chain whose keys only ever exist in the app, so the server cannot create one. propose with kind: "create" therefore only records the wish. It appears in the app (bell → Connectors, push notification, appLink https://bb84.com/pay/proposal/<id>); when the user taps “Create”, the app generates the address on the phone, claims the proposed name and reports address and final name back. get_proposal then returns created with address and finalName, and the address is part of get_account.

Standing orders, cheques, credit lines, deleting (scope payment_requests)

The same proposal pattern covers four more things the app can do. Each proposal appears under bell → Connectors (and as a push notification); “Check & confirm” opens the app's normal screen prefilled, the user checks every field and confirms there as usual, and the app reports the outcome, which get_proposal returns in result.

Without the app (passkey wallet): a user who connected the assistant with a passkey instead of the app opens the same appLink in the browser. The page shows what the assistant proposed, and after the passkey carries it out itself with the bytes the app would send — a payment, a new name, the public profile (text fields; a photo only in the app), a credit line, a bearer cheque (the code is shown once on the page), deleting an address, a further address (derived from the same passkey) — and reports it, so get_proposal ends in the same status. The one exception is kind: "recurring": a standing order runs on the phone, and nothing can run on a passkey without the user; the assistant gets this as the pending message, with a credit line or an AI budget as the alternative. The AI budget of a connection is granted at bb84.com/pay/budget (the app has it under Connectors). The same passkey is the same wallet in the bb84 app: the app pulls connections made in the browser from the server (POST /api/connect/web/connections, signed with the address's proof key), and a proposal can be confirmed in either place.

Names, addresses and ENS records (no scope)

Every bb84 address has a name <label>.bb84.eth — and, since bb84.com is imported into ENS via DNSSEC, the same name as <label>.bb84.com (same records, same resolver; tools accept both spellings and answer with the .bb84.eth form). resolve_name turns a name the user mentions into an address (and back) and tells the assistant what the name service serves publicly anyway: website, display name, location and avatar from the owner's profile (nothing if the profile is private; email, phone and street are never passed on), whether the address is a registered merchant and whether it belongs to the connection. Names without an address come back with status reserved, deleted (an OTA deleted on-chain: never pay it) or not_found. A mainnet .eth name resolves to its Ethereum address with kind: "mainnet" — bb84 can only pay it as a withdrawal from the app.

Your own domain as a bb84 name (DNSSEC). Any DNSSEC-signed domain can be a bb84 recipient — shop.example or a subdomain such as pay.shop.example — without an account at bb84: the domain's owner publishes the bb84 address as an ENS record, and bb84 resolves the domain through ENS exactly as a wallet does (Universal Resolver, ENSIP-10, CCIP-Read followed server-side). A DNS name exists in ENS only behind a DNSSEC proof, so a payment to shop.example provably reaches whoever controls that domain in the DNS — a stronger identity than any first-come name. Two ways to publish, both need DNSSEC enabled at the registrar. Merchants check their setup step by step at bb84.com/domain (DNSSEC, TXT record, proof chain against ENS's oracles, what bb84 resolves; the same report as JSON: GET /api/ens/mainnet/check/<domain>, the ENS-side state: GET /api/ens/mainnet/dns-status):

Then resolve_name answers kind: "dns", verified: "dnssec", address = the bb84 address (plus mainnetAddress if an Ethereum address is published, bb84Name if the address also has a .bb84.eth name, profile and merchant flag of that address); propose_payment and the recurring/cheque/credit-line proposals take the domain as to and pin the resolved address (toAddress); the app resolves the domain the same way and shows “Domain verified via DNSSEC” next to the recipient. A domain in ENS that only carries an Ethereum address comes back as status: "no_bb84_address" (bb84 cannot pay it — the note tells the owner what to publish), a domain never imported as not_found. Public endpoint behind it: GET /api/ens/mainnet/resolve/<domain> → {name, kind: "dns", verified: "dnssec", address, bb84Address, isContract}, 404 when the domain is not in ENS. bb84 never contacts a domain's own servers for this; only ENS resolvers' CCIP-Read gateways (https, public addresses, 64 KiB) are called. The lookups depend on the ENS DNSSEC oracle knowing the current DNS root key.

The same data is on ENS itself, so any ENS-aware wallet or agent sees it without bb84's API (CCIP-Read via the resolver of bb84.eth on Ethereum mainnet):

Contacts. An assistant no longer has to rediscover the user's counterparties in every chat (list_transactions, then resolve_name per address). list_contacts returns one merged list per connection: payers and payees of the shared addresses, the user's own addresses, AI budgets as agents (claude-…, chatgpt-… names), merchants of paid calls, and the contact book the bb84 app keeps (Settings → Contacts) — the user's own nicknames, notes, pins, manual entries and kinds. The app shares that book with payment-scope connections on every sync, like its standing orders; the server adds bb84 names, public profiles and the on-chain merchant flag and rebuilds the list at most once a minute. Assistants pass an entry's address or bb84 name (never the nickname) to propose_payment. MCP resource bb84://contacts holds the first 100 entries; REST: GET /api/connect/v1/contacts?query=…&kind=…&limit=….

Directory. The public part of the name service as one queryable list, so an assistant can treat names and profiles as a database (“which merchants are in Berlin?”, “who is called …?”). search_directory returns every named address with its public profile — display name, city, country, avatar; never e-mail, phone, street, postal code or birthdate, and nothing but the flag for a profile its owner set private —, the on-chain merchant flag, AI-budget addresses as agents (claude-…, chatgpt-… names), the website <name>.bb84.com, the payment link, and the first-seen and last-activity day. Filters: query (substring of name, profile name, city, country, address or agent app), kind (person, merchant, agent), city, country, addresses (bulk lookup of up to 100); sort name | newest | active; limit (≤ 100) and offset with nextOffset. The connector adds isOwn for the connection's own addresses and contact (the user's nickname and note) for entries in the shared contact book; addresses deleted on-chain are left out. Everything in it is public already (names, <name>.bb84.com sites, ENS text records), so no scope is needed. The name service builds the list at most once a minute and serves it itself: GET /api/ens/directory?q=…&kind=…&city=…&country=…&addresses=…&sort=…&limit=…&offset=… (public, no token). MCP resource bb84://directory holds the first 100 by name; REST with the connection token: GET /api/connect/v1/directory?query=…&kind=….

Guide. So that an assistant explains bb84 correctly instead of guessing, get_docs returns the user guide How the bb84 wallet works (14 topics from accounts and hash chains to fees, glossary and FAQ; English and German; the same ids in every language), whole or one topic at a time, and the server instructions tell the model to read it before answering how/why/what-if questions about the wallet. MCP resources bb84://docs and bb84://docs/de hold the whole text; public, no token: bb84.com/api/connect/docs/wallet.en.md and wallet.de.md. Live data of a wallet still comes from the other tools; the guide carries no user data.

Events. Nothing is pushed to an assistant; MCP clients such as Claude do not deliver server notifications. Instead list_events (scope transactions) returns everything that happened for the connection since a cursor: transfers with names, name changes (assigned, renamed, released — the name service keeps a public log of these), proposals the user decided, payments from the AI budget. The MCP resource bb84://events holds the last 24 hours. REST: GET /api/connect/v1/events?since=…; the name log itself: POST /api/ens/events {"addresses": […], "since": unix ms}.

AI budget names. When a user opens an AI budget, its address is named after the connected assistant: claude-moon-142.bb84.eth, chatgpt-…, gemini-…, copilot-…, otherwise ai-…. Such names cannot be claimed by anyone; the budget's ENS text records carry the ERC-8004 agent-registration of bb84 and a description that says what the address is, so payments an assistant makes are recognisable on the chain and on ENS. When the budget ends the address gets an ordinary auto-name again.

Names expire with inactivity. A bb84 name is released after 365 days without any activity of its address: no payment from or to it, no balance change, no rename, profile or commitment change. The owner is warned 30 days before (push to the app's devices, a card under the bell, nameExpiresAt in get_account); any use of the address keeps the name. On release the label becomes claimable for everyone again and the address gets a fresh auto-name (unless it was deleted), so apps that still show the old name adopt the new one. resolve_name on a released name says so (releasedInactiveAt), list_events marks such changes with reason: "inactive", and get_account reports nameReleased for 180 days. Names bb84 reserved and AI budget names are not subject to the rule.

Statements and invoices

Cards in the chat (MCP Apps)

Clients that support MCP Apps (for example Claude on the web and desktop) show the result of propose_payment, pay_and_call and propose as a card in the chat: amount or what is proposed, recipient, reference and a live status that changes from “Waiting for confirmation” to “Paid” / “Done”, “Rejected” or “Expired”. The card's button opens the proposal page: “Confirm with passkey” for a connection made with a passkey (the page shows the proposal, Face ID carries it out), “Open in bb84 app” otherwise — the result also says which (confirm: passkey | app), and the pending texts for passkey connections lead with the link instead of the app. The card is the UI resource ui://bb84/payment-card.html (resources/read, MIME type text/html;profile=mcp-app), linked from the tools via _meta.ui.resourceUri. It loads nothing from the network and only calls get_proposal through the client, which counts against the same rate limit. It cannot confirm a payment. That still happens only in the bb84 app. While the proposal is open the card also shows a QR code and an “Open in bb84 app” button for appLink (https://bb84.com/pay/proposal/<id>), which opens exactly this proposal in the app; the wallet also gets a push notification. Clients without MCP Apps ignore it and get the JSON result as before.

A second card, ui://bb84/wallet-card.html, renders get_account (balances: totals and addresses), list_transactions (filter by direction and asset, sums, CSV copy), the AI budget in get_account / pay_from_budget (payments left, receipt) and request_payment (QR code, link, and a status that turns to “Received” once the matching transfer shows up in list_transactions). Data that only the cards need (the QR matrix) is in structuredContent._ui and not in the text content.

A third card, ui://bb84/scan-card.html (tool scan_code), is the scanner: the user takes a photo of a bb84 triangle code (ΔQR) or a QR code, picks a picture, pastes a screenshot or, where the client allows it, points the live camera at it. The card contains the same ΔQR reader as the bb84 app and a QR decoder and reads the code in the browser; nothing is uploaded. It shows what the code means (payment link, shop checkout, proposal link, address, name), passes the content to the assistant as context and offers a button that asks the assistant to propose the payment. Confirming still happens only in the bb84 app.

For users: use bb84 in Claude

  1. In Claude: Settings → Connectors → Add custom connector, URL https://bb84.com/api/connect/mcp, then Connect.
  2. A bb84 page shows an 8-character code. In the bb84 app: Settings → Connectors (Konnektoren), enter the code, check the name and approve. Leave “Propose payments” on if Claude should be able to prepare payments.
  3. Ask Claude, for example: “How much EURC did I spend in October?”, “List my incoming USDC payments this week” or “Propose a payment of 20 EURC to alice for dinner”.
  4. Ask how bb84 works, too: “How does the passkey wallet work?”, “What happens after 1000 payments?”, “Why does a withdrawal take 7 days?”. Claude reads the user guide (tool get_docs, also in German) and answers from it.
  5. Proposed payments appear in the bb84 app (bell → Connectors). Tap Review & send and confirm in the Send tab. Nothing is paid without your confirmation.
  6. To disconnect, tap the connection in the app under Connectors, or remove the connector in Claude.

Problems or questions: info@hadamard.com or a support ticket in the app.

Connect with one click (claude.ai, ChatGPT, …)

Add https://bb84.com/api/connect/mcp as a custom connector. The client discovers everything itself and follows the MCP authorization spec. A browser page shows an 8-character code, the user approves it in the bb84 app, and the page returns to the client.

StepStandardEndpoint
Resource metadataRFC 9728GET /.well-known/oauth-protected-resource/api/connect/mcp (also in the 401 WWW-Authenticate header)
Server metadataRFC 8414GET /.well-known/oauth-authorization-server/api/connect
Client registrationRFC 7591POST /api/connect/oauth/register (public clients, no secret; redirect URIs: https, http on localhost, or a private-use scheme)
AuthorizationRFC 6749 + PKCE (RFC 7636, S256 required)GET /api/connect/oauth/authorize
TokenRFC 6749POST /api/connect/oauth/token, grant_type=authorization_code with code_verifier

Codes are single-use and valid for 5 minutes. Access tokens don't expire, so there is no refresh token. They end when the user disconnects in the app or the client revokes them, or if they are never used within 7 days of approval. In the app, the user sees where the token goes (the redirect host).

Connect a client manually

Alternatively, get an access token with the device flow above (the user approves in the bb84 app), then add the server:

claude mcp add --transport http bb84 https://bb84.com/api/connect/mcp \
  --header "Authorization: Bearer bb84_conn_…"

Other clients (Cursor, VS Code and similar), as mcp.json:

{ "mcpServers": { "bb84": {
    "url": "https://bb84.com/api/connect/mcp",
    "headers": { "Authorization": "Bearer bb84_conn_…" } } } }
🔷
Data shared with an AI assistant is processed by that assistant's provider. Users see every connection under Settings → Connectors in the bb84 app and can revoke it at any time. After that, the token returns HTTP 401.

🤝 Autonomous agents without MCP

The MCP server is the right way for an assistant in a chat: the user's phone or an on-chain capped AI budget holds the keys. An agent that runs on its own machine and can keep a 32-byte secret private and durable does not need it: bb84 accounts are keccak-256 hash chains without signatures, so a complete wallet — create an address, receive, pay, pick a name — fits in one file that talks to public, unauthenticated endpoints.

Public endpoints an agent uses (rate-limited per IP, no key): GET /api/connect/web/chain/<address> (activation, remaining steps, nonce, balances, name, commit key, whether a recipient needs registration), GET /api/connect/web/fees, POST /api/connect/web/send {raw} (relays a 0x7c/0x7f hash transaction; the preimage inside is the authorization), GET /api/connect/web/tx/<hash>, and the name service /api/ens/… (publish a commitment, claim a name, resolve). The chain validates everything; the relay only forwards.

Secrets. The wallet file is the money. Whoever reads it can spend every balance, and nothing can revoke it short of emptying the wallet. An agent without private storage — any assistant inside a chat — must not run these clients and keeps using the MCP server.

⚡ x402 agent payments (bb84-prepaid)

x402 lets APIs and shops ask for payment with HTTP 402 and lets AI agents pay. bb84 accounts are post-quantum hash-chain accounts without ECDSA keys, so they can't sign the standard exact scheme (EIP-3009/Permit2). bb84 therefore uses its own upfront scheme. The payer first sends a normal bb84 payment, confirmed by the user in the app, and then proves it with the transaction hash.

Accept bb84 payments (merchants)

Add this entry to accepts in your 402 response and use the bb84 facilitator:

{
  "scheme": "bb84-prepaid",
  "network": "eip155:42069000",
  "amount": "12500000",
  "asset": "0x50590EE131EdC98a7213c91Ae82e3e8987B9b5eE",
  "payTo": "0xYOUR_BB84_ADDRESS",
  "maxTimeoutSeconds": 3600,
  "extra": { "memo": "x402:<unique-order-id>", "paymentFlow": "upfront" }
}

With the official x402 SDK or with mppx you don't build any of this by hand: see Accept bb84 from AI agents.

Facilitator (x402 v2)Description
GET https://bb84.com/api/x402/supportedSupported scheme and network
POST https://bb84.com/api/x402/verify{paymentPayload, paymentRequirements} → isValid, payer. Reads the chain only
POST https://bb84.com/api/x402/settleSame checks, then binds the transaction to your payTo, asset and memo (one payment unlocks one request) → success, transaction. A repeated settle with the same binding answers success again, any other one transaction_already_used

The facilitator never moves funds. The payment has already happened when it checks: successful transaction, a payment naming payTo as recipient with a token transfer of at least amount to it (Goods & Services payments may arrive minus the fee), your memo on-chain, not used for another request.

How the scheme meets the x402 rules for payment proofs

Rulebb84-prepaid
InstrumentAdvertised in the requirements: payTo, asset, amount and the reference extra.memo. Proof in payload.transaction
Binding to the requestServer-issued reference carried in the payment: the memo is part of the on-chain transaction
Consumption keyeip155:42069000 + transaction hash. settle binds it to payTo, asset and memo under a row lock; another binding gets transaction_already_used
Single deliveryThe facilitator has no merchant login, so the same binding settles again (anyone can read a transaction hash and must not be able to lock you out). Deliver once per reference on your side. The packages below do that for you
Maximum proof age180 days. Older payments are never accepted
FinalityThe transaction receipt with status success on the bb84 chain, checked by the facilitator
AmountLess than amount is refused (insufficient_funds). More is accepted and not returned
If you don't deliverThe protocol returns nothing. Payments made as Goods & Services fall under bb84 buyer protection (6 days)

Pay with bb84 (AI assistants)

The usual way is pay_and_call: bb84 calls the merchant, the user confirms the price, and the merchant's answer comes back. A client that can set HTTP headers or _meta itself can hand pay_and_call the merchant's PaymentRequired instead (paymentRequired: object, JSON or base64 PAYMENT-REQUIRED header); that creates a payment proposal in the bb84 app. After the user confirmed it, get_proposal returns x402.paymentSignature (for the PAYMENT-SIGNATURE header) and x402.paymentPayload (for MCP _meta["x402/payment"]).

🛒 Paid calls: pay_and_call

x402 and MPP carry the payment proof in an HTTP header or in the MCP request's _meta. An AI model can fill neither, it only writes tool arguments. In a chat client the proof therefore never reaches the merchant. pay_and_call makes bb84 the paying client: bb84 calls the merchant itself, turns the payment challenge into a payment proposal, and after the payment repeats the call with the proof and returns the merchant's answer.

  1. The assistant calls pay_and_call with the URL and maxAmount.
  2. bb84 calls the merchant without payment and reads the challenge. If the price is above maxAmount, or the merchant doesn't accept bb84, it stops here and nothing is paid.
  3. bb84 creates a payment proposal. The bb84 app shows the merchant's host name, the amount and the reference. The user confirms it in the normal Send flow.
  4. bb84 repeats the call with the payment proof. get_proposal returns call.state and, once it is delivered, the answer in call.response.

With payFromBudget: true step 3 is paid from the AI budget right away and the answer comes back in the same call (up to about 170 s). An idempotencyKey is required then. A retry with the same key never asks the merchant for a new price and never pays twice.

ArgumentDescription
urlhttps URL of the paid API, or of the MCP server (Streamable HTTP) when mcpTool is given. Public DNS names on port 443 only
maxAmountRequired. The highest price the user agreed to, e.g. "0.50"
method, body, headersGET or POST, a body of up to 8 KB, and the headers Accept, Accept-Language, Content-Type. No credentials can be set: this is for services where the payment replaces the login
mcpTool{"name": "…", "arguments": {…}}: call this tool on the MCP server at url
assetPreferred asset (USDC or EURC) if the merchant offers both
payFromBudget, idempotencyKeyPay from the AI budget instead of asking in the app
ResultMeaning
status: "pending" + idProposal created, nothing paid yet. merchant is the host the challenge came from. Poll get_proposal
call.stateawaiting_payment, awaiting_delivery, delivering, delivered (answer in call.response, receipt in call.receipt) or failed (reason in call.error, proof in call.proof)
no_payment_requiredThe URL answered without asking for payment. Its content is not handed on
not_payableThe merchant asks for payment but not in bb84. merchantAccepts lists what it takes
price_above_maxThe price is higher than maxAmount. Ask the user
offer_too_shortThe merchant holds its offer for less than 4 minutes (AI budget: 2 minutes)
merchant_unreachableHost unknown, not reachable, invalid certificate or an error status

What it understands

ProtocolChallengeProof
x402 over HTTP402 with PAYMENT-REQUIRED (v1: JSON body)PAYMENT-SIGNATURE (v1: X-PAYMENT)
x402 over MCPTool result with isError and the requirements in structuredContent_meta["x402/payment"]
MPP over HTTP402 with WWW-Authenticate: Payment …Authorization: Payment …
MPP over MCPJSON-RPC error -32042 with data.challenges_meta["org.paymentauth/credential"]

Payable are offers for the bb84 chain: x402 scheme bb84-prepaid on eip155:42069000 and MPP method bb84.

Rules

Try it: the demo merchant

bb84 runs a small merchant that sells one sentence for 0.01 USDC or EURC. It asks for payment in every dialect pay_and_call understands.

EndpointAsks for payment with
GET https://bb84.com/api/x402/demo/quotex402 v2 (PAYMENT-REQUIRED) and MPP (WWW-Authenticate: Payment) in the same 402
POST https://bb84.com/api/x402/demo/mcpMCP server. Tool quantum_fact: x402. Tool quantum_fact_mpp: MPP

In Claude with the bb84 connector, for example: “Use pay_and_call to buy a quantum fact from https://bb84.com/api/x402/demo/quote, at most 0.01 USDC.”

🏪 Accept bb84 from AI agents (merchants)

If your API or MCP server already asks for payment with x402 or MPP, bb84 is one more entry. Your server needs no bb84 node and no keys: the public facilitator https://bb84.com/api/x402 checks the payment. You receive USDC or EURC on your bb84 address.

x402 (official SDK)

npm install bb84-x402
import { paymentMiddleware, x402ResourceServer } from "@x402/express";
import { HTTPFacilitatorClient } from "@x402/core/server";
import { Bb84PrepaidScheme, BB84_NETWORK, BB84_FACILITATOR_URL } from "bb84-x402";

const server = new x402ResourceServer(new HTTPFacilitatorClient({ url: BB84_FACILITATOR_URL }))
  .register(BB84_NETWORK, new Bb84PrepaidScheme({ secret: process.env.BB84_X402_SECRET }));

app.use(paymentMiddleware({
  "GET /weather": {
    accepts: [{ scheme: "bb84-prepaid", network: BB84_NETWORK, price: "$0.02",
                payTo: "0xYOUR_BB84_ADDRESS", maxTimeoutSeconds: 86400 }],
    description: "Weather report",
  },
}, server));

The scheme puts a fresh, signed reference into every 402, checks that a presented payment carries one of its own references, and delivers each payment once. Prices: "$0.02" (USDC), "€0.02" or "0.02 EURC". You can list bb84 next to your other networks in the same accepts.

MPP (mppx)

npm install bb84-mppx
import { Mppx } from "mppx/express";
import { charge, baseUnits } from "bb84-mppx";

const mppx = Mppx.create({
  methods: [charge({ recipient: "0xYOUR_BB84_ADDRESS", currency: "USDC" })],
  secretKey: process.env.MPP_SECRET_KEY,
});

app.get("/weather",
  (req, res, next) => mppx.bb84.charge({ amount: baseUnits("0.02"),
    expires: new Date(Date.now() + 3600_000).toISOString() })(req, res, next),
  (req, res) => res.json({ report: "sunny" }));

Set expires: the mppx default of 5 minutes is short for a confirmation on a phone.

MPP method bb84

The method follows the push mode of other chains: the payer broadcasts the payment and presents the transaction hash.

PartContent
Challengemethod="bb84", intent="charge"
requestamount (base units, string), currency (token address on the bb84 chain, or USDC / EURC), recipient (0x address), optional methodDetails.chainId (42069000) and methodDetails.memo
PaymentA token transfer of amount to recipient on eip155:42069000 whose memo is methodDetails.memo or, without it, mpp:<challenge id>. The challenge id is protected by the server's HMAC, so a payment made for one challenge fits no other
Credential payload{"type": "hash", "hash": "0x…"}
VerificationPOST https://bb84.com/api/x402/settle with requirements {scheme: "bb84-prepaid", network: "eip155:42069000", amount, asset: currency, payTo: recipient, extra: {memo}} and payload: {transaction: hash}
Receiptmethod: "bb84", reference: the transaction hash

Shops with a bb84 checkout (WooCommerce, Shopify, payment links)

Nothing to change. After an order your shop shows its bb84 payment link. The buyer can hand that link to an assistant, which calls propose_payment with payLink. The buyer confirms in the app, and your shop sees the payment by its reference as usual.

Without an SDK

Answer 402 with the requirements above in a base64 PAYMENT-REQUIRED header, and on the retry call settle before you deliver. The demo merchant shows every header.

🔒 AI budget & identity verification

Give your AI a budget it physically cannot exceed. bb84 accounts spend with one-time hash keys from a hash chain. In the app (Settings → Connectors → tap a connection → AI budget) the user creates a separate budget address with its own hash chain, funds it and hands bb84 exactly one value: the chain element N steps below the top. Hashing forward from it yields exactly N one-time keys. Going back would mean inverting keccak, and the chain can only be renewed with element 0, which never leaves the phone. So the assistant can make at most N payments and never spend more than the address holds. The chain enforces this, not a server policy. Topping up adds money, not payments.

MCP tool / endpointDescription
get_account → budget · GET /api/connect/v1/budgetBudget address and its name (claude-…bb84.eth, see AI budget names), balances, paymentsLeft/paymentsTotal, payments so far. null until the user set up a budget for this connection
pay_from_budget · POST /api/connect/v1/budget/payments{to, amount, asset, note?, goodsAndServices?, idempotencyKey?} → pays immediately, no confirmation in the app → status, txHash, paymentsLeft. Merchants are paid as Goods & Services. The recipient must be a merchant or an activated address

Timeouts and retries: a budget payment waits for two chain confirmations and can take up to about 160 s. Let your HTTP or MCP client wait at least 180 s. An MCP batch may contain at most one pay_from_budget call. Send a new idempotencyKey for every payment (1–255 printable ASCII characters without spaces, e.g. a UUID; for REST also accepted as Idempotency-Key header). If you retry after a timeout or connection error, reuse the same key with the same payment data: bb84 pays at most once per key and budget and returns the original result with idempotentReplay: true (kept 24 h). While the first call is still running, a retry gets 409. The same key with different payment data gets 422. Errors where nothing was sent (e.g. 400, 409, 504 "Commit not confirmed") are not stored, so a retry with the same key tries again. Without a key, a retry after a successful payment pays a second time.

bb84 keeps the delegated value encrypted (AES-GCM) and deletes it when the user ends the budget or disconnects. The user can reclaim the rest at any time. Even if the server were compromised, only the budget addresses would be at risk, never the user's other accounts.

Identity verification

With the Verify identity switch, the app signs an attestation bound to the connection for each address. It uses the address's proof key anchored on-chain. get_account / GET /v1/account then return ownership.verified, verifiedAddresses and the signed proofs (message, EIP-191 signature, proof key, anchor tx). Anyone can re-check them via POST /api/connect/proof-keys/verify. A revoked or rotated proof key drops out at once.

🔏 OTA proof keys

bb84 OTAs are hash-based (post-quantum) accounts with no ECDSA key. To prove ownership off-chain, the wallet derives a proof key (secp256k1) per OTA and anchors it on-chain once: a successful self-send from the OTA whose input is 0x626238342d70726f6f666b65792d76313a ("bb84-proofkey-v1:") followed by the 20-byte key address. Only the OTA owner can send that transaction. The proof key can only sign proofs. It cannot authorize payments, because the chain rejects ECDSA transactions.

The wallet signs with a proof key only for its own purposes: approving a connection, the identity attestation above and the passkey web wallet. There is no WalletConnect pairing and no proof a user shares by hand; the signed attestations reach you through get_account / GET /v1/account. Important: plain ecrecover returns the proof key, not the OTA address, so verify with the endpoint below or check the anchor tx yourself.

Verify a signature

curl -X POST https://bb84.com/api/connect/proof-keys/verify \
  -H "Content-Type: application/json" \
  -d '{"address":"0xOTA…","message":"Sign-in nonce 8f3a…","signature":"0x…"}'
# → {"valid":true,"address":"0xota…","signer":"0x…","proofKey":"0x…","anchorTx":"0x…"}
Method & PathDescription
POST /api/connect/proof-keys/verify{address, signature, message} (EIP-191; a 0x-hex message is treated as raw bytes, as in personal_sign) or {address, signature, typedData} (EIP-712). valid is true only if the signer is the currently anchored proof key of address.
GET /api/connect/proof-keys/<address>Current proof key + anchor tx, or 404 if none is anchored.
POST /api/connect/proof-keys/anchor{address, txHash}: registers an anchor tx (anyone may submit, because the tx proves itself). A newer anchor replaces an older one. A key of 20 zero bytes revokes it.
🔷
Each attestation carries the connection and an issue time, so it cannot be replayed for another connection. Trustless check: fetch the anchor tx from https://bb84.com/rpc and confirm from == to == address, the input and a successful receipt. Only the endpoint knows about later revocations.
FAQ
Common questions about wallet connectors.
Is this free?+
Yes. BB84 is experimental software — connectors are free, rate-limited to 60 requests/minute per access token.
Where are the old API keys?+
The key-based /v1 chain-data API has been retired. User data is available through connectors; public chain data through JSON-RPC (see below).
I use the older /requests flow. Does it still work?+
Yes. POST /api/connect/requests and GET /api/connect/requests/<requestId>/status (with pollToken) keep working, but they are deprecated: responses carry a Deprecation header. Access tokens from both flows are identical. Please move to the OAuth endpoints above.
Need public chain data?+
Blocks and transactions are public in the explorer. The JSON-RPC endpoint https://bb84.com/rpc requires an X-Onyx-Key header (requests without it get HTTP 403), see the docs. To request access or for custom needs, reach out via the support button.