Chapter 02 · Beginner guide
The network
Many computers, no boss
On this page 7 sections
When you send PRL, there is no company to send it to.
Your payment goes to the Pearl network instead: a crowd of computers, all running the same rules, all talking to each other. This page is about that crowd, and why it doesn’t need a boss.
What is the Pearl network?
Each computer in the network is a nodeNode: A computer running Pearl's software. It keeps a copy of the blockchain, checks every new block and transaction against the rules, and passes them on.. Pearl’s reference node software is called pearldpearld: Pearl's reference node software, written in Go and derived from btcd, a Bitcoin node..
A node connects to a handful of other nodes, its peersPeer: Another node that yours is directly connected to. Blocks and transactions spread from peer to peer.. News travels like gossip in a village: you tell your neighbors, they tell theirs, and soon everyone has heard.
There is no center. If some nodes go offline, the rest carry on, and the ones that come back catch up by asking their peers what they missed.
What does a node do all day?
A node’s job is a loop with four steps.
-
Receive
It hears about new transactions and new blocks from its peers.
-
Check
It tests each one against every rule, using only its own software and its own copy of the ledger.
-
Keep
Valid blocks go into its copy of the ledger. Valid transactions wait in its waiting room until a block includes them.
-
Pass on
It forwards whatever passed the checks to its peers, and drops whatever failed.
The rules are things like these:
- The coins being spent exist, and haven’t been spent already.
- Every signature is valid for the coins it unlocks.
- Nobody pays themselves more new coins than the schedule allows.
- Every block carries a valid certificate proving the mining work.
- Block times are sensible: at least 1 second after the previous block, and no more than 5 minutes in the future.
Why doesn’t anyone have to trust anyone?
Here is the key idea: nodes don’t vote, and they don’t take each other’s word for anything.
A full nodeFull node: A node that downloads and checks every block and every transaction itself, trusting no one. downloads the whole history of the ledger and checks every block in it, all the way back to the first. After that, it checks each new block the same way.
So the consensus rulesConsensus rules: The rules every node checks for itself, like “no spending coins twice” or “the proof of work must be valid”. A block that breaks one is rejected, whoever made it. are enforced by everyone at once. A block that breaks one doesn’t need to be voted down. It simply never makes it into anyone’s copy, as if it had never been sent.
Make a guess
A wealthy company runs 1,000 nodes, and all of them accept a block that pays the company a million PRL out of thin air. Your single node receives that block. What does it do?
Think of your answer first, then check it.
Answer It rejects the block.
Your node doesn’t care how many other nodes accepted it. It checks the reward against the schedule in its own software, sees the rule is broken, and drops the block. Every honest node does the same, so the company’s block stays stuck inside its own computers.
This is what people mean by decentralizationDecentralization: Having no one in charge. Pearl’s ledger is kept and checked by many independent computers, so no single person or company can change its rules alone.. It isn’t just that many computers exist. It’s that each one can check everything without help.
How does a new node find the others?
A brand-new node knows nobody. To get started, it asks a few DNS seedsDNS seed: A name server that gives a brand-new node the addresses of active nodes, so it can find its first peers. Pearl mainnet has 3., name servers whose job is to list active nodes. Pearl’s mainnet has 3 of them.
Once the new node has made its first connections, its peers tell it about other peers. From then on it can find its way around without the seeds.
Can anyone listen in?
Not easily. Every connection between two Pearl nodes is encrypted, using a standard called BIP-324BIP-324: A standard for encrypting the connection between two nodes. Pearl uses it for every connection, with no unencrypted fallback., and there is no unencrypted fallback.
Someone watching the wire can still see which computers are talking to each other. But the messages themselves look like random bytes.
What about phones and small devices?
Checking everything needs the full history of the ledger, which is a lot to ask of a phone. Lighter software, called a light clientLight client: Software that downloads block headers instead of whole blocks. Pearl's light client still checks every header's certificate, so it is lighter than a full node but much heavier than a Bitcoin one., downloads only the block headers, the short summary at the top of each block, and skips the transactions it doesn’t need.
On Pearl, each header comes with its mining certificate, about 60 KB, and the light client verifies every one. That’s much heavier than a Bitcoin light client. The upside is that even a light client checks the mining work for itself instead of trusting whoever sent it the headers.
| Topic | Bitcoin | Pearl |
|---|---|---|
| Connections between nodes | Plain or encrypted (BIP-324 optional) | Always encrypted (BIP-324 only) |
| What a light client checks per block | An 80-byte header | A 108-byte header plus its ~60 KB certificate |
| Default network port | 8333 | 44108 |
| New block about every | 10 minutes | 194 seconds |
Why does all this make cheating hard?
To cheat, you would need your rule-breaking block in other people’s copies of the ledger. But every node checks for itself, so a rule-breaking block goes nowhere.
There is one thing rules alone can’t settle, though. Suppose you sign two different payments that spend the same coins, and send them to different parts of the network at the same moment. Both look valid on their own. Nodes need a way to agree which one came first.
Agreeing on the order of events is the job of blocks and mining. Before we get there, the next page looks at what a transaction actually contains.