Lesson 10: Monad's Network Layer
Embark on your journey to building production grade apps.
In the Architecture lesson, you learned that every blockchain's network layer does two jobs: peer discovery (finding other nodes) and node communication (talking to them). Simple to describe. The interesting question is how. Networking choices set the ceiling for how fast consensus can run, how the validator set can be structured, and how reliably blocks reach everyone.
This lesson is about how Monad's network layer works. No code. Just the mental model.
Why the network layer matters
You can design the cleverest consensus algorithm in the world. If the nodes running it can't find each other, can't reliably deliver messages, or can't keep up with each other's broadcasts, the algorithm is useless.
The network layer is the plumbing. Everything above it (consensus, execution, apps) depends on the plumbing working. When a chain advertises a block time, that number is fundamentally limited by how fast a block proposal can reach every validator and how fast their votes come back.
So networking choices aren't a detail. They're a constraint on everything above.
The design goal
Monad's network layer is built to deliver sub-second deterministic finality without compromising decentralization. The validator set is permissionless. Anyone with enough stake can become a validator, and validators aren't curated by a central party. What's different is how nodes find each other once they're in the set.
The earliest generation of programmable blockchains used a discovery model where nodes started from zero knowledge of the network and walked a distributed hash table to find peers. Blocks propagated through gossip, hopping node-to-node until saturation. That model fit a 12-second block budget comfortably. It established what's possible and surfaced the hard problems.
Sub-second finality is a different problem. Every millisecond of networking now matters, because the whole budget is 800ms. Discovery that takes seconds to converge doesn't fit. Gossip propagation with variable hop counts doesn't fit. The network layer has to be built to a tighter specification while keeping the validator set open.
Here's how Monad does it.
Bootstrap: seed addresses
When you start a Monad node, you begin with a configuration file and a set of preset seed addresses from the MonadBFT protocol. These are your initial connection points.
You know exactly who to talk to on startup. No walking a routing table, no waiting for peer discovery to converge. For a network whose consensus runs at 400ms block intervals, knowing your roster ahead of time is invaluable.
Peer discovery: the validator contact list
From the seed addresses, your node requests the validator contact list: a set of IP addresses and cryptographic signatures for the current validator set. Your node verifies the signatures, confirms each contact really is the validator it claims to be, and connects directly.
The contact list is structured, not foraged. Every node knows the full validator set and can reason about who should be talking to whom. The topology is predictable, which is what consensus needs to run at sub-second speeds.
How does a Monad node find its first peers?
Node communication: dedicated port, signed messages
Nodes communicate on a dedicated port. This matters for operational clarity: firewall rules, DDoS protection, and monitoring are simpler when traffic isn't multiplexed with a dozen other protocols.
Every message carries a digital signature proving the sender's identity. No message is trusted unless it's cryptographically authenticated by a known validator. This removes whole classes of attack that rely on anonymous message injection.
When your node is fresh and not yet synced, block headers start arriving immediately, but your node buffers them rather than acting on them. As soon as your state catches up, you can apply the buffered headers without missing anything.
Catching up: state sync and block sync
A node that's behind the tip has two ways to catch up, and which one it uses depends on how far behind it is.
State sync is for nodes that are far behind, or starting fresh. Your node downloads state snapshots from synced peers: account balances, contract storage, contract bytecode. This gets you from "know nothing" to "know everything as of some recent block" quickly. You're copying the answer rather than replaying history to compute it.
Block sync is for nodes that are only a few blocks behind the tip. In that case, running state sync again is overkill. It's faster to just request the handful of missing blocks directly and apply them. Block sync also handles recovery from individual missed blocks, for example when a validator drops one due to packet loss.
Replaying every block since genesis would be prohibitive at Monad's throughput. The two-tool approach, snapshots when you're far behind and direct block requests when you're close, is the right shape for a high-throughput chain.
Why does Monad use state sync plus block sync instead of replaying every historical block?
RaptorCast: solving the leader bandwidth problem
Here's the hard problem every high-throughput chain has to solve.
During consensus, a single validator takes turns as the leader. The leader proposes a block, which every other validator needs a copy of to vote. On Monad, the leader changes every 400 milliseconds.
The naive approach: the leader sends the full block (potentially 2MB) to every validator directly. That doesn't scale. With a few hundred validators, the leader would need to push hundreds of megabytes in under 400ms. Even on fast connections, that's a bottleneck.
Monad's solution is RaptorCast. Instead of sending the whole block to each validator, the leader:
- Erasure-codes the block into thousands of small chunks. Erasure coding means the block can be reconstructed from any sufficiently large subset of chunks. If you create 1,000 chunks, any 600 of them are enough to rebuild the original.
- Distributes chunks in a two-level fan-out. The leader sends chunks to a first tier of validators. Each first-tier validator forwards the chunks they received to the next tier. One source, many helpers. Similar in spirit to how a CDN distributes a large file.
The effect: the leader's bandwidth cost is shared across the whole validator set instead of concentrated on one machine. No single node is the bottleneck. Sub-second block times become possible without requiring each validator to have unreasonable upload bandwidth.
RaptorCast sits at the boundary of networking and consensus. It's how block data physically moves from leader to everyone within the time budget MonadBFT needs.
What problem does RaptorCast solve?
A transaction's journey through the network
Let's put the pieces together by following one transaction from your wallet to finalized state.
- Submission. You sign a transaction in your wallet and send it to an RPC endpoint. The RPC node accepts your tx and forwards it into the network.
- Reaches the leader. The tx flows to the validator currently acting as leader. Leaders rotate every 400ms via MonadBFT.
- Leader proposes a block. When the leader's turn begins, they bundle pending transactions (yours included) into a block proposal.
- RaptorCast distributes the block. The leader erasure-codes the block into chunks and sends them out in a two-level fan-out. Within a fraction of the 400ms window, every validator has enough chunks to reconstruct the full block.
- Validators vote. Each validator verifies the block and signs a vote, sent over the dedicated networking channel to the next leader.
- Two rounds of voting. MonadBFT takes two rounds of voting to finalize, which lands inside 800ms.
- Execution (asynchronous). While consensus agrees on block N+1, your transaction inside block N is executed by the execution layer, which updates state in the background.
- Final. Roughly 800ms after it hit the leader, the block containing your tx is finalized and cannot be reverted.
Each step relies on the network layer working well. The plumbing is what makes the timing budget possible.
Recap
Every blockchain network layer does two jobs: peer discovery and node communication. How it does them sets the pace of everything above.
Monad's answer:
- Seed-address bootstrap so nodes know who to contact on startup.
- Signed validator contact list so topology is structured and predictable.
- Dedicated port with signed messages so node-to-node traffic is authenticated and operationally clean.
- State sync plus block sync so nodes can catch up to the tip without replaying history.
- RaptorCast so a leader can deliver a block to the full validator set inside a 400ms window.
Each of these is the answer to a specific question sub-second finality forces you to answer. Put them together and the consensus layer above has the physical delivery guarantees it needs to hit 800ms finality. Without this layer, the performance numbers the rest of the course is built on wouldn't be achievable.
What's Next
That closes out the "how Monad works under the hood" stretch of this track. From here the focus flips back to the app you're building on top. Next up: Payments (Crypto) — adding the one thing every real product needs, a way to accept money.
0/3 correct
0% — get all correct to complete