Skip to content

Swarm Concepts

Node identity

A node has an Ed25519 key derived from its seed. The key authenticates its Hyperswarm connections and signs its attestations. An operator key signs a binding event that ties the operator to the node.

Topic and discovery

All nodes of a cluster join the topic SHA-256("hypernostr/topic/" + cluster) on the DHT. A firewall admits only the keys listed in NODES and L1_NODES, and refuses revoked ones.

Membership

Being listed in NODES lets a node connect. Writing needs a membership record signed by the admin key, which the admin node issues automatically when a listed node announces its writer key. Records carry an increasing sequence, so old records cannot be replayed. Revocation is permanent.

Order and finality

Each node appends to its own log. Autobase builds a graph of these logs and linearizes it. As indexers acknowledge, a prefix of the order becomes signed and can no longer change. That prefix is final.

Nodes append empty acknowledgements when progress stalls, with randomized delays, so an idle cluster still finalizes.

Deterministic state

The reducer is a pure function of the order: an event is verified again, ignored if it is a duplicate, superseded or deleted, and otherwise stored with its indexes. Every node therefore derives the same state from the same log, and a malicious writer cannot insert an event that does not verify.

Failure behavior

Situation Behavior
A node stops The others continue as long as a majority of indexers remains
Majority is lost Events are accepted and stored locally, and stay unfinalized until the nodes return
A node crashes Appended events are on disk. It catches up from the others
The sidecar is unavailable The relay refuses new events with error: replicated log is unavailable rather than accept an event it cannot replicate
A projection fails The aggregator retries and reports the error count in its status

Shards

Aggregation splits authors over shards by key hash, so writes of different authors do not wait for each other. All events of an author are in one shard, so replacement and deletion never cross shards.