|
| 1 | +# Convex Context for Claude |
| 2 | + |
| 3 | +When using tools from the Convex plugin (anything namespaced `convex-testnet:*` or `convex-local:*`), keep the conventions below. |
| 4 | + |
| 5 | +## Terminology |
| 6 | + |
| 7 | +Use Convex terms, not blockchain analogues, in generated code, comments, and explanations. |
| 8 | + |
| 9 | +| Use this | Not this | |
| 10 | +| ------------ | ------------------------------ | |
| 11 | +| CVM coin | CVX | |
| 12 | +| Juice | Gas, fees | |
| 13 | +| Copper | Wei, satoshi | |
| 14 | +| Peer | Miner, validator | |
| 15 | +| Actor | Smart contract | |
| 16 | +| Lattice | Blockchain, chain | |
| 17 | +| CPoS | Proof of Work, Proof of Stake | |
| 18 | +| Belief | Block | |
| 19 | +| Etch | _(core embedded database)_ | |
| 20 | +| CAD | Specification / whitepaper | |
| 21 | +| CNS | DNS, ENS | |
| 22 | +| Protonet | Mainnet | |
| 23 | + |
| 24 | +`1 CVM = 1,000,000,000 copper`. Balances returned by `getBalance` are in copper; convert for display. |
| 25 | + |
| 26 | +## Language |
| 27 | + |
| 28 | +British English spelling throughout (decentralised, organisation, behaviour, colour). |
| 29 | + |
| 30 | +## Architecture reminders |
| 31 | + |
| 32 | +- Convex is **not** a blockchain. It uses CRDT-like convergent data structures and reaches consensus via Convergent Proof of Stake. |
| 33 | +- All core data is **immutable and content-addressable** (the `ACell` hierarchy in `convex-core`). |
| 34 | +- The CVM is a **lambda-calculus VM** running Convex Lisp. Transactions are pure functions that update state. |
| 35 | +- Finality is **millisecond-scale**; there is no mining. |
| 36 | + |
| 37 | +## Tool selection hints |
| 38 | + |
| 39 | +- **Queries are free.** Prefer `query` or `queryState` over `transact` when reading data. |
| 40 | +- **`transact` transmits the Ed25519 seed.** Only use against HTTPS peers. For production keys, client side signing is best. If not possible, prefer the signing-service tools (`signingTransact`, `signingSign`) which keep keys server-side. |
| 41 | +- **`prepare` + `submit`** is the two-step flow for external signing (hardware wallets, client-side keys). |
| 42 | +- **`transfer`** is a convenience for coin/token transfers — use it instead of hand-rolling `transact` with `(transfer ...)` source. |
| 43 | +- **`watchState`** uses SSE notifications; remember to `unwatchState` when done to free server-side resources. |
| 44 | +- **Elevated signing operations** (`signingImportKey`, `signingExportKey`, `signingDeleteKey`, `signingChangePassphrase`) require a two-step browser confirmation and will return a URL the user must open. |
| 45 | + |
| 46 | +## Two servers are configured |
| 47 | + |
| 48 | +- `convex-testnet` — defaults to the public HuggingFace testnet. Good for exploration and throwaway accounts. |
| 49 | +- `convex-local` — defaults to `http://localhost:8080/mcp`. Use when developing against a locally-run peer. |
| 50 | + |
| 51 | +If both are active, be explicit about which you're targeting. Ask before transacting against the testnet. |
| 52 | + |
| 53 | +## Resources |
| 54 | + |
| 55 | +- [Convex docs](https://docs.convex.world) |
| 56 | +- [CAD041 (MCP)](https://docs.convex.world/docs/cad/041_mcp) |
| 57 | +- [Convex Lisp tutorial](https://docs.convex.world/docs/tutorial) |
0 commit comments