In Buzz, a person's chat line, an agent's patch note and a workflow step are the same thing: one signed event. One relay checks each event at up to eleven gates, then stores it, sends it on and logs it.
Pick a sender, then press Publish. Watch which gates the event passes and where it lands. Then we build each part from zero: the event, the keys, the relay, the pipeline, the fan-out, the agent harness, workflows and the audit chain.
You need a little Python and the idea of a hash (a short fingerprint of some bytes). We build the rest from zero.
Based on Block's open-source Buzz repository (Apache 2.0), its architecture document and the launch post on the Block engineering blog (Tyler Longwell, 21 July 2026). Checked against the repository on 22 November 2026.
The gates, their order and what skips what follow the Buzz architecture document (Event Pipeline). The row groups the eleven steps into six boxes. The counts are this page's toy, not relay measurements.
Chapter 0
See why fast agents can make a team slower, and what Buzz puts in the middle instead
Three engineers each run a coding agent. One agent finds the bug and prints a stack trace in a terminal. Its owner pastes it into chat. A second agent writes the fix, and a person opens the pull request and updates the tracker by hand.
The work got fast. The handoffs did not. Block's launch post for Buzz names it in one line: "The bottleneck moved from intelligence to coordination."
Each purple agent makes outputs. Teal is the person who carries them. Switch between separate tools and one shared log, then add agents.
Illustrative toy: each agent makes 5 outputs a day, each output belongs in 3 places (chat, tracker, review), and one hand copy takes 1 minute.
Work the toy. Four agents make 5 outputs each, so 20 outputs a day. Each belongs in chat, the tracker and review, so a person makes 20 × 3 = 60 copies. At one minute each, that is an hour a day of courier work, and each copy can drop context.
Buzz's answer is one self-hosted workspace. Every message, reaction, workflow step, review approval and git event is a signed event in one log. A signed event is a small record that its author signs with a private key. People and agents read and write the same log. The README's tagline: "a workspace where humans and agents build together, on a relay you own."
The failure. Symptom: six weeks later nobody can say why the team chose a fix. Measure: try to rebuild one decision from chat, tracker and pull request; count the gaps. Fix: keep the discussion, the patch and the decision in one ordered record.
Chapter 1
Build a Nostr event field by field, compute its id, and read its kind number
Buzz speaks Nostr, an open protocol for signed messages. Its base spec, NIP-01, defines the event. Every Buzz action is one event with six fields.
| Field | What it holds |
|---|---|
id | The SHA-256 hash of the event's other fields, as 64 hex digits. |
pubkey | The author's public key (secp256k1, hex). |
kind | An integer that says what the event means. |
tags | Lists of strings, such as ["e", id] to point at another event. |
content | The payload: message text or JSON. |
sig | A Schnorr signature over the id, made with the author's private key. |
The id is not a number the server hands out. Anyone can compute it. Take the author's key, call it pubkey; the Unix time, created_at; the kind number, kind; the tags; and the text, content. Put them in one JSON array with no spaces and hash it.
The id equals SHA-256 of the array zero, pubkey, created-at, kind, tags, content.
Write the six values into one array, in this order. Hash its bytes. The hex result is the id. The author then signs the id.
The NIP-OA spec in the Buzz repository gives a real event: kind 1, created_at 1713956400, content "owner-attested agent event". Our script hashes its array and gets d892a65e…971b, the id printed in the spec.
The next number is the kind. Its range tells the relay how to treat the event before anything else. Call the kind k. Buzz's table splits the space into bands of ten thousand, so the band is k divided by 10,000, rounded down.
The band equals the floor of k over ten thousand.
Divide the kind k by ten thousand and drop the remainder. The result picks the row of the table, and the row says whether the relay stores the event.
A chat line has k = 9, so the band is 0: stored. Presence has k = 20001, band 2: delivered live, never stored. A made-up kind 21500 is also band 2.
Change one letter of the text. Then drag the kind and see which band it lands in.
The hash is a real SHA-256 computed in your browser over a toy event (pubkey "ab" repeated 32 times, created_at 1784800800, no tags). The bands and the kind numbers come from the architecture document's kind table.
Clients talk to the relay in JSON arrays over a WebSocket. A client sends ["EVENT", e] to publish, ["REQ", id, filter] to subscribe and ["AUTH", e] to log in. The relay answers with EVENT, EOSE (end of stored events) and ["OK", id, true|false, reason]. Limits: a frame holds 65,536 bytes, a connection holds 1,024 subscriptions, and a history query returns 500 events per filter.
The failure. Symptom: the relay rejects a client's events as having a bad id. Measure: recompute the id from the array; compare byte for byte. Fix: serialize exactly as NIP-01 says: this field order, no spaces, UTF-8 left unescaped.
Chapter 2
Give an agent its own key, grant it narrow rights, and prove to the relay that you hold a key
On most platforms your identity is a row in the platform's database. In Buzz, every member, human or agent, holds a keypair: a private key that signs and a public key that others use to check. The launch post: "If Buzz disappears, your identity and signed history still verify."
A common shortcut gives a bot a token from a person's account. Then the bot's actions look like the person's.
Buzz does not do this. The agent gets its own key. The owner signs a narrow grant once. The agent signs every event itself. The post puts it as: "authorization does not erase authorship."
The grant is a draft Nostr extension in the Buzz repository, NIP-OA (owner attestation). It is a tag on the agent's event: ["auth", owner_pubkey, conditions, sig]. The conditions are clauses joined by &, and every clause must hold: kind=9, created_at<T or created_at>T.
The owner signed kind=9&created_at<T, with T 24 hours after the grant. Pick the kind, move the send time, then let the agent lie about its clock.
The clause rules and the backdating warning are from NIP-OA (docs/nips/NIP-OA.md). The 24 hour grant and the backdated time of 20 hours are illustrative.
A key must also prove itself to the relay. The relay sends a random challenge. The client signs a kind 22242 event that holds the challenge and sends it back. The relay checks the signature and the time. Call the event's time te and the relay's clock tr.
The size of t-e minus t-r is at most sixty seconds.
Subtract the relay's clock t-r from the event's time t-e. Drop the sign. If the gap is 60 seconds or less, accept the login.
With made-up clocks: a laptop 45 seconds behind gives |−45| = 45, accepted. A laptop 75 seconds behind gives 75, rejected. A copied login event dies 60 seconds after its own time.
A NIP-42 login grants all 14 scopes: read and write for messages, channels, users, jobs, subscriptions and files, plus two admin scopes. Plain HTTP calls use NIP-98: a signed kind 27235 event that names the URL and method.
The failure. Symptom: a leaked agent key keeps posting after its grant ended. Measure: compare each event's created_at with the time the relay received it. Fix: NIP-OA says the agent controls created_at, so the relay or client must check freshness itself. Keep grants short.
Chapter 3
See why Buzz keeps one authoritative process, and how it drops a client that stops answering
Most Nostr setups use many relays. Buzz runs one. Clients connect over WebSocket to buzz-relay, a Rust server on Axum. There is no peer-to-peer exchange, no gossip and no replication. One relay gives one order of events, one place to check membership and one audit trail.
| Store | Job |
|---|---|
| Postgres | Events, partitioned by month, with a full-text search column and its index. |
| Redis | Fan-out between relay processes, presence keys and typing indicators. |
| S3-compatible storage | Media files, up to 50 MB each. |
A community is the workspace the URL selects. The relay reads it from the request's host before anything else. An unknown host fails closed. Then each connection runs these steps:
Each tick is 30 seconds and one ping. Make the client slow, then tick. Separately, send bursts into its four-slot buffer.
The 30 second ping, the 3 missed pongs and the 3 full sends in a row are from the architecture document. The four-slot buffer is illustrative; the real queue is larger.
How long can a dead connection stay open? Call the ping period p and the allowed misses m.
T-dead equals m times p.
The relay pings every p seconds. After m pings with no answer it hangs up. So multiply m by p.
From the architecture document: m = 3 and p = 30 s, so T-dead = 90 s. Presence uses its own timer: a Redis key that lives 180 s, three times a 60 s presence heartbeat.
Sending works the same way. The relay never waits on a slow reader. It tries to put each event in that client's bounded queue. If the queue is full three times in a row, the relay cancels the client. The client can reconnect and ask again.
The failure. Symptom: relay memory grows while one phone on a train reads slowly. Measure: count full-queue sends per client. Fix: bound every queue, use a send that does not wait, and drop the client after three strikes.
Chapter 4
Step an event through the relay's pipeline and find where the client hears OK
Every ["EVENT", e] runs the same pipeline in the relay. Learn its order and you can predict most of Buzz's behaviour.
| # | Step | What happens |
|---|---|---|
| 1 | Auth check | The connection must be logged in with the messages-write scope. |
| 2 | Author match | The event's pubkey must equal the logged-in key. |
| 3 | No login events | Kind 22242 is refused as content. |
| 4 | Ephemeral route | Kinds 20000 to 29999 leave for a short path. |
| 5 | Verify | Check the signature and recompute the id, on a separate thread pool. |
| 6 | Membership | The author must belong to the channel. |
| 7 | Insert | Postgres insert that ignores a repeat id; search text is built here. |
| 8 | Redis publish | Other relay processes hear about channel events. |
| 9 | Fan-out | Send to matching local subscriptions. |
| 10 | Audit | Append to the hash chain, in a background task. |
| 11 | Workflows | Check workflow triggers, in a background task. |
The cheap checks come first. Steps 1 to 3 compare a few values, so a forged event costs the relay almost nothing. The signature check in step 5 costs real CPU, so it runs on a blocking thread pool where it cannot stall other connections.
Pick an event, then press Step or Run. Dashed rows run after the client already heard OK.
Steps, branches and the ephemeral path follow the architecture document. For a repeat id the toy stops at the insert; the document does not say what the relay does next.
A retry is safe because the id is a hash. Say a client times out and sends the same event three times. The relay tries three inserts with one id. The first adds a row. The other two do nothing. The table holds 1 row.
The client gets ["OK", id, true, ""] after the fan-out. Audit and workflow triggers run as background tasks, and a failure there does not fail the publish. A separate limit of 1,024 handler slots caps EVENT and REQ work across all connections.
The failure. Symptom: an event is stored but has no audit entry. Measure: compare audit entries with the events table. Fix: reconcile the two, or move the audit inside the reply and pay the latency.
["OK", id, true]?Chapter 5
Route one event to thousands of subscriptions fast, and never to someone outside the channel
A client subscribes with ["REQ", sub_id, filter]. The relay sends up to 500 stored matches per filter, then EOSE, then live matches. With thousands of open subscriptions, how does it find the matches for one new event without checking them all?
The subscription registry is a concurrent hash map with three indexes, checked in order.
Work a made-up case. The relay holds 5,000 subscriptions. A kind 9 event lands in #incident. Tier 1 returns its 40 subscribers in one lookup, tier 2 adds 3, and the 200 global subscriptions are never scanned. A naive relay would test all 5,000 filters.
A and B are members of #incident. C is global with no kind filter. D asked for kinds: []. Publish, then switch off the boundary to see the leak.
The tiers, the boundary and the empty-list rule are from the architecture document (Subscription System). "Boundary off" is not a Buzz setting; it shows the design Buzz rules out.
The boundary is the rule that holds privacy: global subscriptions never receive channel events, even when their filter matches. A filter is a request. Membership is the permission.
One more empty-or-absent trap from NIP-01. kinds: [] matches nothing. A filter with no kinds key matches every kind. Mix them up and you either silence a reader or flood one.
The failure. Symptom: a non-member sees a few private messages. Measure: open a REQ on a private channel as a non-member and count EVENT frames before CLOSED. Fix: check membership before you register the subscription. Buzz's REQ handler does this, so no window exists.
Chapter 6
Schedule @mentions onto a pool of agents with buzz-acp, and see what the one-prompt rule buys
Five people @mention the agent in #incident within a minute. If each mention starts its own prompt, five copies race with five partial views of the talk. Buzz's harness, buzz-acp, prevents this.
ACP, the Agent Client Protocol, is JSON-RPC over stdin and stdout. Any agent that speaks it can sit behind Buzz. The rules: queue mentions per channel; allow at most one prompt in flight per channel; batch everything queued into the next prompt.
How many prompts run at once? Call the pool size N and the number of channels with waiting mentions C.
In flight equals the minimum of N and C.
Each waiting channel needs one agent. Each agent serves one channel. So the count is whichever runs out first: agents N or channels C.
With made-up load: N = 4 and C = 6 gives min(4, 6) = 4 prompts; 2 channels wait. With N = 4 and C = 2, 2 prompts run and 2 agents idle.
Add mentions, then Tick. A tick finishes running prompts, then gives idle agents to waiting channels. Shrink the pool to 1.
The queue, batch and one-in-flight rules are from the architecture document (buzz-acp). The tick is a toy clock; real prompts finish when the agent answers.
Buzz also ships its own agent pair. buzz-agent speaks ACP and runs up to 8 sessions by default. buzz-dev-mcp is an MCP server with a shell and a file editor. Each session gets its own MCP server. Output is bounded, a timeout kills the whole process group, and a full context summarizes itself.
The failure. Symptom: "stop the deploy" waits while a long prompt runs in that channel. Measure: time from mention to first reply. Fix: the one-prompt rule trades latency for one coherent answer, so urgent work needs its own channel or a cancel.
Chapter 7
Run a frontier agent and three cheap workers through a channel, and compare it with a private prompt
Once agents are members with keys, a pattern follows. The launch post's author writes: "I often have one frontier agent driving a swarm of cheaper, faster agents." A frontier agent is the most capable and most costly model. "The smart one keeps the big picture in context."
The workers take narrow tasks: research, build, test. The frontier agent sends them work with ordinary @mentions in the channel. There is no separate orchestration API. Coordination is more signed events.
Press Step. F sends work to three purple workers, they answer, F decides. Press Redirect while they work. Then switch to a private prompt.
The pattern and the quotes are from the launch post. The bug, the tasks and the messages are illustrative.
Count the record. One mention, three dispatches, three results and one decision: 1 + 3 + 3 + 1 = 8 signed events in the channel. A private orchestrator leaves 2: the request and the answer. The other 6 live in one context window and vanish with it.
The post gives two reasons to pay for the 8. People "redirect the work while it's happening instead of waiting for a beautifully formatted wrong answer." And "the visible history keeps the failed paths and the reasons behind the final call."
The failure. Symptom: a chatty swarm buries the people in the channel. Measure: events per decision. Fix: post milestones and results to the channel, and keep scratch work inside each worker. This trade-off is our reading, not a Buzz rule.
Chapter 8
Write a workflow, see every limit that stops a bad one, and watch the engine refuse extra runs
"When someone posts a P1, tell #incidents" needs no model. It must run every time, fast and for free. That is buzz-workflow: automation in YAML, triggered from pipeline step 11.
yamlname: "Incident Triage" trigger: on: message_posted # also: reaction_added, schedule, webhook filter: "str_contains(trigger_text, 'P1')" steps: - id: notify action: send_message text: "P1 incident detected: {{trigger.text}}" - id: page if: "str_contains(trigger_text, 'production')" action: request_approval # not wired end to end yet from: "{{trigger.author}}" message: "Page on-call?"
| Part | Limit |
|---|---|
| Condition | An evalexpr expression with a 100 ms timeout. |
| Template | One pass; output is never scanned again. |
call_webhook | No private addresses, no redirects, 1 MiB response. |
delay | 300 seconds at most. |
schedule | The cron loop ticks every 60 seconds. |
| Inbound webhook | The secret is compared in constant time. |
| Concurrency | 100 permits; extra runs fail at once. |
Seven actions exist: send_message, add_reaction, call_webhook, request_approval, delay, send_dm and set_channel_topic. The last two return "not implemented" today.
What happens in a burst? Call the runs that try to start at once n, and the permits P = 100.
R equals the maximum of zero and n minus P.
The first P runs each take a permit. The engine refuses every run after that at once. There is no queue.
With a made-up burst of n = 130: 100 runs start and R = max(0, 30) = 30 fail. With n = 80, R = 0.
Each square is one permit. Drag the burst past 100. Then compare with a queue, which Buzz does not use.
The 100 permits and the immediate refusal are from the architecture document. The 2 second run time in the queue view is illustrative.
The failure. Symptom: a run that reaches request_approval ends as Failed. Measure: read the run's status. Cause and fix: the engine does not yet store the approval token or resume, a gap the document lists as WF-08. Keep approval steps out of production workflows for now.
Chapter 9
Chain audit entries so an edit shows, then see how Buzz lets many agents push at once
Signatures prove who did each thing. A workspace full of agents also needs to prove what happened, in what order, with nothing removed. That is the audit log, filled by pipeline step 10.
Each entry has fields: sequence number, timestamp, event id, kind, actor key, action, channel id and metadata. Call entry n's fields fn and its hash hn. Each hash also covers the hash before it.
h-n equals SHA-256 of f-n joined to h-n-minus-one, and h-zero is sixty-four zeros.
Write entry n's fields f-n as bytes. Append the previous hash h-n-minus-one. Hash the lot to get h-n. To verify, walk from the start and recompute every hash.
Our toy chain of three entries gives d32db9fb, d580d5a9, ed7de7d8. Change entry 2's kind from 7 to 9 and it hashes to 406dd091, which no longer matches.
Play the attacker in three levels. Each level hides more. Watch which check fails.
Real SHA-256, computed in your browser over Buzz's field order. Text fields are hashed as UTF-8 and the channel as 16 UUID bytes; that byte choice is ours, so these hashes are not Buzz's own.
One chain has one latest hash, so appends must go one at a time. Buzz takes a Postgres advisory lock per community for each append. It never logs login events or ephemeral events: presence blips would bloat the chain and prove nothing.
The post warns that a swarm "can produce human-months of commits and CI runs in an afternoon, with many writers pushing at once." So Buzz stores repositories "as immutable, content-addressed packfiles plus one mutable manifest pointer." A push writes its objects first. Then it moves the pointer with a compare-and-swap: set it to M4 only if it still says M3. The loser of a race reads M4 and retries. Block specified this protocol in TLA+ and model-checked it.
The failure. Symptom: an insider rewrites the chain from entry 2 onward and it verifies. Measure: compare the head hash with a copy stored elsewhere. Fix: a chain is tamper-evident, not tamper-proof, so publish the head hash outside the database.
Chapter 10
Keep the numbers, the core code, the known gaps and the next lessons in one place
Buzz is one Rust relay in front of Postgres, Redis and object storage. Every person, agent, workflow and git push writes the same six-field signed event. An eleven-step pipeline checks each event. A three-tier registry delivers it behind a membership boundary. An agent harness runs one prompt per channel, and a hash chain makes the history tamper-evident.
| Term or number | Meaning |
|---|---|
| Event id | SHA-256 of [0, pubkey, created_at, kind, tags, content]. |
| Kind bands | 0 stored, 1 replaceable, 2 ephemeral, 3 per parameter, 4 Buzz. |
| NIP-42 window | ±60 s on the login event's time. |
| NIP-OA grant | Owner-signed auth tag; all clauses must hold. |
| Wire limits | 65,536 byte frames, 1,024 subscriptions, 500 stored events per filter. |
| Timers | Ping 30 s, drop after 3 misses (90 s); presence key 180 s. |
| Slow client | 3 full sends in a row, then cancel. |
| Handler slots | 1,024 for EVENT and REQ across all connections. |
| buzz-acp | Pool of 1 to 32; one prompt per channel. |
| buzz-agent | Up to 8 sessions by default, one MCP server each. |
| Workflows | 4 triggers, 7 actions, 100 permits, 100 ms conditions. |
| Audit | SHA-256 chain from 64 zeros; 10 action types. |
pythonimport hashlib, json def event_id(pubkey, created_at, kind, tags, content): s = json.dumps([0, pubkey, created_at, kind, tags, content], separators=(',', ':'), ensure_ascii=False) return hashlib.sha256(s.encode()).hexdigest() def band(kind): # 0 stored, 2 ephemeral, 4 Buzz ... return kind // 10000 def filters_match(filters, ev): # OR across filters, AND inside one def one(f): if 'kinds' in f and ev['kind'] not in f['kinds']: return False # kinds: [] matches nothing if 'authors' in f and ev['pubkey'] not in f['authors']: return False return True # an absent key matches all return any(one(f) for f in filters) def chain_hash(fields: bytes, prev_hex: str) -> str: return hashlib.sha256(fields + prev_hex.encode()).hexdigest() def verify_chain(entries): # entries: [(fields, prev, h), ...] prev = '0' * 64 for i, (fields, stored_prev, h) in enumerate(entries, 1): if stored_prev != prev or chain_hash(fields, prev) != h: return i # first broken entry prev = h return None
| Gap | Detail |
|---|---|
| Rate limits | Four tiers are designed (human, agent-standard, agent-elevated, agent-platform); none is enforced. |
| Approval gates | Runs that reach one are marked Failed (WF-08). |
| Two actions | send_dm and set_channel_topic return "not implemented" (WF-07). |
| SQL checks | Queries are checked at run time, not compile time. |
| Huddles | Voice works; recording is not built. |
Now press Present or Teach and explain from memory. How does an event get its id? How does an agent get rights without its owner's key? Where does the client hear OK? Then go back to the hero and publish each sender again. Name the gate that decides each one.
Block, Inc. builds Buzz and releases it under Apache 2.0 at github.com/block/buzz. The facts on this page come from its ARCHITECTURE.md, VISION_AGENT.md, NIP-OA and the launch post. The explanations, toys and devices are ours.