Browser app, guided demo, TypeScript protocol core and MCP server for proxy-shopping (P2P proxy shopping with a 2-of-3 escrow)
proxy-shopping-web
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
**Buy from cash-only shops with crypto, or earn as a proxy shopper: the browser app, guided demo, TypeScript protocol library and MCP server of proxy-shopping, a P2P network where a local shopper buys for remote users who pay through a 2-of-3 escrow with timelocks.** Agents: MCP server io.github.pad01g/proxy-shopping (packages/mcp), skills npx skills add pad01g/proxy-shopping-go, AGENTS.md; overview for machines: https://pad01g.github.io/proxy-shopping-docs/llms.txt.
Documentation in 14 languages: https://pad01g.github.io/proxy-shopping-docs/
Browser side of proxy-shopping (spec: ../proxy-shopping-go/docs/spec.md, lab: docs/lab.md there).
Host tools are not required; everything runs in docker.
Mounting ../proxy-shopping-go read-only lets the unit tests check docs/test-vectors.json
and lab/keys/public.json. Without the vectors file npm test fails, so CI cannot pass silently;
set SKIP_VECTORS=1 to run the other tests without it.
apps/demo
**Try it in your browser: https://pad01g.github.io/proxy-shopping-web/ (everything simulated in the page).** That build
runs in *mock mode* (?mock=1, header switch モック / Mock): the relays, the BTC chain (with script checks), a real EVM
with the lab's Safe and escrow-module bytecode, the faucet, the rates, the shops and the shopper-1 node run inside the
browser (a SharedWorker shared by all windows), while the four roles use core's real clients. Details, what is simulated
and its limits: apps/demo/README.md. The mock e2e (all scenarios, English, separate windows, no
request leaving the page): scripts/e2e-demo-mock.sh; Pages is deployed by .github/workflows/pages-demo.yaml.
The integrated demo for the docker compose lab (../proxy-shopping-go, compose service demo, http://localhost:8888/;
usage in ../proxy-shopping-go/docs/lab.md「デモ画面」). User, escrow, operator and coordinator each have their own key
(localStorage, lab only) and their own Session + client in the page; the shopper is the lab's Go node. A guide walks
through seven scenarios (normal BTC / USDC, dispute refund, sold out, risky shop, fraudulent escrow, T2 refund);
?role=user / ?role=escrow,operator,coordinator runs only those roles in a window. The page is in Japanese or English
(header switch 日本語 / English, kept in localStorage; ?lang=en|ja overrides it): one message catalog per language in
apps/demo/src/i18n (ja.ts defines the keys, en.ts must match them), core's timeline lines are rendered from their kind.
Protocol logic is core's
(UserClient, EscrowClient, OperatorClient, CoordinatorClient); the page wires them over core's MappedTransport (logical relay
URLs such as wss://relay-1.test stay protocol-visible, the connection goes to the demo server's /relay-1).
Scenario steps are data (apps/demo/src/scenarios); test ids in apps/demo/TESTIDS.md; the e2e that follows the guide is
../proxy-shopping-go/e2e/src/demo (docker compose run --rm runner demo).
@proxy-shopping/core
Entry points: @proxy-shopping/core (portable), /node (+ FileStorage), /browser
(+ IndexedDBStorage), /testing (in-memory relays/chain, scripted shopper, createWorld),
/testing/node (bitcoind RPC + Esplora shim). Build output with declarations is in dist/.
| area | main exports |
|---|---|
| keys | KeySet.fromMnemonic (nostr, order keys, escrow tpub, P2WPKH wallet, EVM), orderIndex, escrowPubkeyFromXpub, generateMnemonic, LocalSigner, Nip07Signer |
| nostr | signInner, giftWrap, unwrap, isValidInner, Messenger (k relays, ack, retry, dedupe, persisted), PoolTransport, MappedTransport, message body types, MSG |