---
title: "Sync and Network Consensus"
description: "Design-level overview of how Nimiq nodes synchronize with the blockchain, across all node types and sync modes."
canonical_url: "https://nimiq.dev/protocol/node-sync"
---
# Sync and Network Consensus

> Design-level overview of how Nimiq nodes synchronize with the blockchain, across all node types and sync modes.

Nimiq implements a **two-phase synchronization architecture** that separates epoch-level state synchronization from real-time block processing. This design enables efficient sync strategies tailored to different node capabilities.

All nodes follow a **two-phase synchronization pattern**: **macro sync** followed by **live sync**. During macro sync, nodes download and verify macro blocks (checkpoints/epochs) to reach the current network state efficiently. Once macro sync completes, nodes transition to live sync to receive and validate the latest micro blocks in real-time. This modular approach allows each node type to optimize for its specific use case.

## Sync Comparison Table

<table>
<thead>
  <tr>
    <th>
      
    </th>
    
    <th>
      <strong>
        History Node
      </strong>
    </th>
    
    <th>
      <strong>
        Full Node
      </strong>
    </th>
    
    <th>
      <strong>
        Light Node
      </strong>
    </th>
    
    <th>
      <strong>
        Pico Node
      </strong>
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Verification
      </strong>
    </td>
    
    <td>
      Entire chain + full history
    </td>
    
    <td>
      Full blocks and state
    </td>
    
    <td>
      Election-header chain (validator BLS signatures)
    </td>
    
    <td>
      Trust-based (peer-reported state)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Macro Sync Method
      </strong>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/macro-sync/history-macro-sync">
        History Macro Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/macro-sync/light-macro-sync">
        Light Macro Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/macro-sync/light-macro-sync">
        Light Macro Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/macro-sync/pico-macro-sync">
        Pico Macro Sync
      </a>
      
      *
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Live Sync Method
      </strong>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/live-sync/block-live-sync">
        Block Live Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/live-sync/state-live-sync">
        State Live Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/live-sync/block-live-sync">
        Block Live Sync
      </a>
    </td>
    
    <td>
      <a href="https://nimiq.dev/protocol/node-sync/live-sync/block-live-sync">
        Block Live Sync
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Consensus Level
      </strong>
    </td>
    
    <td>
      Fully verified
    </td>
    
    <td>
      Verified
    </td>
    
    <td>
      Verified
    </td>
    
    <td>
      Trust-based
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Fallback
      </strong>
    </td>
    
    <td>
      N/A
    </td>
    
    <td>
      N/A
    </td>
    
    <td>
      N/A
    </td>
    
    <td>
      *Falls back to <a href="https://nimiq.dev/protocol/node-sync/macro-sync/light-macro-sync">
        Light Macro Sync
      </a>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Sync Speed
      </strong>
    </td>
    
    <td>
      Slower, full chain from genesis
    </td>
    
    <td>
      Efficient, grows with chain length
    </td>
    
    <td>
      Fast, election headers only
    </td>
    
    <td>
      Fastest, based on peer responses
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Web Client
      </strong>
    </td>
    
    <td>
      Not supported
    </td>
    
    <td>
      Not supported
    </td>
    
    <td>
      Supported
    </td>
    
    <td>
      Supported
    </td>
  </tr>
</tbody>
</table>

### History Nodes

- Complete blockchain history from genesis
- Deep chain queries, historical analysis, and serving data to other nodes
- Can act as validators and provide historical data to the network
- Serve data to other nodes, validate transactions and produce blocks (if validator)
- Rely on other history nodes for initial sync

### Full Nodes

- Complete current state with pruned history - maintains full validation capability
- Serve data to other nodes, validate transactions and produce blocks (if validator)
- Rely on full or history nodes for initial sync

### Light Nodes

- Election block headers (verified via validator BLS signatures) and subsequent micro block headers only
- Transaction verification and sending with cryptographic security guarantees
- Browser/mobile deployment, web client integration (WASM support)
- Rely on full or history nodes for data availability

### Pico Nodes

- Sync with the latest election block only (no historical data; trust-based)
- Ultra-fast startup with trust-based consensus and automatic fallback to trustless sync
- Development environments, testing, and trusted network scenarios
- Rely on full or history nodes for data availability and fallback verification

### Service Nodes

**Validator Nodes**:
Produce blocks and participate in consensus. Any node with a minimum of 100'000 NIM deposit that runs a full or history client can become a validator.

## Architecture Components

**Coordination Layer**: `Consensus` and `Syncer` components manage sync lifecycle and peer relationships, enabling seamless transitions between sync phases.

**Pluggable Strategies**: `MacroSync` and `LiveSync` trait implementations allow optimization for different resource constraints.

**Network Layer**: Request/response and gossip protocols with async streams for efficient concurrent peer processing.

**Queue Architecture**: Automatic peer rotation, retry logic, and backpressure control ensure reliable data retrieval.

<u-page-grid>
<u-page-card description="Core components, data flow, and design patterns that enable efficient sync coordination." icon="i-lucide-layout-dashboard" title="Architecture" to="https://nimiq.dev/protocol/node-sync/architecture" variant="outline">



</u-page-card>

<u-page-card description="Core traits, components, and architectural patterns in the sync system." icon="i-lucide-puzzle" title="Traits & Abstractions" to="https://nimiq.dev/protocol/node-sync/traits-and-abstractions" variant="outline">



</u-page-card>

<u-page-card description="Node requests and responses for syncing." icon="i-lucide-network" title="Network Protocol" to="https://nimiq.dev/protocol/node-sync/network-protocol" variant="outline">



</u-page-card>
</u-page-grid>

## Further Reading

**Understanding the System**

- [Architecture](https://nimiq.dev/protocol/node-sync/architecture) - Core components, data flow, and design patterns
- [Node Sync System](#node-sync-system) - Node lifecycles and sync mode selection

**Implementation Details**

- [Traits and Abstractions](https://nimiq.dev/protocol/node-sync/traits-and-abstractions) - System design and component coordination
- [Network Protocol](https://nimiq.dev/protocol/node-sync/network-protocol) - Message specifications and communication patterns

**Sync Strategy Deep Dives**

*Macro Sync Strategies:*

- [History Macro Sync](https://nimiq.dev/protocol/node-sync/macro-sync/history-macro-sync) - Full chain download for history nodes
- [Light Macro Sync](https://nimiq.dev/protocol/node-sync/macro-sync/light-macro-sync) - Trustless macro sync for full and light nodes
- [Pico Macro Sync](https://nimiq.dev/protocol/node-sync/macro-sync/pico-macro-sync) - Optimistic sync with automatic fallback

*Live Sync Strategies:*

- [Block Live Sync](https://nimiq.dev/protocol/node-sync/live-sync/block-live-sync) - Real-time block synchronization
- [State Live Sync](https://nimiq.dev/protocol/node-sync/live-sync/state-live-sync) - Complete state maintenance for full nodes

## Sync Lifecycle

When a node starts, it follows this coordination pattern:

1. **Peer Discovery** through the network layer
2. **Macro Sync Strategy Sync** based on node configuration
3. **Live Sync Transition** to maintain real-time synchronization
4. **Consensus Detection** through peer agreement analysis

The `Consensus` component orchestrates this process, while the `Syncer` manages strategy-specific implementations through pluggable trait interfaces.

<callout icon="i-tabler-bulb">

**Developer Focus**

This documentation targets developers working on sync logic and node implementations.

For node operation, see the [Node Setup Guide](https://github.com/nimiq/core-rs-albatross?tab=readme-ov-file#README).

</callout>


## Sitemap

See the full [sitemap](https://nimiq.dev/sitemap.md) for all pages.
