Nodes and the network
Suggest an editEvery lesson so far has referenced "nodes" doing things. A node is a piece of software running the blockchain's protocol, and the network is the set of nodes all running the same software at the same time, talking to each other. A blockchain has no server, so the nodes have to do the server's work themselves.
A node stores the chain, checks new data and passes it on
At the simplest level, a node is a program. It runs on a computer somewhere in the world. It connects to other instances of the same program running on other computers. Together, they form the network that maintains the blockchain.
A node does four things, all of the time. It holds a copy of the data the network has agreed on, which usually includes the whole history of the chain or some pruned version of it. It listens for new data from other nodes: new blocks proposed, new transactions broadcast, new connection requests from peers it hasn't met before. It validates everything it receives against the rules of the protocol. And it forwards the things it accepts to other nodes it's connected to, so that valid information propagates across the whole network within seconds.
A node validates before it forwards: if something doesn't follow the rules, the node rejects it and refuses to relay it further, so invalid data stops at the first honest node it reaches. A network of nodes that forwarded without checking would spread whatever anyone sent it.
Every node on every blockchain does some version of those four operations. The variations between blockchains are in what counts as "valid" and what the data looks like.
Nodes differ in how much they store and verify
Not every node does the same amount of work. Most blockchains distinguish at least three role types.
Full nodes do the most work and provide the most independence. They download every block, verify every transaction inside it, and keep the entire history on disk. A full node trusts nobody, because whatever it accepts as valid, it accepted after running the rules itself. It pays for this with disk space, bandwidth and electricity.
Block producers are full nodes with an extra role: they also propose new blocks. Depending on which consensus mechanism a chain uses, these are called miners or validators. The distinction is in how they earn the right to propose: by burning computation in the first case, by locking up stake in the second. Either way, the consensus mechanism from the previous lesson picks them through some costly process, they assemble a block, and the rest of the network either accepts or rejects what they propose. Block producers are usually a small fraction of total nodes.
Light nodes sit at the opposite end. They store only block headers instead of full blocks. When they need to verify that a specific transaction was included in a specific block, they ask a full node for a Merkle proof and check it locally. This is why a light node running on a phone can verify membership in a chain that holds terabytes of history. A light node pays for this with trust. It checks only the items it asks about and does not run the rules on every transaction, so it relies on full nodes to have done that, and it needs a full node to hand over each proof.
How nodes find each other
A node starting up for the first time has a problem. It doesn't know any other nodes, and there's no central directory to ask.
Most chains solve this by including a small list of well-known bootstrap nodes in their software, run by the project's developers or core community. When you start a node for the first time, it connects to one or more of those bootstraps and asks "who else is on the network?" The bootstrap responds with a list of peers it knows about. The new node picks some, connects to them, and asks them the same question. Within a few seconds, the new node has discovered dozens or hundreds of peers and the bootstrap is no longer needed.
The bootstrap is a starting point rather than a hub. Once a node is up and running, it doesn't depend on the bootstrap at all. What a new node does have to trust is the list itself, which comes built into the software and is chosen by its developers.
News reaches every node in a few hops
Once two nodes are connected, they communicate via a gossip protocol. When a node learns something new, a new transaction, a new block, it tells all the peers it's connected to. Each of those peers, if the information is new to them, tells all their peers. Within a few hops, almost every node in the network has heard the news. The cost to any individual node is small, but the total propagation is fast and reaches everyone. To avoid sending the same data twice, a node first sends a short announcement ("I have a new block with this hash, do you want it?") and sends the full content only to peers that ask for it.
The gossip protocol is why a transaction broadcast to a single node reaches the entire network within seconds, even though no node has a direct connection to most of the others. It's also why "broadcasting a transaction" doesn't require knowing anything about the network's structure. You hand the transaction to any node, and gossip propagation does the rest.
Why anyone runs a node
Running a full node costs real money: bandwidth, electricity, disk space, the maintenance time of a human operator. Operators accept that cost for one of three reasons.
Block producers run nodes because the chain pays them to. Whoever produces a valid block earns the block's rewards.
Service operators run nodes because they sell access to them. Wallet providers, block explorers, indexing services, and the infrastructure layer for most decentralised applications all need nodes to talk to. They run their own, or they pay specialised companies to run them and expose the data via an API. A user who reaches the chain through such a node trusts its operator to report the chain correctly.
Trust-minimising users run nodes because they want maximum certainty that the chain they're seeing is correct. A user who runs their own full node trusts nobody else's interpretation of the rules. This is a minority of users in absolute numbers, but it's the population that keeps the network honest. If anyone tried to push a rule change, the trust-minimising operators would notice and refuse to accept it.