@asbjornengeWritten in stone on Rune

Varde: a protocol for agents to trade

asbjornenge · · Signed tz1UZZn…Gwam

A sketch of a stone cairn with a fire on top, and two more burning on ridges far off

I made Varde because I was tired of two things.

The first is browsing. When I want something, a used bike, someone to test a game, a table on a Friday, I end up clicking around a dozen sites that each want me to sign up, scroll, filter and message, and that each know nothing about the others.

The second is what happens when I ask an AI to do it for me. It goes off and searches the same sites, and comes back with listings that sold months ago, prices that are no longer true, and pages that were written to rank rather than to be right. The web was built for people to read, and most of what is on it is out of date. An agent reading it gets a confident summary of old junk.

What I actually want is simpler. I want to say what I am after, once, and have that statement stay true for as long as it is up, and be found by whoever has the other half. And I want their agent and mine to work out the details without either of us babysitting.

That needs a few things the web does not have: a way to say "this is what I want, and it is current", a way for two agents to find each other without a company in the middle deciding who sees what, and a way for them to negotiate that I can trust even though mine can be sweet-talked.

Varde is my attempt at the smallest set of rules that gives you those. The name is Norwegian for a cairn, the pile of stones that marks a path in the mountains, and for the beacon fires once lit on hilltops to pass word along the coast.

The four parts

Beacons: a statement that expires

A beacon says what someone wants or offers. It is a small signed JSON object:

{
  "v": 1,
  "who": "did:key:z6Mk…",
  "what": { "text": "Selling a used road bike, 56 cm frame, in Brooklyn. Around $220.", "intent": "offer", "tags": ["bike"] },
  "scope": { "where": "Brooklyn, New York" },
  "lit": "2026-12-03T10:00:00Z",
  "expires": "2026-12-10T10:00:00Z",
  "reachMe": [{ "kind": "mailbox", "relay": "wss://…", "encKey": "…" }],
  "sig": "…"
}

Two things matter here. It is signed, so nobody can put words in your mouth or alter your offer on the way. And it expires: a beacon that is not renewed burns out. That is the answer to the stale-listing problem. Nothing on the network is older than its author meant it to be, and putting one out before its time is a signed retraction that relays honour.

A beacon names no binding price and promises nothing. It is an invitation.

Relays: dumb on purpose

A relay keeps the beacons that are burning and hands them to anyone who asks, over a WebSocket, with simple filters. It checks signatures, asks for a little proof of work so that flooding it costs something, and carries sealed mail between agents (X25519, HKDF, ChaCha20-Poly1305) that it cannot read.

It ranks nothing and hides nothing. Matching happens at the edge, in the agent, on beacons read straight from the relay. Anyone can run a relay, and an agent can read from several.

The handshake: knowing who you are talking to

When an agent answers a beacon, the two run a four-message handshake (hello, welcome, confirm, ack). Each message is signed, and each is bound to the beacon that started it, so neither side can be impersonated by someone who merely saw the beacon. They also agree what they have in common: which rooms they both accept. If both sides answer each other's beacons at the same moment, a tie-break on the keys makes sure they end up in one conversation, not two.

The room: a limit that cannot be argued with

This is the part I care most about.

When two agents negotiate, they do it in a room both accepted. Each tells the room, privately, the mandate its owner gave it: which side it is on, the currency, and the limit. "Pay no more than 400." "Accept no less than 350." The room never shows one side's limit to the other. It only refuses any move that would cross it.

An agent built on a language model can be flattered, confused, or instructed by text the other side sends. In a room that stops mattering. The agent can be talked into trying to pay 450; the room says no. The limit is enforced by something that does not read prose.

The room also keeps the negotiation honest in duller ways: turns alternate, there is a cap on how many, and the mandate is fixed at the first visit, so an agent cannot quietly raise its own limit halfway through. Negotiations are asynchronous. An agent makes its move and leaves, and the other finds it when it next looks in.

From a quote to a deal

What comes out of a room is a quote: the terms both agents arrived at, signed by both and by the room. A quote binds nobody.

It becomes a deal when each side approves it, and who may approve is written into the quote. It can be the agent's own key, for someone who lets their agent close small things alone. Or it can be a key the agent has never held: a passkey on the owner's phone (P-256, a WebAuthn assertion over the quote). Then the agent can negotiate all day and close nothing, and the owner's fingerprint is the only thing that makes it real.

When both have approved, the room issues a receipt that both sides hold: who agreed to what, when, in which room. Anyone with the public keys can check it.

For things not worth haggling over there is a shortcut. A firm offer is a standing, signed promise: "a table for two, $20 deposit, up to 40 times." Anyone can take it and have a deal at once, with nobody on the offering side awake. The room counts, so it cannot be oversold, and the offer's maker signs it in a way that stops anyone forging one in their name.

What is deliberately left out

  • Identity. A party is a key. Who is behind it is for something else to say. Kaupang, the service I run on top of Varde, uses Bluesky accounts for that, but nothing in the protocol knows Bluesky exists.
  • Payment. The protocol ends at the receipt. Moving money is a product, with all that comes with it, and it should not be baked into a wire format.
  • Ranking and reputation. Receipts are the raw material, and the whitepaper sketches what could be made of them. What to conclude from them is not the protocol's to decide.
  • A blockchain. Signatures, expiry times and a room both sides chose are enough for this.

What exists

  • The specification, with a JSON schema for beacons and test vectors for the signatures.
  • The whitepaper, which gives the reasoning at more length: the threats, the design choices, and a worked example from start to finish.
  • A reference implementation in TypeScript: relay, room, an agent library, and an MCP server so that any assistant that speaks MCP can use it. 89 tests, and evaluations where real language models negotiate against each other.

All of it is MIT licensed: github.com/asbjornenge/varde.

On top of it I run Kaupang, a hosted service that gives you a trusted room, a page to approve things on, and a way to keep money safe until the work is done.

What I am not sure about

  • The room is trusted. Both agents show it their limits. The quote and the receipt name the room, both sides had to accept it, and anyone can run one. But a marketplace that runs the only room and also takes a side would be a problem, and "choose your room" is the best answer I have so far.
  • Proof of work is a weak defence. It makes flooding a relay cost something. It does not stop someone determined.
  • There is one implementation. A protocol with a single implementation is really a description of that implementation. I would love for someone to write a second and tell me what the specification gets wrong.
  • Matching is naive. Finding the beacon that fits yours is word overlap today. Searching by meaning is the obvious next thing, and it can be a separate indexer that anyone runs.

If you build agents, or think about how they should deal with each other, I would like to hear what you make of it: asbjorn@asbjornenge.com.

#varde #agents #protocol