agorix
AirdropMarketsCollectionsLeaderboardActivity
Agorix · Decentralized Marketplace
Independent · Resilient · Community-Run

A cross-chain marketplace, run by the community.

Discover, list, and trade across Bitcoin, Ethereum, and Solana on an open, community-run network.

Marketplace
CollectionsMarketsLeaderboardActivity
Network
GovernanceExplorerAirdropDocs
Account
ProfileSettings
Legal
Terms of ServicePrivacy PolicyYour Privacy Choices
agorix.io — Lasting Access
CID: 0xA60R1X · v0.1
AirdropMarketsCollections
D
Protocol Docs
Protocol TruthWitness Selection & AttestationEvent System & GossipWire ProtocolReward Pool and Epochs
Docs/Protocol/Event System & Gossip
Protocol

Event System & Gossip

The gossip protocol and event-driven state replication. All 46 event types, signing, propagation, sync, and data retention.

#Event System & Gossip Protocol

The event system is the backbone of the network. Every state change -- listings, purchases, attestations, governance votes, MPC ceremonies, everything -- is captured as a signed protocol event and replicated across all nodes via gossip. The event log is the single source of truth. Database tables are materialized views over the event stream.

#Event Structure

Every protocol event follows a common envelope:

typescript
interface ProtocolEvent {
  id: string;           // UUIDv4, unique per event
  kind: EventKind;      // One of 46 event types
  actor: string;        // Ed25519 public key of the emitter
  payload: Record<string, unknown>; // Event-specific structured data
  signature: string;    // Ed25519 signature (hex-encoded)
  timestamp: number;    // Unix milliseconds (UTC)
  hash: string;         // SHA-256 of canonical JSON payload
  protocolVersion: string; // "mvp-1"
}

#Event Signing

Every event is signed by the emitting node's Ed25519 key. The signing process:

  • Serialize the event payload (excluding signature and hash) to canonical JSON (sorted keys, no whitespace).
  • Compute the SHA-256 hash of the canonical JSON bytes.
  • Sign the hash with the node's Ed25519 private key.
  • Attach both the hash and signature to the event.

Any node can verify any event by re-canonicalizing the payload, recomputing the hash, and checking the signature against the actor's known public key. Tampered events are detected and discarded.

#All 46 Event Types

#Agent Events (3)

KindDescription
AGENT_ANNOUNCENode announces itself to the network with its capabilities, version, and endpoints
AGENT_REGISTERNode formally registers and bonds stake to become an active participant
AGENT_HEARTBEATPeriodic liveness signal broadcast to neighbors (default: every 30 seconds)

#Marketplace Events (9)

KindDescription
LISTING_CREATEA new listing is published (includes asset data, price, expiration)
LISTING_DELISTSeller removes a listing. Names the listing and carries the seller's proof (their wallet signature for that listing, or their cancel transaction on an EVM chain), which every node checks before it stores the event
ORDER_INTENTBuyer declares intent to purchase (pre-session)
BTC_PURCHASE_SUBMITTEDA Bitcoin purchase transaction has been broadcast
EVM_PURCHASE_SUBMITTEDAn EVM-chain purchase transaction has been broadcast
SOL_PURCHASE_SUBMITTEDA Solana purchase transaction has been broadcast
TX_OBSERVEDA witness observes the transaction on-chain
TX_ATTESTATIONA witness signs and publishes their validation verdict
TX_FINALIZEDSupermajority reached -- transaction is settled

#Governance Events (10)

KindDescription
MISBEHAVIOR_PROOFEvidence of witness misbehavior (wrong attestation with proof)
RUNTIME_CONFIG_VOTE_CASTNode votes on a governance parameter change
NODE_FEE_WALLETS_UPDATEDNode updates its fee-receiving wallet addresses
NODE_STAKE_UPDATEDNode's staked amount has changed (deposit or withdrawal)
NODE_BENCHMARK_SUBMITTEDNode publishes its benchmark results for performance ranking
NODE_DELEGATE_STATUS_CHANGEDNode toggles its delegate availability on or off
NODE_DELEGATION_CHANGEDA delegator assigns or revokes delegation to a delegate
REWARD_CLAIM_CREATEDA reward claim is initiated for earned fees
REWARD_CLAIM_SIGNEDThe MPC wallet co-signs a reward claim payout
MODERATION_VOTE_CASTNode votes on a content moderation action
FOUNDATION_TREASURY_TXFoundation executes a treasury transaction (fully transparent)

#MPC Ceremony Events (11)

KindDescription
MPC_CEREMONY_PREPARECoordinator initiates a new DKG or signing ceremony
DKG_COMMITMENTParticipant publishes their Feldman VSS commitment
DKG_SHARE_EXCHANGEParticipant distributes encrypted key shares to peers
DKG_VERIFICATIONParticipant confirms received shares are consistent
CEREMONY_FINALIZEDDKG complete -- public key derived, shares distributed
SIGN_NONCE_COMMITSigning participant commits to a nonce (hash of R-value)
SIGN_NONCE_REVEALSigning participant reveals their actual nonce
SIGN_PARTIALSigning participant contributes their partial signature
RESHARE_OLD_SHAREExisting holder re-shares their key material to updated set
CLAIM_EPOCH_UPDATEDReward claim epoch boundary has advanced
TREASURY_SPEND_PROPOSEDA treasury spend is proposed for governance approval

#Realtime Events (4)

KindDescription
PROFILE_ANNOUNCEDUser announces or updates their public profile
CHAT_THREAD_OPENEDA new direct-message thread is opened between buyer and seller
NODE_MESH_PINGLow-level mesh connectivity probe between neighbors
RATE_LIMIT_VIOLATIONNode detected and logged a rate-limit breach from a peer

#Release Events (1)

KindDescription
RELEASE_MANIFEST_SEENNode has observed and validated a new release manifest

#Session Events (3)

KindDescription
SESSION_COMMITPurchase session is committed with buyer intent and timestamp
UI_SESSION_QUOTEUI agent produces a signed quote for the session
UI_SESSION_ATTESTATIONUI agent attests to the session parameters it served

#Gossip Propagation

Events propagate through the network using a push/pull model:

Push (WebSocket): When a node creates or receives a new valid event, it immediately pushes a 33-byte notification to all connected neighbors via the binary wire protocol (0x04 EVENT_NOTIFY + 32-byte hash). Neighbors that do not have the event pull the full payload.

Pull (HTTP fallback): Nodes that missed push notifications (due to disconnection, restart, or partition) catch up via HTTP sync:

text
GET /api/gossip/sync?since=<timestamp>&limit=250

Sync is paginated at 250 events per page. The response includes a nextCursor for continuation. Nodes can filter by event kind to prioritize critical events during catch-up.

Pull on reconnect: When a node reconnects to a neighbor, it immediately initiates a sync from its last-known cursor. This ensures no events are lost during network partitions.

#Data Retention Tiers

Not all events are stored forever. The protocol defines three retention tiers:

Tier 1 -- Permanent: Events that define protocol state and must be replayable forever.

  • LISTING_CREATE, LISTING_DELIST
  • TX_ATTESTATION, TX_FINALIZED
  • All governance events (votes, stake changes, config changes)
  • All MPC ceremony events
  • FOUNDATION_TREASURY_TX
  • MISBEHAVIOR_PROOF

Tier 2 -- Retention-bounded: Events kept for a configurable retention window (default: 90 days), then pruned.

  • ORDER_INTENT
  • BTC/EVM/SOL_PURCHASE_SUBMITTED
  • TX_OBSERVED
  • SESSION_COMMIT, UI_SESSION_QUOTE, UI_SESSION_ATTESTATION
  • REWARD_CLAIM_CREATED, REWARD_CLAIM_SIGNED

Tier 3 -- Ephemeral: Events used for real-time coordination only. Not persisted after processing.

  • AGENT_HEARTBEAT
  • NODE_MESH_PING
  • RATE_LIMIT_VIOLATION
  • PROFILE_ANNOUNCED
  • CHAT_THREAD_OPENED

#Event Projection

Events are projected into materialized state tables. The event log is always authoritative -- if a table disagrees with the event log, the table is wrong and must be rebuilt:

text
Event Log (source of truth)
  |
  v
Projectors
  |
  +---> Listing state (OPEN, SOLD, DELISTED, EXPIRED)
  +---> Order state (PENDING, ATTESTING, FINALIZED, FAILED)
  +---> UTXO tracking (spent/unspent)
  +---> Node registry (active, suspended, banned)
  +---> Governance config (current parameter values)
  +---> MPC key state (ceremony status, share assignments)
  +---> Delegation graph (who delegates to whom)
  +---> Strike ledger (per-node misbehavior history)

#Replay

The entire protocol state can be reconstructed by replaying events from genesis. Deterministic replay means the same events always produce the same state, regardless of timing or order of receipt. The Rust node-core provides efficient batch replay:

text
POST /v1/events/replay
{
  "fromSequence": 0,
  "toSequence": "latest",
  "batchSize": 1000
}

#Foundation Transparency

All foundation actions -- treasury withdrawals, governance overrides, admin operations, parameter changes -- are signed protocol events gossiped to every node and visible in the public explorer. There is no off-chain authority. Everything is on the record, verifiable by anyone running a node.

PreviousWitness Selection & AttestationNext Wire Protocol

On this page

  • Event System & Gossip Protocol
  • Event Structure
  • Event Signing
  • All 46 Event Types
  • Agent Events (3)
  • Marketplace Events (9)
  • Governance Events (10)
  • MPC Ceremony Events (11)
  • Realtime Events (4)
  • Release Events (1)
  • Session Events (3)
  • Gossip Propagation
  • Data Retention Tiers
  • Event Projection
  • Replay
  • Foundation Transparency