# Architecture
Source: https://docs.usecarry.xyz/architecture
How Carry enforces access before generation, proves every answer, and lets anyone verify it.
Carry is built around one non-negotiable rule: **gate before generation.** Enforce the agent × namespace policy at *retrieval* — the model only ever sees allowed memory — so the receipt under every answer is honest by construction.
## The big picture
```mermaid theme={null}
flowchart LR
U([User]) --> A[Agent A · GPT-4o]
U --> B[Agent B · Claude]
A --> G{Retrieval gate
agent x namespace}
B --> G
G -->|allowed only| M[(Walrus memory blobs)]
G -.->|blocked: never fetched| X[blocked]
M --> V[verify each blob
resolves on Walrus]
V --> L[LLM answer]
L --> R[["Answer Receipt
used · authorized · verified · blocked"]]
R --> AN[(Anchor on Sui
tamper-evident Proof)]
AN --> VR[Public verifier
no wallet]
```
## Three layers
A typed access policy — which agent can read which namespace — enforced at retrieval, before the model is called.
Every memory is a real content-addressed blob on Walrus, optionally encrypted through Seal + MemWal.
The policy and a tamper-evident receipt chain live on Sui — the verdict is computed on-chain, not asserted by the app.
## Typed contracts
The system is designed around a few typed contracts in `@carry/core` — get the boundaries right and the rest composes.
| Contract | Role |
| --------------- | ------------------------------------------------------------------------------------------------------------------------ |
| `Memory` | A stored fact: `namespace`, `content`, `sourceAgent`, `walrusRef` (the real blob ID), `createdAt`. |
| `Policy` | `agent → namespace → boolean`. The single source of truth the gate reads before every recall. |
| `AnswerReceipt` | The product surface: `usedMemories` (each with `authorized` + `verified` + `walrusRef`), `blockedNamespaces`, `agentId`. |
## The recall loop, step by step
This is what `POST /api/chat` does — and every step assumes the model might be wrong about what it's allowed to see.
An agent receives a query.
`recall(agentId, query, memories, policy)` returns only the memories in namespaces this agent is allowed to read, plus the namespaces that matched the query *but were blocked by policy*. Blocked content is never loaded into the prompt. The on-chain `AccessPolicy` is the authoritative allow/deny — recomputed on anchor and re-checkable by anyone via `devInspect`.
Each allowed memory's Walrus blob is re-checked against the aggregator (`GET /v1/blobs/{id}`). "Verified" means the blob genuinely resolves on-chain — it is **not** a flag set by the app.
The gated memories (and only those) are passed to the agent's model. With no allowed memory, the agent truthfully says it can't access what it needs.
`buildReceipt(...)` assembles the Answer Receipt: used memories with authorization + verification status, the blocked namespaces, and the source agent.
The receipt is stored to Walrus and anchored on Sui as a `Receipt` object — chained by blake2b256 — for tamper-evident provenance.
## The contrast that sells it
Revoke `agent-b × health`, ask the allergy question again, and the gate returns **zero memories** plus `blocked: ["health"]`. The model never sees the health memory, the answer is an honest refusal, and the receipt proves the block.
Because the gate runs server-side **before** `getLLM().complete(...)`, there is no code path where a disallowed memory reaches the model — even by accident.
## Cross-model by design
Agent A runs on **OpenAI GPT-4o**, Agent B on **Anthropic Claude**. Both share the same gated memory and the same proof format. The proof travels with the answer, not the vendor — which is what makes "memory you can trust" portable across providers.
# Answer Receipts
Source: https://docs.usecarry.xyz/concepts/answer-receipts
Every memory-based answer ships a verifiable receipt: what it used, whether it was authorized, and whether the blob still resolves.
An **Answer Receipt** is the product surface of Carry — the thing rendered under every answer that turns "the agent remembered" into something you can inspect.
## The contract
```ts theme={null}
type UsedMemory = {
memoryId: string;
namespace: NamespaceId;
snippet: string;
sourceAgent: AgentId;
walrusRef: string;
authorized: boolean; // allowed by policy at retrieval
verified: boolean; // blob genuinely resolves on Walrus (a live check)
};
type AnswerReceipt = {
answerId: string;
agentId: AgentId;
usedMemories: UsedMemory[];
blockedNamespaces: NamespaceId[];
createdAt: string;
};
```
## What each field proves
The exact facts the answer drew on — each with its namespace, source agent, and real `walrusRef`.
The memory was allowed by the policy at retrieval. Because the gate runs first, an unauthorized memory could never appear here.
A live `GET /v1/blobs/{id}` against the Walrus aggregator confirmed the blob resolves — not a flag the app sets.
Namespaces that matched the query but were denied — the proof of what the agent was *not* allowed to use.
## How it's built
```ts theme={null}
// packages/carry-core/src/receipt.ts
export function buildReceipt({ agentId, answerId, used, blockedNamespaces, verifiedRefs, createdAt }) {
return {
answerId, agentId,
usedMemories: used.map((m) => ({
memoryId: m.memoryId, namespace: m.namespace, snippet: m.content,
sourceAgent: m.sourceAgent, walrusRef: m.walrusRef,
authorized: true, // only allowed memory reaches here
verified: verifiedRefs.has(m.walrusRef), // live Walrus check
})),
blockedNamespaces, createdAt,
};
}
```
The receipt is honest **by construction**: `authorized` is always true for entries in `usedMemories` precisely because the gate already removed anything unauthorized — and `verified` reflects a real network check, not an assertion.
## From receipt to permanent proof
A receipt lives in the app as JSON. But any receipt can be promoted to a tamper-evident, on-chain **Proof** object: it's stored to Walrus, hashed, and anchored on Sui where the chain recomputes the authorization verdict. See [Proofs on Sui](/concepts/proofs-on-sui).
# Memory & namespaces
Source: https://docs.usecarry.xyz/concepts/memory-and-namespaces
How Carry stores facts as content-addressed Walrus blobs, organized into typed namespaces.
A **memory** in Carry is a single fact an agent has learned, stored as a real, content-addressed blob on Walrus and tagged with a typed **namespace**.
## The Memory contract
```ts theme={null}
type Memory = {
memoryId: string; // local id
namespace: NamespaceId; // "diet" | "health" | "project" | "billing"
content: string; // the fact itself
sourceAgent: AgentId; // who taught it
walrusRef: string; // the REAL Walrus blob id
createdAt: string;
};
```
The `walrusRef` is the heart of it: it's the actual blob id returned by Walrus when the fact is stored, not a placeholder. Anyone can resolve it on a Walrus aggregator and confirm the content exists.
## Namespaces
Namespaces are the unit of access control. Instead of "can this agent read memory?" Carry asks "can this agent read the **health** namespace?". The default set:
Food preferences, restrictions.
Sensitive medical facts.
Work and project context.
Payment and account details.
Namespaces make the policy legible: a person can look at an agent × namespace grid and understand exactly what each agent can touch.
## Teaching a memory
When Agent A captures a fact, Carry writes it to Walrus and keeps the returned blob id as the memory's reference:
```ts theme={null}
// apps/web/lib/store.ts (simplified)
const { blobId } = await walrus.store(
{ namespace, content, sourceAgent, createdAt },
MEMORY_EPOCHS,
);
const memory = { memoryId, walrusRef: blobId, namespace, content, sourceAgent, createdAt };
```
In **MemWal mode**, the write instead routes through the MemWal relayer, which Seal-encrypts the content server-side before it lands on Walrus — so the memory is private, addressed by a real blob but readable only through the relayer. See [Seal & MemWal](/stack/seal-memwal).
## Why content-addressing matters
Because each memory is addressed by the hash of its content, a memory can't be silently swapped. The Answer Receipt records the `walrusRef` of every memory used, and the verifier re-resolves it — so "the agent used this exact fact" becomes something you can check, not something you assume.
The three seed memories in the demo aren't fixtures — they're real Walrus testnet blobs uploaded once with `apps/web/scripts/seed-walrus.mjs`. You can resolve them on any testnet aggregator.
# Proofs on Sui
Source: https://docs.usecarry.xyz/concepts/proofs-on-sui
Anchoring an answer as a tamper-evident Receipt object that the chain itself verifies — no wallet.
A receipt rendered in the app is useful — but a skeptic can say *"you computed it, you stored it, you declared it authorized."* Carry closes that gap by moving the proof **on-chain**.
## What anchoring does
When you anchor an answer, Carry:
The canonical receipt JSON becomes a real Walrus blob (`POST /api/anchor` returns the `blobId` and a `digestHex`).
A transaction — signed server-side via the Sui CLI keystore, no user wallet — calls `anchor_receipt(...)`, which creates an owned `Receipt` object and links it into a per-policy hash chain.
The contract re-checks `is_allowed` for every used namespace and sets `all_authorized` itself — the app cannot lie about it.
## Why an object, not just an event
The earlier design merely emitted an event. A persistent `Receipt` **object** is stronger:
Anyone can `getObject(id)` and read the proof directly — no log scraping.
The Proof is transferred to the signer. It's an asset you hold, with `Display` metadata so explorers render it as a "Carry Proof".
Each receipt links to the previous via a blake2b256 hash chain — you can't quietly delete or reorder a bad answer.
The verdict is the chain's, recomputed against the live policy — not the app's claim.
## The Receipt object
```move theme={null}
public struct Receipt has key, store {
id: UID,
policy: ID,
seq: u64,
answer_id: String,
agent: String,
used_namespaces: vector,
blocked_namespaces: vector,
all_authorized: bool,
digest: vector, // blake2b256 of the Walrus receipt blob (content binding)
prev_digest: vector, // chain head before this receipt
chain_digest: vector, // blake2b256(prev_digest ++ digest)
walrus_blob: String,
timestamp_ms: u64,
}
```
## Three things a proof binds together
A Carry Proof is only meaningful because it ties three independent systems together:
1. **Content** — `digest` is the hash of the exact Walrus blob, so the Proof points to specific memory/answer content.
2. **Order** — `chain_digest` links each receipt to its predecessor, making the history tamper-evident.
3. **Authority** — `all_authorized` is recomputed on-chain from the live policy.
Anyone can check all three with **no wallet**. See [The verifier](/onchain/verifier) and [The hash chain](/onchain/hash-chain).
# The gate
Source: https://docs.usecarry.xyz/concepts/the-gate
Access control enforced at retrieval — the model physically never sees memory it isn't allowed to use.
The **gate** is Carry's core security primitive. It enforces an agent × namespace policy at *retrieval time*, before the model is ever called.
## Gate before generation
The single design rule: **gate before generation.** If access were checked *after* retrieval (or after generation), a blocked memory would already be in the prompt — and "the agent shouldn't have used that" becomes an apology, not a guarantee.
## The policy
A `Policy` maps each agent and namespace to a boolean:
```ts theme={null}
type Policy = Record>;
```
The policy is **default-deny** everywhere — in process and on-chain. `is_allowed` returns `true` only where an agent was explicitly granted a namespace, so an agent nobody configured inherits nothing. The gate consults one source of truth before every recall, and on the hosted gateway that source is the policy object on Sui itself.
## How recall gates
```ts theme={null}
// packages/carry-core/src/gate.ts
export function recall(agent, query, all, policy): RecallResult {
const relevant = all.filter((m) => matches(m.content, query));
const memories = relevant.filter((m) => isAllowed(agent, m.namespace, policy));
const blockedNamespaces = Array.from(new Set(
relevant.filter((m) => !isAllowed(agent, m.namespace, policy)).map((m) => m.namespace)
));
return { memories, blockedNamespaces };
}
```
The function returns two things:
* `memories` — only the allowed, query-matching memories. These are the **only** memories passed to the LLM.
* `blockedNamespaces` — namespaces that matched the query but were denied. These are surfaced on the receipt, never loaded into the prompt.
This logic is pure, framework-free, and unit-tested.
## The chain is the source of truth for the verdict
The per-answer gate runs in `@carry/core` for speed. But the **authoritative** allow/deny lives in the on-chain `AccessPolicy`: `anchor_receipt` recomputes the verdict against it, and the [walletless verifier](/onchain/verifier) reads it back with the same `is_allowed`, via `devInspect` — no signing, no gas, fail-closed:
```ts theme={null}
// apps/web/lib/sui.ts (simplified)
export async function readIsAllowed(agent, namespace, policyId) {
const tx = new Transaction();
tx.moveCall({ target: `${PKG}::access::is_allowed`,
arguments: [tx.object(policyId), tx.pure.string(agent), tx.pure.string(namespace)] });
const res = await suiClient.devInspectTransactionBlock({ transactionBlock: tx, sender: ZERO });
const ret = res.results?.[0]?.returnValues?.[0];
if (!ret) return false; // fail-closed: deny if the policy can't be read
return bcs.Bool.parse(Uint8Array.from(ret[0])) === true;
}
```
`readIsAllowed` **fails closed**: if the on-chain policy can't be read (RPC error), the namespace is treated as **not** allowed. For an access gate, denying on uncertainty is the safe default.
`devInspectTransactionBlock` is a read-only simulation — no gas, no signing — so anyone can recompute the verdict against the live policy without trusting Carry.
## Revocation is a real state change
Revoking `agent-b × health` flips a boolean on the shared `AccessPolicy` object (a Sui transaction signed by the policy owner). The next recall reads the new state and returns zero memories for that namespace. There is no cache to invalidate and no prompt to scrub — the memory is simply never fetched.
# Carry
Source: https://docs.usecarry.xyz/index
Proof-carrying memory for AI agents — control what every agent can use, and prove it on every answer.
**Carry is a memory layer for AI agents where every answer carries its proof.**
Most AI-memory projects answer one question: *can an agent remember across sessions?* Carry answers the harder one — **can you prove what an agent used to answer you, and stop it from touching memory it was never allowed to?**
Carry is **live on Sui mainnet**: the gate is a deployed Move package, and every proof is an object anyone can verify with no wallet.
Every memory-based answer renders a verifiable **Answer Receipt** — the memories it used, whether each was authorized, whether the blob still resolves on Walrus, and the namespaces it was blocked from. The access policy is enforced at *retrieval*, so the model **physically never sees** memory it isn't allowed to use. And each answer can be anchored on **Sui** as a tamper-evident **Proof** object that anyone can verify — with no wallet.
The real app driven live — GPT-4o + Claude, Walrus testnet, on-chain proof.
Zero to a running, live Carry in a few minutes.
The gate-before-generation architecture, end to end.
The walletless public verifier — don't trust Carry, verify it.
## The problem
AI agents are getting persistent memory, and that's the easy half. The hard half is **trust**. When an agent answers "from memory," you have no way to know *which* memory it used, whether it was *allowed* to use it, or whether that memory even exists where it claims. Memory is locked to one app or model, it doesn't travel when you switch providers, and "the agent remembered" is something you take on faith.
That faith is the problem. An agent with access to a user's health, billing, and project memory — across multiple models — is one bad retrieval away from leaking something it should never have seen.
## The design rule
**Gate before generation.** The agent × namespace policy is enforced at *retrieval* — the model only ever sees allowed memory — so the receipt under every answer is honest by construction, not a label slapped on after the fact.
## What you get
Teach with one model (GPT-4o), recall with another (Claude). The memory — and its proof — travel with the answer, not the vendor.
Every answer ships an Answer Receipt: memories used, authorization, and a live Walrus blob check.
Anchor any answer as a tamper-evident `Receipt` object on Sui — chained by blake2b256, ownable, permanent.
An MCP server gives Cursor, Claude Desktop, and Claude Code the same gated, receipted memory.
## Built on the Sui Stack
Carry is built end-to-end on the Sui Stack — every capability is wired through the real platform, not faked.
| Layer | Role |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **Sui** | The access policy and a tamper-evident receipt chain live on-chain; the authorization verdict is computed by the chain. |
| **Walrus** | Every memory is a real, content-addressed blob — publicly resolvable and independently verifiable. |
| **Seal + MemWal** | Optional server-side encryption: memories become private, addressed by a real Walrus blob but readable only through the relayer. |
## One vault, every surface
The same gated memory and the same Answer Receipt, everywhere an agent lives:
A consumer health companion that only remembers what you allow — and proves it live.
`npx @usecarry/cli` — recall with a receipt, anchor a verifiable proof, from your terminal.
`npx @usecarry/mcp` — gated, receipted memory in Cursor, Claude Desktop, Claude Code.
`withCarryMemory(model)` — proof-carrying memory in any AI SDK agent, one line.
Built on **Walrus · Seal · Sui** for **Sui Overflow 2026** (Walrus track).
# API reference
Source: https://docs.usecarry.xyz/integrate/api-reference
The Carry web app's HTTP routes — gated chat, the companion, capture, policy, and anchoring.
The Next.js app exposes a small set of routes under `/api`. The gate runs server-side in these handlers, in `@carry/core`, before any model is called.
## POST /api/chat
Gate, generate, and return an answer with its receipt (Chat A / Chat B).
```jsonc theme={null}
// request
{ "agentId": "agent-b", "query": "Am I allergic to anything?" }
```
```jsonc theme={null}
// response
{
"answer": "You're allergic to penicillin.",
"receipt": {
"answerId": "ans-…",
"agentId": "agent-b",
"usedMemories": [
{ "namespace": "health", "snippet": "Allergic to penicillin",
"walrusRef": "oHJR…", "authorized": true, "verified": true }
],
"blockedNamespaces": [],
"createdAt": "2026-…"
}
}
```
The gate runs before the model: `recall(agentId, query, memories, policy)` returns only allowed memories plus the blocked namespaces. Blocked memory never enters the prompt. "verified" is a live Walrus `GET`, done in parallel over the used blobs.
## POST /api/companion
Aria — same shape as `/api/chat` but with a health-companion persona (Claude) and a warm blocked message when a namespace is revoked.
```jsonc theme={null}
{ "query": "Am I allergic to anything?" } // → { answer, receipt }
```
## POST /api/memories · GET /api/memories
Capture a fact to Walrus, or list all stored memories.
```jsonc theme={null}
// POST
{ "namespace": "health", "content": "Allergic to penicillin", "sourceAgent": "agent-a" }
// → { "memory": { "memoryId": "m…", "walrusRef": "…", "namespace": "health", … } }
// GET → { "memories": Memory[] }
```
## GET /api/policy · POST /api/policy
Read or flip the access policy.
```jsonc theme={null}
// POST
{ "agentId": "agent-b", "namespace": "health", "allowed": false }
// → { "policy": { "agent-b": { "health": false, … }, … } }
```
## POST /api/anchor
Store the receipt to Walrus and verify the blob resolves.
```jsonc theme={null}
{ "receipt": { /* AnswerReceipt */ } } // → { "blobId": "…", "verified": true }
```
## POST /api/anchor-sui
The full on-chain proof: store the receipt to Walrus, compute its `blake2b256` digest, and submit `anchor_receipt` — minting a verifiable **Receipt** object.
```jsonc theme={null}
// request (claimNamespaces is optional — used to demonstrate the on-chain gate)
{ "receipt": { /* AnswerReceipt */ }, "claimNamespaces": ["billing"] }
```
```jsonc theme={null}
// response
{
"txDigest": "98ppKaNG…",
"receiptId": "0x4351…",
"allAuthorized": true,
"suiscanUrl": "https://suiscan.xyz/testnet/tx/98ppKaNG…",
"verifyPath": "/verify/0x4351…",
"walrusBlob": "yPe_41r…",
"digestHex": "698dfa4b…"
}
```
Anchoring is signed **server-side** via the Sui CLI keystore (no wallet). The `digestHex` is `blake2b256` over the canonical receipt bytes; the [verifier](/onchain/verifier) re-derives it from the stored Walrus blob.
## POST /api/reset
Reset the demo to seed state (seed memories + default policy). Handy before a recording.
```jsonc theme={null}
{ "ok": true }
```
## Typed client
A thin client wraps these in `apps/web/lib/api.ts`:
```ts theme={null}
sendChat(agentId, query) // POST /api/chat
sendCompanion(query) // POST /api/companion
capture({ namespace, content, sourceAgent })// POST /api/memories
getMemories() // GET /api/memories
getPolicy() / setAccess(agentId, ns, allowed) // /api/policy
anchorReceipt(receipt) // POST /api/anchor -> { blobId, verified }
anchorOnSui(receipt) // POST /api/anchor-sui -> { receiptId, verifyPath, … }
resetDemo() // POST /api/reset
```
# The carry CLI
Source: https://docs.usecarry.xyz/integrate/cli
Proof-carrying memory from your terminal — recall with a receipt, gate access, and anchor verifiable proofs on Sui + Walrus.
`@usecarry/cli` gives you Carry's whole loop from a terminal: recall with an Answer Receipt printed in the shell, flip the gate, and anchor a **verifiable** proof on Sui — each memory blob checked live against Walrus.
Published and installable.
## Install
```bash theme={null}
npm i -g @usecarry/cli # or: npx @usecarry/cli
```
Works out of the box against Walrus + Sui testnet — no keys required for recall/verify. Anchoring on-chain uses your local **Sui CLI** keystore.
## Use
```bash theme={null}
carry seed # load a demo vault (real Walrus testnet blobs)
carry recall "am I allergic to anything?" # → Answer Receipt: authorized ✓ verified ✓ on Walrus
carry access revoke health # flip the retrieval gate
carry recall "am I allergic to anything?" # → 1 namespace blocked · your data never reached the model
carry remember "Blood type is O negative" --ns health
carry anchor --onchain # → mints a Receipt object, prints a verify link
carry anchor --onchain --claim billing # → all_authorized: false — the chain catches the lie
carry list # every memory + its Walrus ref
carry policy # the allow/deny policy
```
## What `--onchain` does
`carry anchor --onchain` stores the receipt to Walrus, computes its `blake2b256` content digest, and submits a real `carry::access::anchor_receipt` transaction — minting an owned, verifiable **Receipt** proof object and printing a `verify` link:
```text theme={null}
all_authorized: true ✓ (claimed: health)
proof: 0xd84de0fd…424765f7
verify ↗ https://usecarry.xyz/verify/0xd84de0fd…424765f7
```
Open the link and all three checks are green — the proof a terminal command produced is independently verifiable by anyone. See [the verifier](/onchain/verifier).
## Config
| Env | Default |
| ------------------------------------------ | ------------------------------------------------ |
| `WALRUS_PUBLISHER` | `https://publisher.walrus-testnet.walrus.space` |
| `WALRUS_AGGREGATOR` | `https://aggregator.walrus-testnet.walrus.space` |
| `CARRY_STORE` | `~/.carry/store.json` |
| `CARRY_PACKAGE_ID` / `CARRY_ACCESS_POLICY` | the deployed testnet ids |
The CLI and the [MCP server](/integrate/mcp) share the same on-disk vault (`~/.carry/store.json`) — a fact you `carry remember` in the terminal is recalled by your IDE agent, under the same gate.
# Aria — the companion
Source: https://docs.usecarry.xyz/integrate/companion
A consumer health companion built on Carry: it only remembers what you allow, and proves it on every reply.
**Aria** is the human face of Carry — a health companion that only recalls what you've authorized, and proves it live. It runs on the exact same engine as everything else: the same gate, the same Answer Receipt, the same on-chain proofs.
usecarry.xyz/companion — the live companion.
## Why it exists
An access matrix is abstract. A person who asks *"am I allergic to anything?"*, gets a caring answer, then **watches the vault lock** when they revoke access — that's the moment Carry's whole thesis becomes something you feel.
## The screen
Aria is a two-column console:
Ask Aria anything. Every answer drops an Answer Receipt beneath it — the memory used, verified on Walrus, with an **Anchor on Sui** action.
A **Memory Vault** (each blob, its Walrus status), the **Access Gate** toggle, and a streaming **Gate Log** that shows the retrieval decision as it happens.
## The moment
Ask *"Am I allergic to anything?"* → Aria answers from your `health` vault; the receipt shows `verified ✓ on Walrus`.
Flip the **Health Vault** toggle. The vault cards lock red; the gate log streams `policy … → revoke`.
Ask the same question again. Aria truthfully can't see it — the receipt turns red: `health — never fetched, the gate ran before Aria saw it`. Your most sensitive data never reached the model.
Hit **Anchor on Sui** under any receipt → a real transaction mints a proof object and hands back a `verify` link. Open it: three green checks, no wallet.
Aria runs on Anthropic **Claude** with a warm, health-companion persona, over the same gated vault the CLI and MCP server use. One vault, every surface.
# MCP server
Source: https://docs.usecarry.xyz/integrate/mcp
Give any MCP client — Cursor, Claude Desktop, Claude Code — gated, receipted, Walrus-backed memory.
Carry's gate and receipts aren't locked inside the demo UI. The `@usecarry/mcp` package is a [Model Context Protocol](https://modelcontextprotocol.io) server, so **any** MCP client gets gated, receipted, Walrus-verified memory that persists across sessions.
The proof travels with the answer, not the vendor — the same gated memory works in Cursor, Claude Desktop, and Claude Code.
## The tools
The server (`name: "carry"`) registers five tools:
| Tool | What it does |
| --------------------- | ------------------------------------------------------------------------ |
| `carry_remember` | Capture a fact into a typed namespace (stored on Walrus). |
| `carry_recall` | Retrieve memory for a query — **gated** by the agent × namespace policy. |
| `carry_set_access` | Grant or revoke an agent's access to a namespace. |
| `carry_list_memories` | List stored memories. |
| `carry_policy` | Inspect the current access policy. |
Every `carry_recall` runs the same gate as the web app: blocked namespaces are never returned, and the result carries the same receipt semantics.
## Install
Published on npm — no local checkout needed.
Add it to your MCP config (`.cursor/mcp.json`, Claude Desktop config, etc.):
```json theme={null}
{
"mcpServers": {
"carry": {
"command": "npx",
"args": ["-y", "@usecarry/mcp"],
"env": {
"WALRUS_PUBLISHER": "https://publisher.walrus-testnet.walrus.space",
"WALRUS_AGGREGATOR": "https://aggregator.walrus-testnet.walrus.space"
}
}
}
}
```
Omit the `env` block to run against a deterministic mock (no network).
Ask your agent to remember and recall facts — every recall is gated, and access can be changed on the fly with `carry_set_access`.
Published and installable.
## Storage
The MCP server persists to a local store (default `~/.carry/store.json`, override with `CARRY_STORE`) and uses the same Walrus + policy primitives as the web app — so a memory taught through Cursor can be recalled through Claude Desktop, gated the same way.
Because the gate and receipt logic live in the framework-free `@carry/core` package, the web app and the MCP server share **exactly** the same enforcement — there's no second, weaker code path.
# Vercel AI SDK adapter
Source: https://docs.usecarry.xyz/integrate/sdk
Wrap any Vercel AI SDK model with proof-carrying memory in one line — gated before generation, a receipt on every call.
`@usecarry/vercel-ai` drops Carry's gate into any [Vercel AI SDK](https://sdk.vercel.ai) model. Memory is recalled and gated **before** generation — the model only ever sees authorized memory — and every call emits an Answer Receipt.
## One line
```ts theme={null}
import { withCarryMemory, createMemoryStore } from "@usecarry/vercel-ai";
import { generateText } from "ai";
import { openai } from "@ai-sdk/openai";
const store = createMemoryStore({
memories: [
{ id: "m1", namespace: "health", content: "Allergic to penicillin" },
{ id: "m2", namespace: "billing", content: "Card ending 4242" },
],
policy: { aria: { billing: false } }, // revoke billing for this agent
});
const model = withCarryMemory(openai("gpt-4o"), {
store,
agent: "aria",
onReceipt: (r) => console.log(r.used, r.blockedNamespaces), // proof of what it used
});
const { text } = await generateText({ model, prompt: "Am I allergic to anything?" });
// → recalls only `health`, injects it, answers. `billing` is never fetched.
```
Works with `generateText`, `streamText`, `generateObject` — anything that takes a model.
## Why
A raw vector-DB memory layer hands the model everything it retrieves. Carry enforces an **agent × namespace** policy at retrieval, so a revoked namespace is never injected into the prompt — and every generation carries a receipt proving exactly what memory reached the model.
## API
Wraps a model with the Carry middleware. Returns the same model type.
The raw `LanguageModelMiddleware`, if you compose your own `wrapLanguageModel`.
An in-memory Carry vault (default-deny; `policy[agent][ns] = true` grants).
Implement `recall(agent, query)` to back it with your own store — Walrus, a DB, the CLI vault.
Options: `{ store, agent?, onReceipt? }`. `onReceipt(receipt)` fires on every call with `{ agent, query, used, blockedNamespaces, createdAt }`.
# The Move contract
Source: https://docs.usecarry.xyz/onchain/contract
carry::access — the on-chain access policy, OwnerCap, and the Receipt object that anchors every proof.
The entire trust layer is a single Move module, `carry::access`, deployed on Sui testnet. It holds the access policy, mints `Receipt` proof objects, and recomputes the authorization verdict on-chain.
## Objects
A **shared** object: the agent × namespace grants table, plus the receipt-chain head (`receipt_count`, `chain_head`).
An **owned** capability. Only the holder can change grants on its policy.
An **owned**, `Display`-enabled proof object minted on each anchor.
## AccessPolicy
```move theme={null}
public struct AccessPolicy has key {
id: UID,
owner: address,
/// key = `agent::namespace`, value = allowed. Absent key = allowed.
grants: Table,
receipt_count: u64,
chain_head: vector,
}
```
The policy is **default-deny**: `is_allowed` returns `true` only where an agent was explicitly granted a namespace. An agent nobody configured, or a namespace nobody defined, reads nothing — a permissive default is how a typo silently widens what a model can see. `receipt_count` and `chain_head` track the tamper-evident receipt chain.
## Granting and revoking
Only the `OwnerCap` holder can change access:
```move theme={null}
public fun set_access(
cap: &OwnerCap,
policy: &mut AccessPolicy,
agent: String,
namespace: String,
allowed: bool,
) {
assert!(cap.policy == object::id(policy), ENotOwner);
let k = gkey(&agent, &namespace);
if (policy.grants.contains(k)) { *policy.grants.borrow_mut(k) = allowed; }
else { policy.grants.add(k, allowed); };
event::emit(AccessChanged { policy: object::id(policy), agent, namespace, allowed });
}
public fun is_allowed(policy: &AccessPolicy, agent: String, namespace: String): bool {
let k = gkey(&agent, &namespace);
if (policy.grants.contains(k)) { *policy.grants.borrow(k) } else { true }
}
```
`is_allowed` is a public, read-only function — `anchor_receipt` calls it on-chain to recompute a proof's verdict, and the walletless verifier calls it via `devInspect` (no gas, no signing) to re-check any proof against the live policy.
## Anchoring a receipt
`anchor_receipt` is the heart of the proof layer. It recomputes the verdict, extends the hash chain, mints the `Receipt`, and transfers it to the signer:
```move theme={null}
public fun anchor_receipt(
policy: &mut AccessPolicy,
answer_id: String,
agent: String,
used_namespaces: vector,
blocked_namespaces: vector,
digest: vector,
walrus_blob: String,
clock: &Clock,
ctx: &mut TxContext,
) {
// 1. recompute the verdict on-chain
let mut all_authorized = true;
let mut i = 0; let n = used_namespaces.length();
while (i < n) {
if (!is_allowed(policy, agent, used_namespaces[i])) { all_authorized = false; };
i = i + 1;
};
// 2. extend the blake2b256 hash chain
let prev = policy.chain_head;
let mut buf = prev;
vector::append(&mut buf, digest);
let chain_digest = hash::blake2b256(&buf);
let seq = policy.receipt_count;
// 3. mint the Receipt + update chain head
let r = Receipt { id: object::new(ctx), policy: object::id(policy), seq,
answer_id, agent, used_namespaces, blocked_namespaces, all_authorized,
digest, prev_digest: prev, chain_digest, walrus_blob,
timestamp_ms: clock.timestamp_ms() };
policy.receipt_count = seq + 1;
policy.chain_head = chain_digest;
transfer::public_transfer(r, ctx.sender());
}
```
`anchor_receipt` takes the policy as `&mut` and is callable by anyone — the receipt chain is append-only. Only `set_access` requires the `OwnerCap`.
## Display metadata
In `init`, the module claims a `Publisher` and registers a `Display` so wallets and explorers render each proof as a **"Carry Proof #"** rather than a raw object.
## Tests
The Move tests assert the behavior that matters:
```bash theme={null}
cd contracts && sui move test
```
* `blake2b256_abc_golden` — pins the hash so it matches the TypeScript verifier byte-for-byte.
* `gate_denies_by_default_and_honours_grants` — nothing is readable until granted; an unknown agent and an undefined namespace both resolve to denied.
* `anchor_mints_receipt_and_chains` — anchoring creates a `Receipt`, increments `seq`, and chains correctly.
# Deployments
Source: https://docs.usecarry.xyz/onchain/deployments
Live Carry package and object IDs on Sui mainnet and testnet, and how to publish your own.
Carry's `carry::access` module is live on **Sui mainnet** and testnet. The app reads these IDs from `deployments/`, so the verifier works out of the box on either network.
## Mainnet (live)
| Object | ID |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- |
| **Package** | [`0xeaf4e6e4…4032d8`](https://suiscan.xyz/mainnet/object/0xeaf4e6e4e96e4f50dfcf2f4beebe3bacb766ad6cbf352b0982bd9631884032d8) |
| **AccessPolicy** (shared) | [`0x53e6e9f0…b1a288`](https://suiscan.xyz/mainnet/object/0x53e6e9f02cce2b106fb0e1e17280e7a0c94ba8ebb0b0fadf09e886cfd9b1a288) |
| **CarryVault** (portable memory) | [`0x10654b96…1bbc413`](https://suiscan.xyz/mainnet/object/0x10654b9653a2579334982185710dd306000452530d856b8d71560fb4c1bbc413) |
Four checks — hash chain, content binding, authorization recomputed, and the policy version the chain accepted.
Its public Walrus blob carries salted commitments instead of the memory itself.
Earlier packages stay deployed and their receipts keep verifying — the verifier resolves each receipt's package from its own object type.
## Testnet (live)
`0xf7acc10ee3de95ed5bb4560e48d5bf4a4e24f7c4003b892b56632c7ff398b6f9`
| Object | ID |
| -------------------------- | -------------------------------------------------------------------- |
| **Package** | `0xf7acc10ee3de95ed5bb4560e48d5bf4a4e24f7c4003b892b56632c7ff398b6f9` |
| **AccessPolicy** (shared) | `0x7bac6b5168a646d7ef06a05fcdebb1526a831bae91c42bb1fd295f976af2cd51` |
| **OwnerCap** (owned) | `0xf274f5d02a19930445069f024b28de3cb5ed9ac49bbe7bbedeea54582db89777` |
| **Example Receipt** (demo) | `0xd84de0fd4d5d4c76c43620f780a6c1c6f2ecab38d183a0e37ea5b62b424765f7` |
Open the walletless verifier for a testnet Receipt — all three checks green.
## Configuration
The canonical IDs live in [`deployments/testnet.json`](https://github.com/Enoch208/carry/blob/main/deployments/testnet.json). The app reads them (with env overrides) in `apps/web/lib/sui.ts`:
```ts theme={null}
// apps/web/lib/sui.ts
export const PKG = process.env.CARRY_PACKAGE_ID || "0xf7acc10e…398b6f9"; // carry::access
export const POLICY = process.env.CARRY_ACCESS_POLICY || "0x7bac6b51…f2cd51"; // shared AccessPolicy
const RPC_URL = process.env.SUI_RPC_URL || "https://sui-testnet-rpc.publicnode.com";
const CLOCK = "0x6"; // the shared Clock, fixed on every Sui network
```
On-chain reads (the verifier's `getObject` + `is_allowed` via `devInspect`) go through a public RPC — the `fullnode.testnet.sui.io` endpoint no longer serves raw JSON-RPC, so Carry points at `sui-testnet-rpc.publicnode.com` by default (override with `SUI_RPC_URL`).
## Publish your own
```bash theme={null}
sui client switch --env testnet
sui client active-address
sui client gas # need ~0.2 SUI; faucet at https://faucet.sui.io
```
```bash theme={null}
cd contracts
sui client publish --gas-budget 200000000 --json > publish.json
```
Grab the new `packageId` from the published `objectChanges`.
`publish` doesn't call `create()`, so make your shared `AccessPolicy` + `OwnerCap`:
```bash theme={null}
sui client call --package --module access --function create --gas-budget 50000000
```
Set `packageId`, `accessPolicy`, `ownerCap`, and `owner` to the new values — the app picks them up automatically.
The Carry contract changes (new `Receipt` object, new `anchor_receipt` signature) are **breaking**, so a fresh `publish` — not an in-place `upgrade` — is required.
# The hash chain
Source: https://docs.usecarry.xyz/onchain/hash-chain
How blake2b256 binds each receipt to its content and to the receipts before it — and why TS and Move agree byte-for-byte.
Carry's proofs are tamper-evident because of two hashes computed with **BLAKE2b-256**: a content-binding `digest` and a chaining `chain_digest`.
## Two hashes, two guarantees
`blake2b256` of the exact Walrus receipt blob. Proves the on-chain proof points to specific content.
`blake2b256(prev_digest ++ digest)`. Links each receipt to its predecessor, so reordering or deleting a receipt breaks the chain.
## The fixed byte layout
Both sides agree on an exact byte layout — this is what makes cross-implementation verification possible:
```
chain_digest = blake2b256( prev_digest_bytes ++ digest_bytes )
```
* `prev` first, then `digest`, **no separator**.
* An empty `prev` (the first receipt) hashes the `digest` bytes alone.
```move theme={null}
// Move (contract)
let prev = policy.chain_head;
let mut buf = prev;
vector::append(&mut buf, digest);
let chain_digest = hash::blake2b256(&buf);
```
```ts theme={null}
// TypeScript (verifier + app)
export function chainDigestHex(prevHex, digestHexValue) {
const prev = prevHex ? hexToBytes(prevHex) : new Uint8Array(0);
const dig = hexToBytes(digestHexValue);
const buf = new Uint8Array(prev.length + dig.length);
buf.set(prev, 0);
buf.set(dig, prev.length);
return digestHex(buf); // blake2b256 -> lowercase hex
}
```
## Content binding via canonical JSON
The `digest` is the hash of the receipt's **canonical** form — keys sorted recursively — so it's reproducible regardless of how Walrus serialized the stored JSON:
```ts theme={null}
function sortValue(v) {
if (Array.isArray(v)) return v.map(sortValue);
if (v && typeof v === "object")
return Object.fromEntries(Object.keys(v).sort().map((k) => [k, sortValue(v[k])]));
return v;
}
const canonicalReceiptBytes = (r) => new TextEncoder().encode(JSON.stringify(sortValue(r)));
const digestHex = (bytes) => bytesToHex(blake2b(bytes, { dkLen: 32 }));
```
The verifier re-canonicalizes the fetched blob before hashing, so the check is robust to key order and whitespace introduced in storage. The proof binds the **content**, not the exact bytes.
## Cross-implementation agreement
The TypeScript verifier and the Move contract must produce **identical** hashes or honest proofs would fail to verify. This is pinned by a golden test vector on both sides:
```
blake2b256("abc") = bddd813c634239723171ef3fee98579b94964e3bb1cb3e427262c8c068d52319
```
* TypeScript: `@noble/hashes` `blake2b(bytes, { dkLen: 32 })`.
* Move: `sui::hash::blake2b256(&bytes)`.
Both are asserted against the same constant in their test suites — so any drift fails CI, not a user's verification.
`@noble/hashes` v2 exposes blake2b at the `@noble/hashes/blake2.js` subpath, and `@mysten/sui` v2.20 exposes the JSON-RPC client at `@mysten/sui/jsonRpc` — both are used by the verifier.
# The public verifier
Source: https://docs.usecarry.xyz/onchain/verifier
A walletless page anyone can use to independently verify a Carry Proof against Sui and Walrus.
The verifier is Carry's closing argument: **don't trust Carry — verify it.** Open `/verify/` with no wallet, and the page independently re-derives every claim a proof makes.
Open the live app, anchor an answer, and follow the "verify" link.
## The three checks
For a given `Receipt` object id, the verifier reads it from Sui and runs three independent checks:
Recompute `blake2b256(prev_digest ++ digest)` from the object's own fields and confirm it equals the stored `chain_digest`. A reordered or deleted receipt breaks this.
Fetch the Walrus blob named by `walrus_blob`, re-canonicalize and hash it, and confirm it equals the on-chain `digest`. This proves the proof points to exactly this content.
Call `is_allowed` for every used namespace against the **live** policy and confirm the result matches the receipt's `all_authorized`. This proves the verdict, recomputed now, still holds.
## The verification logic
```ts theme={null}
// apps/web/lib/verify.ts (simplified)
export async function verifyReceipt(id) {
const receipt = await getReceipt(id);
if (!receipt) return { found: false, checks: [], receipt: null };
const checks = [];
// 1. chain link
checks.push({ label: "Hash chain intact",
ok: chainOk(receipt.prevDigestHex, receipt.digestHex, receipt.chainDigestHex) });
// 2. content binding — re-canonicalize the blob, then hash
const res = await fetch(`${AGGREGATOR}/v1/blobs/${receipt.walrusBlob}`);
const bytes = new Uint8Array(await res.arrayBuffer());
checks.push({ label: "Content binding (Walrus <-> chain)",
ok: digestMatches(bytes, receipt.digestHex) });
// 3. authorization, recomputed against the live on-chain policy
const verdicts = await Promise.all(
receipt.usedNamespaces.map((ns) => readIsAllowed(receipt.agent, ns, receipt.policy)));
checks.push({ label: "Authorization recomputed",
ok: verdicts.every(Boolean) === receipt.allAuthorized });
return { found: true, checks, receipt };
}
```
## Why it's robust
```ts theme={null}
export function digestMatches(blobBytes, expectedDigestHex) {
try {
const obj = JSON.parse(new TextDecoder().decode(blobBytes));
return digestHex(canonicalReceiptBytes(obj)) === expectedDigestHex;
} catch { return false; }
}
```
The content check **re-canonicalizes** the fetched blob before hashing — so it doesn't matter how Walrus serialized the JSON (key order, whitespace). The proof binds the canonical content.
The verifier is entirely read-only: `getObject` + `is_allowed` via `devInspect` + a Walrus aggregator `GET`. No wallet, no Carry-internal state, no trust in the app required.
## What a failure looks like
If someone tampers with the stored blob, the content check goes red. If the on-chain policy has since revoked a namespace the receipt used, the authorization check goes red. If the receipt were reordered in the chain, the chain check goes red. Honest proofs are all-green; tampered ones can't hide.
# Quickstart
Source: https://docs.usecarry.xyz/quickstart
Run Carry locally — from clone to a live, proof-carrying agent in a few minutes.
This guide takes you from zero to a running Carry: teach a fact, recall it across models, watch the gate block a revoked namespace, and verify a proof on-chain.
## Prerequisites
The app is a Next.js 16 monorepo using npm workspaces.
Testnet address with a little SUI — used to anchor proofs locally and to build/publish the Move contract.
Carry is **mock-first**: real OpenAI / Anthropic / Walrus adapters sit behind interfaces, and the system falls back to deterministic mocks when a key is absent — so it runs offline and a demo never hard-fails on a flaky testnet.
## 1. Clone and install
```bash theme={null}
git clone https://github.com/Enoch208/carry
cd carry
npm install
```
## 2. Configure environment
Copy the example env and fill in what you have. With **no keys**, Carry runs in mock mode; with keys, it runs live.
```bash theme={null}
cp apps/web/.env.example apps/web/.env.local
```
```bash Live mode theme={null}
# apps/web/.env.local
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
WALRUS_PUBLISHER=https://publisher.walrus-testnet.walrus.space
WALRUS_AGGREGATOR=https://aggregator.walrus-testnet.walrus.space
CARRY_MODE=live
```
```bash Mock mode theme={null}
# apps/web/.env.local
CARRY_MODE=mock
# no API keys needed — deterministic stubs for LLM + Walrus
```
The on-chain config (package + policy IDs) is read from `deployments/testnet.json`, so you don't need to set it manually to use the public verifier.
## 3. Run the app
```bash theme={null}
npm run dev
```
Open [http://localhost:3000](http://localhost:3000).
## 4. The five-minute tour
Open **Chat A** (GPT-4o). Use the capture box to store a fact in the `health` namespace — e.g. *"Allergic to penicillin."* It's written to Walrus as a real blob.
Open **Chat B** (Claude). Ask *"Am I allergic to anything?"* Agent B — a different provider — recalls the fact and renders an **Answer Receipt** showing the memory used, that it was authorized, and that the blob still resolves on Walrus.
Open **Access** and revoke Agent B's access to `health`. Ask again — the agent truthfully refuses, and the receipt shows `health blocked by policy`. The gate ran **before** the model, so the memory was never fetched.
Under any Answer Receipt — in **Aria** (`/companion`) or the Dashboard — click **Anchor on Sui**. Carry mints a tamper-evident `Receipt` object (signed server-side, no wallet) and hands back a `/verify/` link. Open it and watch three independent checks go green against Sui and Walrus.
## 5. Run the tests
```bash theme={null}
npm test # TypeScript: core gate, receipts, digest, verify
cd contracts && sui move test # Move: receipt minting, hash chain, blake2b256
```
## Next steps
See how the gate, Walrus, and on-chain proof fit together.
Wire Carry into Cursor, Claude Desktop, or Claude Code via MCP.
# What's real vs mock
Source: https://docs.usecarry.xyz/reference/honesty-table
An honest accounting of which parts of Carry are live and which fall back to deterministic mocks.
Carry is **mock-first**: real adapters sit behind interfaces, and the system falls back to deterministic mocks when a key is absent — so it runs offline and a demo never hard-fails on a flaky testnet. Here's exactly what's real.
| Capability | Status |
| --------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Cross-model recall** | Real. Agent A → OpenAI GPT-4o, Agent B → Anthropic Claude, behind a common interface. Falls back to a deterministic mock LLM when no API key is set. |
| **Walrus storage** | Real. Memories and receipts are content-addressed blobs via the Walrus HTTP API. `MockWalrus` is used only in mock mode. |
| **Walrus verification** | Real. The receipt's "verified" badge is a live aggregator `GET /v1/blobs/{id}` anyone can repeat — not a flag. |
| **The gate** | Real and pure. Enforced at retrieval, before generation; unit-tested in `@carry/core`. |
| **On-chain policy** | Real. A shared `AccessPolicy` on Sui testnet; grants/revokes are real transactions. The per-answer gate runs in `@carry/core`; the on-chain policy governs the anchored proof's verdict — `anchor_receipt` recomputes it, and the verifier confirms it via `devInspect`. |
| **Companion, CLI, SDK** | Real. Aria (`/companion`), the published `@usecarry/cli`, `@usecarry/mcp`, and the `@usecarry/vercel-ai` adapter all run the same gate + receipt. |
| **Receipt anchoring** | Real. `anchor_receipt` mints a `Receipt` object, recomputes `all_authorized` on-chain, and extends a blake2b256 hash chain. |
| **Public verifier** | Real. `/verify/` reads the chain + Walrus with no wallet and recomputes all three checks. |
| **Seal encryption** | Real via **MemWal mode** (`CARRY_MEMORY=memwal`); default mode stores public blobs. |
| **MCP server** | Real. Five tools over the same `@carry/core` gate. |
| **In-process memory index** | The one thing **not** persisted across server restarts — the local index is in-memory. Stated plainly rather than hidden. |
## On the demo specifically
Real Walrus testnet blobs, uploaded once with `apps/web/scripts/seed-walrus.mjs`. Resolvable on any testnet aggregator.
Hit Walrus live and get a real blob id back.
Live GPT-4o and Claude calls when keys are present.
A real policy change the gate honors before the model is invoked.
The honesty here is the point. Carry's whole pitch is provability — so the docs say exactly what's live, what's mock, and the single thing that doesn't persist, rather than pretend otherwise.
# Tech stack
Source: https://docs.usecarry.xyz/reference/tech-stack
The languages, frameworks, and packages that make up Carry — and how the monorepo is laid out.
## Stack at a glance
| Layer | Technology |
| ------------------ | -------------------------------------------------------------------------------------------------------- |
| **Smart contract** | Sui Move (`carry::access`), testnet — owned `Receipt` objects + blake2b256 hash chain |
| **Storage** | Walrus (HTTP API), Seal via MemWal (optional) |
| **Frontend** | Next.js 16, React 19, TypeScript (strict), Tailwind CSS v4 |
| **On-chain reads** | `@mysten/sui` v2.22 (`SuiJsonRpcClient` via `jsonRpc`) — read-only `getObject` + `devInspect`, no wallet |
| **Anchoring** | server-side via the Sui CLI keystore (no wallet dependency) |
| **Crypto** | `@noble/hashes` blake2b256 (TS) ↔ `sui::hash::blake2b256` (Move), pinned to a golden vector |
| **LLMs** | OpenAI GPT-4o + Anthropic Claude (behind interfaces, mock fallback) |
| **Agent interop** | MCP server + a Vercel AI SDK adapter |
| **Tests** | Vitest (TS) + Sui Move unit tests |
## Monorepo layout
```
carry/
├─ apps/
│ └─ web/ # Next.js app
│ ├─ app/
│ │ ├─ (app)/ # chat-a · chat-b · dashboard · access
│ │ ├─ companion/ # Aria — the health companion
│ │ ├─ verify/[id]/ # the walletless proof verifier
│ │ └─ api/ # chat · companion · memories · policy · anchor · anchor-sui · reset
│ ├─ components/ # UI (chat, receipts, access matrix, companion, verifier)
│ └─ lib/ # sui.ts · blake.ts · verify.ts · store.ts · llm-providers · companion
├─ packages/
│ ├─ carry-core/ # framework-free: types, gate, policy, receipt (unit-tested)
│ ├─ carry-walrus/ # Walrus HTTP client + MockWalrus
│ ├─ carry-mcp/ # @usecarry/mcp — MCP server (5 tools)
│ ├─ carry-cli/ # @usecarry/cli — the `carry` command
│ └─ carry-vercel-ai/ # @usecarry/vercel-ai — Vercel AI SDK middleware
├─ contracts/ # Sui Move package (carry::access) + tests
└─ deployments/ # testnet.json (package + object IDs + example proofs)
```
## Design principles
`@carry/core` holds the gate, policy, and receipt logic with zero framework deps — so the web app, the CLI, the MCP server, and the SDK adapter enforce identically.
LLM and Walrus clients sit behind interfaces with deterministic mock fallbacks — offline-friendly and test-friendly.
A few typed contracts (`Memory`, `Policy`, `AnswerReceipt`) define the seams; the rest composes.
The access policy and the proof chain live on Sui; anchoring recomputes the verdict there, and the verifier reads it — the app doesn't get to assert it.
## Local commands
```bash theme={null}
npm run dev # run the web app
npm run build # production build
npm test # all TS test suites (core, walrus, vercel-ai, web)
cd contracts && sui move test # Move unit tests (gate, blake2b256 golden, anchor)
```
Enoch208/carry — the full monorepo.
# Seal & MemWal
Source: https://docs.usecarry.xyz/stack/seal-memwal
Optional server-side encryption: private memories addressed by a real Walrus blob, readable only through the relayer.
By default, Carry stores memories as public Walrus blobs (maximizing verifiability). For **private** memory, Carry integrates [Seal](https://github.com/MystenLabs/seal) encryption through [MemWal](https://github.com/MystenLabs/MemWal) — without hand-rolling any crypto.
## What MemWal mode changes
Memories are public Walrus blobs. Anyone can resolve them — strongest public verifiability.
Memories are Seal-encrypted server-side before they land on Walrus — addressed by a real blob, readable only through the relayer with the delegate key.
## How it's wired
In MemWal mode, captures route through the MemWal SDK instead of the direct Walrus client:
```ts theme={null}
// apps/web/lib/store.ts (simplified)
const walrusRef = memwalEnabled()
? await rememberOnMemwal(content, namespace) // Seal-encrypt -> Walrus, via relayer
: (await walrus.store({ namespace, content, sourceAgent, createdAt }, MEMORY_EPOCHS)).blobId;
```
The MemWal relayer does the **Seal encryption, embedding, and Walrus storage server-side**, so memories become private — addressed by a real Walrus blob but readable only through the relayer with the delegate key. `remember(text, namespace)` returns a background job; Carry waits for it and stores the returned blob id.
## Enable it
```bash theme={null}
CARRY_MEMORY=memwal
MEMWAL_ACCOUNT_ID=0x...
MEMWAL_SERVER_URL=https://relayer.memory.walrus.xyz
MEMWAL_PRIVATE_KEY=...
```
`MEMWAL_PRIVATE_KEY` is a real secret — keep it in `.env.local` (gitignored) and never commit it.
## Proofs still work
Anchored **receipts** are always stored as their own (public) Walrus blob regardless of memory mode, so the public verifier works whether or not memories themselves are encrypted. MemWal mode changes how the underlying *memory* is stored; it doesn't weaken the proof of *what the agent used*.
The full `remember → blob_id → recall` round-trip is validated live against the MemWal relayer in `apps/web/scripts/memwal-smoke.mjs`.
# Walrus
Source: https://docs.usecarry.xyz/stack/walrus
How Carry stores memories and receipts as real, content-addressed blobs on Walrus — and verifies them live.
[Walrus](https://www.walrus.xyz) is Carry's storage layer. Every memory and every anchored receipt is a real, content-addressed blob — not a hash placeholder — so anyone can resolve it and confirm it exists.
## How Carry talks to Walrus
Carry uses the Walrus HTTP API directly through a small client:
```ts theme={null}
// packages/carry-walrus/src/walrus-http.ts
export class WalrusHttp implements WalrusClient {
async store(data, epochs = 5) {
const res = await fetch(`${this.publisher}/v1/blobs?epochs=${epochs}`, {
method: "PUT",
headers: { "Content-Type": "application/json" },
body: JSON.stringify(data),
});
const json = await res.json();
const blobId = json.newlyCreated?.blobObject?.blobId ?? json.alreadyCertified?.blobId;
return { blobId };
}
async verify(blobId) {
const res = await fetch(`${this.aggregator}/v1/blobs/${blobId}`);
return res.ok; // resolves on-chain? not a flag we set
}
}
```
* **Store** — `PUT /v1/blobs?epochs=N` on the publisher returns the real blob id, which becomes the memory's `walrusRef`.
* **Verify** — `GET /v1/blobs/{id}` on the aggregator. The receipt's "verified" badge is an independent aggregator GET *anyone* can repeat.
## Public verifiability
Captured memories become **public Walrus blobs** by default — and that's deliberate. It means a receipt's "verified" badge isn't a label Carry controls; it's a check anyone can reproduce against any testnet aggregator. That public verifiability is the strongest version of the proof story.
```bash theme={null}
# resolve any Carry memory or receipt blob yourself
curl https://aggregator.walrus-testnet.walrus.space/v1/blobs/
```
## Configuration
```bash theme={null}
WALRUS_PUBLISHER=https://publisher.walrus-testnet.walrus.space
WALRUS_AGGREGATOR=https://aggregator.walrus-testnet.walrus.space
```
Set `CARRY_MODE=mock` (or omit the Walrus URLs) to use a deterministic in-memory `MockWalrus` — handy for offline development and tests.
## Receipts on Walrus
When an answer is anchored, the canonical receipt JSON is stored to Walrus first; its blob id and `blake2b256` digest are then recorded on-chain in the `Receipt` object. The verifier later re-fetches that blob and re-derives the digest — closing the loop between storage and proof. See [The hash chain](/onchain/hash-chain).