02 / 13

Chapter 02 · Beginner guide

The network

Many computers, no boss

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 node. Pearl’s reference node software is called pearld.

A node connects to a handful of other nodes, its peers. 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.

  1. Receive

    It hears about new transactions and new blocks from its peers.

  2. Check

    It tests each one against every rule, using only its own software and its own copy of the ledger.

  3. Keep

    Valid blocks go into its copy of the ledger. Valid transactions wait in its waiting room until a block includes them.

  4. 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 node 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 rules 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 decentralization. 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 seeds, 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-324, 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 client, 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.

The network, side by side
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.

Beginner guide

Suggested

Up and down arrows move through the results, Enter opens one, Escape closes. Anywhere on the site, slash or Command K opens this search, and the square brackets [ and ] go to the previous and next page.