Every payment deserves a private conversation.
Parley attaches an end-to-end-encrypted thread to an invoice, a transaction or a PayBox request. Only the two wallets involved can read it, and the conversation can end in the payment itself: ask, agree, pay, prove.
▶ 55-second demo video · 📜 Contract 0xDc28…3306 on Base and Base Sepolia
This repository is a reference implementation (contracts, PayBox plugin and web inbox source). The hosted relay and demo site are not part of it.
Money moves in seconds now, but talking about that money still happens somewhere else: email, WhatsApp, a support form. A shop that takes a crypto payment has a wallet address and a tx hash, and no way to reach the buyer. An AI agent that pays a vendor has nowhere private to explain, negotiate or show a receipt. Every payment already has an id both sides know (an invoice number, a pay link, a tx hash). Parley gives that id a private place to talk.
- Encrypted threads keyed to a shared id. Both wallets derive the same room from the invoice or tx id and find each other with no server and no sign-up. The invoice id itself is inside the ciphertext, so the chain never learns which invoice is discussed.
- Payment inside the thread. A payment-request card arrives in the conversation, is paid from it, and the sender posts a sealed receipt that the other side verifies on-chain, turning the card to PAID.
- Wallet-authored, gasless-capable. Signed EIP-712 / ERC-1271 actions let a relay pay gas while the wallet stays the on-chain author.
- Two ways in, here: a PayBox plugin for agents, and a static web inbox (
plugin/viewer) for people.
| Payment request in the thread | Verified and marked PAID |
|---|---|
![]() |
![]() |
A TypeScript MCP server with 9 tools. Each returns read-only data or exactly one io.paybox/transactionProposal; the plugin holds no keys and never signs.
| Tool | Kind | Purpose |
|---|---|---|
resolve_room |
read | shared id (invoice, tx, URL) → conversation id and panel link |
inbox_status |
read | can this wallet receive sealed messages |
plan_message |
read | which chain, direct or relay, or what setup is missing |
read_room |
read | public messages; metadata only for sealed threads |
register_key |
proposal | one-time messaging key for a PayBox wallet |
send_sealed |
proposal | encrypted message, optional sealed receipt |
payment_request |
proposal | encrypted payment card |
propose_payment_from_thread |
proposal | card → USDC transfer (refuses the zero address and > 10,000 USDC) |
post_public |
proposal | public note on a tx, invoice or service room |
Requires Node 24 and pnpm 11.11.0 for the plugin, and Foundry for the contracts.
# Plugin: typecheck, deterministic build to dist/plugin.mjs, PayBox conformance
cd plugin
pnpm install --frozen-lockfile
pnpm test
# Web inbox (static): builds viewer/dist
pnpm run viewer:build
# Contracts
cd ../chain
forge install foundry-rs/forge-std OpenZeppelin/openzeppelin-contracts
forge test # 48 testsOptional plugin overrides are in plugin/.env.example; none are secrets. To host the inbox, serve plugin/viewer/dist and set PARLEY_PANEL_URL for the plugin. Without a relay (relay in plugin/viewer/config.json), the inbox runs in self-pay mode: the user's own wallet pays the small message fee.
| Content | X25519 key wrap per device + XChaCha20-Poly1305; AAD binds chain, contract, conversation and device; padded to size buckets |
| Authorship | the wallet is the on-chain author even when a relay pays |
| Replays | per-signer nonce, deadline, chain id and contract bound into every signed action |
| Money | the plugin only proposes; the wallet shows and approves the real transfer |
Limits (MVP): who talks to whom, and when, is public on-chain (the content is not); there is no per-message forward secrecy yet; the contracts have not had an external audit. Do not use for anything sensitive yet.
Solidity 0.8 + Foundry (upgradeable ChatProtocol v1.3.0, OpenZeppelin) · TypeScript · MCP server for PayBox · viem · @noble/curves, ciphers, hashes · static web inbox (esbuild) · Base and Base Sepolia.
| Folder | What |
|---|---|
chain/ |
Foundry project: contracts, tests, deploy scripts, deployment records |
plugin/ |
PayBox plugin (src/), web inbox (viewer/), build and conformance scripts, local end-to-end test (dev/) |
docs/media/ |
screenshots and demo video |
Built for the MoonPay PayBox Hackathon (Chapter 1). AI assistance was used to write code for logic designed by the author.
GNU Affero General Public License v3.0 (see LICENSE). If you run a modified version as a network service, you must publish your source under the same license.


