Skip to content

System Specification

Peerborne runs the application and document replica on each device. GossipSub carries sync envelopes, Helia serves encrypted blocks, and direct streams carry messages such as invitations and load replies.

Select a flow or a component to trace its route. Each step links to the evidence for that decision.

Document engineOn device
Peer networkDirect / relay
On deviceIndependent trustPeer transport

Edit & sync

Default BeeKEM document · The sender emits two encrypted artifacts.

Apply local edit

The SDK applies the local CRDT edit. The editor can show it before persistence or publication finishes.

Seal envelope and CID block

The sender stores an encrypted change block by CID and seals a separate sync envelope.

Gossip update and fetch blocks

GossipSub announces the update. Peers fetch referenced blocks through Helia as needed.

Check local writers and merge

The receiver opens the envelope, checks current writer authorization when signing is enabled, and merges the admitted history.

Invite & revoke

Default BeeKEM document · Membership and key distribution have their own messages.

Pin issuer and enroll identity

The application authenticates the invitation issuer and keeps the receiving identity’s private keys on its device.

Bind offer, request and Welcome

An invitation binds the offer and request to the intended recipient. The Welcome is sealed for that recipient.

Classify signed PathUpdate

The receiver authenticates the writer and classifies the signed PathUpdate by generation and digest.

Apply removal and next epoch

An accepted next-epoch update can install new key material. Agreement across every replica’s ACL, load, and restart path remains open.

Coordinated write

Opt-in document · The provider and signed authority log share a pinned trust root.

Pin genesis and advance authority

Pinned genesis binds the signed authority history to the configured group-security provider.

Bind frame and check native targets

Admission binds the signed change to its document and author’s history, then checks the CRDT targets against granted field scopes.

Stage against live context

The CRDT stages changes in a detached session. The commit gate rechecks live context and authorization.

Commit and record publication

When journaling is enabled, accepted state and configured outbound publication records are retained for recovery.

Load & catch up

Default BeeKEM document · A challenge binds the response to the current load.

Resolve trusted writer commitments

Initial loading starts from independently trusted writer keys and security commitments.

Collect signed V4 responses

Peers return signed V4 responses over libp2p request streams. Quorum counts each eligible signing authority once.

Check manifest and fetch missing blocks

The loader checks the complete response manifest against the agreed digest and fetches missing blocks by CID.

Apply admitted history

The selected CRDT adapter applies the admitted history and exposes the local replica.

Restore BeeKEM

Default BeeKEM document · An optional commitment pins exact checkpoint bytes.

Export signed local checkpoint

The SDK exports a signed checkpoint, sealed under an application AES-GCM key. It holds document keys; the application stores it and never transmits it.

Preserve identity and current pin

For opt-in rollback protection, keep the current checkpoint commitment in storage independent of the checkpoint.

Authenticate checkpoint and compare pin

Restore checks the checkpoint signature and requires the exact expected commitment when a pin is supplied.

Continue from restored epoch

A fresh document can continue from the restored state and epoch. Revocation continuity across replicas remains open.

Restore journal

Coordinated journal · The rollback anchor sits outside the store it protects.

Restore identity and pinned genesis

Startup needs the retained device key and the application’s pinned genesis.

Compare journal and trusted anchor

Journal recovery compares the authenticated checkpoint with the independent rollback anchor.

Authenticate and replay retained state

Startup replays admissible entries and checks the anchor again before exposing recovered state.

Resume catch-up and publication

If configured, publication resumes from retained outbound records. Delivery depends on the transport.

Storage & release

Operational checks · Logical bounds, browser measurements and release gates answer different questions.

Protect live blocks during cleanup

Cleanup rechecks a live, unpinned lease before deleting an eligible block.

Measure resource and latency costs

Measure CRDT work, cryptography, storage, and transport separately for the chosen browser workload.

Check contracts, packages and advisories

CI verifies contracts and counterexample controls. Release validation audits packed dependencies outside this replica topology.

Mode Authority Local recovery
BeeKEM (default) Local writer ACL, authenticated BeeKEM membership messages and independently provisioned load commitments Encrypted blocks and signed checkpoints. An optional fresh, independently stored commitment binds checkpoint restore.
Coordinated (opt-in) Signed role history, pinned genesis and a configured group-security provider Optional authenticated journal with a device key and independent rollback anchor.
Label What it establishes
Proved contract The linked Dafny obligation checks the selected production TypeScript under its stated input domain. Runtime tests can cover the boundary that supplies those inputs.
Runtime evidence The linked properties, integration tests or checks exercise the named behavior under their recorded schedules and environments.
Trust assumption The claim depends on input supplied by the application, platform or cryptographic provider.
Open guarantee The linked evidence covers part of the path. The full stated guarantee still needs a proof or a platform check.

Review a proof by comparing the claim to the linked requires and ensures, then checking that the production caller establishes those preconditions. A domain witness demonstrates valid inputs. Counterexample controls check that selected broken variants fail. A passing solver result cannot establish that the contract captures all the behavior the application needs.

CI checks the proof units listed in the formal manifest. See the verifier and counterexample controlsand the runtime evidence catalog.

trustTrust assumption

Provision a trusted identity

Keep signing and KEM private keys on the device. Pin the issuer or authority through an authenticated channel before accepting state.

The application owns key custody and the initial trust binding. A libp2p Peer ID carries no document role.

Inspect evidence

coordinated-document-security.md

legacy-contentRuntime evidence

Encrypt and authorize BeeKEM sync

Store serialized changes as encrypted CID blocks. Publish a separate encrypted envelope and check its signature against current local writers when signing is enabled.

Signing defaults on, with a legacy opt-out. A local edit may become visible before persistence or publication succeeds.

Inspect evidence

peerborne-document.ts

gossip-receiveProved contract

Reserve capacity before handling a gossip frame

Share capacity between the ordinary listener and topic validator. Charge a work item and its ciphertext bytes before copying, decrypting, decoding, or queuing it. Keep the latest skipped frame of each of up to eight senders, holding a shared credit, once it decrypts under the current document key, and process it when a credit frees.

Proved The budget policy preserves count and byte bounds across finite histories. Runtime tests check the shared budgets, cutoff on close, and batches of up to four signature checks per verification.

Limits account for admitted and retained frames; retained frames are also bounded by sender count and the local byte budget, with one authentication check at a time. Native heap and wall time need measurement. Other skipped frames rely on a kept frame carrying their changes, or on later synchronization.

Inspect evidence

gossip-receive-admission.ts

invitationProved contract

Keep an invitation bound to its recipient

Authenticate the offer, request and acceptance. Bind a consumed acceptance to its original request and retire replay entries only after expiry.

Proved Accepted bindings survive every finite ledger history until expiration. Expired offers cannot be revived.

The model starts with authenticated requests and a process-local ledger. Authenticated bearer-link delivery and durable replay protection need separate evidence.

Inspect evidence

beekem-generationProved contract

Classify a BeeKEM transition

Advance only one generation. Ignore exact redelivery. For a same-generation conflict, check its predecessor and public tree commitment. Grow the tree by at most one leaf.

Proved For validated counters and a supplied digest match, the classifier recognizes exactly stale, duplicate, fork, next and gap. It enforces the configured leaf capacity.

Sender authentication and secret distribution need separate evidence.

Inspect evidence

beekem-continuationProved contract

Keep a BeeKEM epoch current through restore

Commit a signed PathUpdate only while its parent and writer set are current. An application may pin the exported checkpoint’s SHA-256 commitment in independent storage and supply it on restart.

Proved The guard admits the exact next generation only with current parent and writer inputs. A blanked leaf slot cannot be reused. Finite histories preserve both guarantees across restart when the authenticated checkpoint matches an independently trusted current pin.

The application must keep checkpoints encrypted, since they hold document keys and plaintext state, and keep the independent pin fresh. Peerborne Note and the password-manager example omit the SDK pin. Browser-app rollback protection and group-wide exclusion remain open.

Inspect evidence

document-checkpoint.ts

beekem-forkProved contract

Stop a replica that observes competing BeeKEM successors

After checking the current writers, stop the document on a signed claim at the current generation for the last accepted predecessor and a different validated public tree.

Proved The competing-epoch predicate requires all three conditions. Runtime properties exercise independently generated successors, signed competing removals, and a restored predecessor commitment.

Each document instance stops on observed evidence. The signed public tree alone gives no guarantee that the competing private epoch is usable. Automatic branch selection and old-document convergence remain open.

Inspect evidence

peerborne-document.ts

beekem-durable-forkProved contract

Keep a stopped BeeKEM document fenced across restart

When configured, persist a session lease before exposing the document. Quarantine after an authenticated fork. A remaining lease blocks restart if the write is interrupted.

Proved Finite histories preserve a quarantined record and prevent release by a stale or foreign lease. Runtime tests exercise restart after acknowledged and interrupted writes.

The application provides independent durable storage and an exact atomic compare-and-swap. An unclean shutdown can require explicit recovery onto a fresh path.

Inspect evidence

beekem-fork-quarantine.ts

beekem-replacementProved contract

Activate an approved replacement with fresh keys

Bind approval to the current logical locator, replacement identity and selected content. Stage the fresh document privately, then advance the application locator atomically.

Proved Modeled activation histories permit at most one successor for the pinned base. An exact retry after activation confirms the same receipt.

The application owns the recovery authority, private staging, recipient enrollment and independently protected atomic locator. This flow creates a new document path.

Inspect evidence

beekem-removalOpen guarantee

Carry a BeeKEM removal through every authority boundary

After an authenticated removal, a current replica should use the matching tree, key epoch and writer set together. Restart should preserve that decision.

Pinned founder restarts and new-epoch encryption have runtime coverage. The group-wide guarantee across tree transition, reader and writer ACLs, and loading remains open. Independently replicated ACLs can temporarily disagree.

Inspect evidence

peerborne-document.ts

coordinated-rosterProved contract

Bind signed document roles to decrypting membership

In the strict coordinated profile, verify that the signed roles and the provider’s authenticated member list match before exposing the document or accepting new content.

Proved The roster policy accepts equal lists within the size bound. An ID absent from an admitted authority roster is also absent from the matched provider roster.

The provider reports its actual decrypting membership. Replicas enforce the new roles after they receive both authenticated updates. Offline replicas can retain earlier keys and content.

Inspect evidence

coordinated-document.ts

key-secrecyOpen guarantee

Limit exposure across key epochs

Surviving members need fresh key material after removal. Previously shared keys and plaintext remain readable to the members who had them.

Forward secrecy, post-compromise security and exclusion across every key-distribution path remain open. Native cryptography and provider behavior are trust boundaries.

Inspect evidence

auth-subtlecrypto.ts

load-quorumProved contract

Load state from independently trusted authorities

Bind a V4 response to the challenge, document, trusted security context and complete response manifest. Count each eligible signing authority once.

Proved The tally counts the first eligible vote for each identity. Two distinct digests cannot both reach strict majority in the counted votes.

The tally assumes verified vote eligibility. Provisioning trusted commitments, peer availability and partial mutation on later I/O failure remain runtime boundaries.

Inspect evidence

controlProved contract

Extend an authenticated control head

Check the group context, parent head and action-specific epoch before applying a control transition. Reject a stale or mismatched base.

Proved The append policy checks the supplied parent, context and action-specific epoch. Accepted transitions preserve the epoch rule through finite histories.

A pinned controller and the group provider must authenticate the policy inputs. Recovery from an authenticated fork depends on explicit application authority.

Inspect evidence

authorityProved contract

Preserve signed role history

Bind each fresh control head to one controller. Later records must preserve the old head-to-controller bindings and advance the signed role history.

Proved Finite histories preserve old head-to-controller bindings and exclude heads introduced only by unsigned attempts.

The history model assumes current-controller authentication. The role log and provider’s decrypting roster must stay in agreement through provisioning and group transitions.

Inspect evidence

content-bindingProved contract

Bind every coordinated change to its document

Verify the content signature and AEAD context before admission. The signed sequence and parent hash connect the change to its author’s accepted history.

Proved Accepted finite histories extend each author’s hash and sequence prefix. Gaps, duplicates and conflicting parents do not extend it.

The model assumes validated context, signatures and author bindings. Provision a separate cryptographic group per document for confidentiality isolation.

Inspect evidence

field-scopeProved contract

Authorize native CRDT targets before apply

A restricted writer may touch only targets inside a granted segment path. Ancestor replacement requires an ancestor grant. A reader cannot author an accepted mutation.

Proved Accepted finite target histories cannot overlap a protected path disjoint from every grant.

The model assumes faithful target extraction. Generated properties exercise the bundled Automerge and Yjs adapters, including changes invisible in the rendered document.

Inspect evidence

staged-commitProved contract

Bind prepared changes to the current state

Prepare CRDT changes in a detached session. Reserve count and bytes, then check live authority and context at commit. A prepared change can commit at most once.

Proved Finite histories keep reservations within their count and byte bounds. At most one completion can commit a prepared change with matching context and authorization.

The model receives reservation and completion events. Native staging, cancellation and JavaScript scheduling require runtime checks.

Inspect evidence

block-reassemblyProved contract

Reassemble encrypted UnixFS files within read limits

Bound traversal and accumulated ciphertext. Check the complete ciphertext before deserializing changes.

Proved The reservation policy charges the exact admitted prefix. UnixFS assembly writes each admitted byte at most twice into its own buffers. A Chromium profile relaunch restores and edits a document with at least 50 MiB of encoded history.

The browser fixture restores an application-held checkpoint and supplies the signed missing history. Renderer memory and latency depend on the workload and device.

Inspect evidence

document-block-reader.ts

journal-restartProved contract

Restore coordinated state against a durable anchor

Authenticate the checkpoint, replay admissible entries, and recheck the independent rollback anchor. Expose the recovered document after activation verifies its signing identity and current authority.

Proved The exposure guard checks freshness at the final anchor observation and requires an authenticated current checkpoint or exact next checkpoint with a matching parent. Built-in IndexedDB recovery uses at most 147 logical journal row reads, excluding anchor-provider I/O.

The device key and independent anchor must survive restart. An in-memory anchor cannot detect rollback across process loss.

Inspect evidence

coordinated-catch-upProved contract

Merge a controller checkpoint into retained local state

Match current strict roles and epoch. Verify the controller’s response for the current document and the receiver’s request, then publish the native merge after journal acceptance.

Proved Receipt admission preserves existing heads and prevents a peer from seeding the requester’s sequence. Native scenarios exercise current-epoch recovery and restart.

The application retains identity and trust, supplies authenticated control and role delivery, and relays the messages. The snapshot payload is limited to 512 KiB and conflicting receipt prefixes require ordered redelivery.

Inspect evidence

coordinated-document.ts

publicationProved contract

Preserve accepted publication through journal updates

Retain publication entries bound to the accepted frame and checkpoint token. A failed or stale store update must preserve accepted entries.

Proved Finite store histories preserve accepted entries on failed or stale attempts. Publication count and byte totals stay within the configured bounds.

Platform storage and retry execution determine durability and delivery. This journal belongs to coordinated mode.

Inspect evidence

wire-budgetProved contract

Bound admitted parsing and response work

Check framed offsets and byte limits before copies. Bound graph admission and retain only live, authenticated sync-response requests within the replay budget.

Proved Offsets and retained chunks fit the frame budget. Work reservations cannot exceed their cap. Sync admission retains at most 46 replay entries in the checked history model.

The sync replay ledger belongs to a live BeeKEM document instance. Total heap, crypto cost and event-loop delay need separate measurement.

Inspect evidence

retentionProved contract

Keep retained and pinned blocks live

Select only deletable candidates, recheck a live unpinned lease before deletion and enter deletion at most once per attempt.

Proved Finite sweeps preserve initially protected blocks under fixed guards. A live unpinned lease is required to enter deletion, at most once per attempt.

The model assumes truthful protection and lease observations. Browser quotas, whole-history compaction and late-join availability require further evidence.

Inspect evidence

transportRuntime evidence

Exchange encrypted artifacts over peer links

GossipSub carries update envelopes and Helia serves encrypted blocks. The cross-NAT browser suite exercises a configured Circuit Relay path with distinct identities.

Transport identities, coordination metadata, timing and sizes remain visible. Delivery guarantees, mesh saturation and metadata anonymity remain open.

Inspect evidence

peerborne-document.ts

availabilityOpen guarantee

Recover after device storage loss

Secure recovery after eviction requires independently available identity, trust commitments and authenticated document state.

The browser scenario exercises storage eviction. Product-wide encrypted recovery following identity or anchor loss remains open. The application may install an explicit recovery authority.

Inspect evidence

EXECUTION.md

performanceOpen guarantee

Measure usable latency under load

Measure CRDT work, cryptography, transport and disk I/O separately with the workload, device and browser recorded.

Chromium records time to first edit after a 50 MiB restart. A main-thread frame budget, progressive hydration and scalable mesh fallback remain open.

Inspect evidence

feature-audit.md

releaseRuntime evidence

Require executable evidence before release

CI verifies the selected contracts and counterexample controls. The release workflow tests packed consumers and checks dependencies before publication.

The workflows provide evidence for the examined revision, dependencies and platforms. Release clearance requires a current successful audit and the applicable approval.

Inspect evidence

release.yml