/docs/mesh-gossip
Mesh gossip (Phase 2)
Phase 2 of the IICP protocol adds a gossip mesh layer that lets nodes discover each other peer-to-peer, reducing reliance on the central directory for ongoing connectivity. This page explains how the gossip protocol works and documents the two Phase 2 directory endpoints.
How it works
- Bootstrap — when a node starts cold (no known peers), it calls
GET /api/v1/bootstrapto get an initial list of recently-active nodes from the directory. This seeds the peer list so the node can begin gossiping. - Peer exchange — every 30 seconds, the node submits its known peers to
POST /api/v1/peersand receives a fresh list of peers it doesn't already know. This gradual exchange propagates peer knowledge across the mesh without requiring any node to maintain a full view. - Stale prune — peers not seen within 90 seconds are removed from the local peer table. This prevents ghost peers from accumulating and biasing gossip routes.
- Persistence — the peer list is persisted to disk so nodes can reconnect after a restart without always falling back to bootstrap.
GET/api/v1/bootstrap
Returns a seed list of recently-active peers. No authentication required. Called by nodes on cold start before any peers are known. Returns only nodes seen within the last 90 seconds (3× the heartbeat interval).
Query parameters
| Parameter | Description |
|---|---|
| limit | Max peers to return (optional, default: 5) |
curl -sf 'https://iicp.network/api/v1/bootstrap?limit=5'
{
"peers": [
{
"node_id": "550e8400-e29b-41d4-a716-446655440000",
"endpoint": "https://node.example.com:9484",
"region": "eu-central",
"last_seen": "2026-05-22T15:00:19Z"
}
],
"count": 1
}POST/api/v1/peers
Directory-side peer exchange. Nodes submit their current known peers and receive new peers they don't already know. Authenticated with the node's bearer token (issued at registration). Returns up to 10 peers not in the known list.
Auth
Authorization: Bearer <node_token> — the token issued to the node at registration (the same NodeTokenAuth scheme as the other node-authenticated endpoints). Unauthenticated requests return 401.
Request body
{
"known_peers": [
"550e8400-e29b-41d4-a716-446655440000",
"6ba7b810-9dad-11d1-80b4-00c04fd430c8"
]
}Response 200
{
"peers": [
{
"node_id": "...",
"endpoint": "https://...",
"region": "eu-west",
"last_seen": "2026-05-22T15:00:19Z"
}
],
"count": 3
}| Limit | Value |
|---|---|
| Max known_peers submitted | 20 |
| Max peers returned | 10 |