Skip to main content

Thomas Boryniec, PhD

 

 

What Is a Blockchain?

The Story of a Shared Notebook

An introduction to how blockchains work.

Imagine keeping a notebook with a few friends to record your payments. Alice pays Bob 10 coins. Bob pays Sara 3 coins. Whenever money changes hands, you record who paid whom and the amount involved. A week later, no one needs to rely on memory. You simply consult the notebook to verify the details.

Now suppose Bob holds the only copy. One day, the entry showing that Alice paid him 10 coins disappears. Alice maintains that she paid. Bob insists that she did not. The question is no longer whether the notebook serves a useful purpose. It is whether its keeper can be trusted.

Consider an alternative arrangement. Everyone retains a copy, and the group follows agreed rules for adding new pages. Altering one person’s notebook no longer alters the group’s only record of events. The others retain copies against which they can check it.

This provides the starting point for understanding a blockchain. We still need a way to connect the pages, detect changes and determine who adds the next page. Yet the entire explanation can develop from this single notebook.

A Notebook That More Than One Person Keeps

A notebook maintained for financial records is called a ledger. A payment is a transaction. Neither term changes the underlying idea: we record what happened so that we can verify it later.

In a blockchain, the notebook is digital: its records reside on computers rather than on paper. Several entries are grouped into a block, just as several lines occupy a page. The blocks are linked in sequence, forming a chain. Combining these two words gives us blockchain.

Rather than leaving the only notebook in one person’s possession, many computers help maintain the record. These computers communicate with one another; collectively, they form a network. A participating computer is called a node. Some nodes independently verify each new block, and many retain the complete history. Using the system does not require an individual to store the entire record on their own phone.

Several computers retain copies of the same history, rather than separate notebooks documenting different payments.These copies are valuable, but they provide only part of the answer. When the notebook contains thousands of pages, how can a computer detect whether a single number has been altered? A straightforward mathematical process helps answer that question.

A Code That Changes When the Writing Changes

Imagine a calculator capable of processing words as well as numbers. You enter the sentence “Alice pays Bob 10 coins.” It applies a fixed mathematical recipe to produce a sequence of letters and numbers. Enter precisely the same text again, using the same recipe, and it produces an identical result.

The illustration below provides a real example. I have displayed only the beginning of each result to make the codes easier to compare. The calculation uses the text in the illustration exactly as written, without quotation marks.

Adding a single zero changes the result. These are the first eight characters of actual hash calculations; the complete codes are considerably longer.

The resulting code is called a hash. It is calculated from the information itself, rather than selected by the notebook’s keeper. Another computer can repeat the calculation to verify the result. Even a minor alteration normally produces a substantially different code.

A hash is often described as a digital fingerprint. The term refers to a mark that helps distinguish one exact version of some information from another. It is neither a literal image of a finger nor a written summary of the payment. Rather, it is a code that allows comparison. With a secure hashing method, finding different information that produces the same complete code is extraordinarily difficult.

Instead of requiring a computer to interpret the payment itself, we can ask a more precise question: does the code calculated from this record match the code already associated with it?

The Details at the Top of the Page

Consider the other details that might appear on a notebook page. You record the payments beneath the date. The payments describe what happened. The date provides information about the record itself. It is not an additional payment.

Computers store information, commonly called data. Details that describe this information are called metadata. In our notebook, the payment entries contain the main information; the date provides an additional detail about them. Metadata therefore means information about other information.

A Bitcoin-style block follows a similar arrangement. Its main section contains the transactions. A smaller section, called the header, contains details about the block. Think of it as the information collected at the top of our page. It includes a recorded time, the previous block’s code and a combined checking code for the transactions.

How can a single code represent several transactions? The computer begins by calculating a code for each entry. It combines those codes in pairs, calculates new codes for each pair, and repeats the process until a single combined code remains. The resulting code is called a Merkle root. The complete entries are still retained; the combined code enables the header to refer to them. It is not a condensed account of the payments.

Finally, the computer calculates the block’s own hash from its header. Since the header contains the combined transaction code, the block’s hash also depends on the transactions. Altering an entry changes its checking code, which in turn changes the header and the block’s own code.

How the Pages Are Connected

We can now return to the binder along the side of the notebook. Its function is to hold the pages together. A blockchain’s links do more than preserve their order: they make a change on an earlier page affect the pages that follow.

Suppose Page 1 has the code A7C2. When preparing Page 2, we include A7C2 in its header as the previous page’s code. Page 2 also receives its own code, say B8D4. Page 3 carries B8D4, and the pattern continues. These abbreviated codes are illustrative, rather than actual block hashes. The first page has no preceding page to reference.

Each new page incorporates the previous page’s code. Its own code is calculated from its header, then included in the next page. A simplified layout with illustrative entries and codes.

Notice that Page 2 assigns distinct roles to two different codes. One refers back to Page 1. The other identifies Page 2 itself. The pages are linked because the earlier code is included in the information used to calculate the next one.

Suppose someone alters Alice’s payment on Page 1. The recalculated code no longer matches the original code recorded on Page 2. Updating Page 2 to reflect the change would alter its own code, which would then no longer match the code recorded on Page 3. The effect continues forward through the links.

Someone could nevertheless recalculate those codes on their own computer. To understand why this does not offer a straightforward way to replace the shared history, we need one further part of the explanation: the rules for adding a page.

Who Gets to Add the Next Page?

Different blockchains approach this question in different ways. Consider Bitcoin as our example. Bitcoin is digital money; its blockchain maintains the record of its payments. The individuals and businesses competing to add the next block are called miners. Their work involves computing equipment rather than digging in the ground.

A miner begins by preparing a proposed page of transactions. What follows is a competition resembling the search for a lock’s correct combination. The machine tests a number, checks the result, and tries again if the attempt is unsuccessful.

In Bitcoin, the miner adjusts a trial number in the header and calculates the header’s hash. This trial number is called a nonce. Changing it produces another result for the machine to test. The letters and digits in a hash are a way of expressing a number. The objective is to obtain a result small enough to satisfy the network’s rule. Most attempts do not qualify, so the machines continue trying.

The lock serves only as an analogy. There is no single concealed password to discover, and many possible results can qualify. The difficulty lies in finding one. Once a miner obtains a qualifying result, other computers can quickly repeat the calculation to verify it. This method is called proof of work: a successful result provides evidence of the computational search required to produce it.

The miner prepares the contents before searching for a qualifying code. Finding one does not provide an empty page whose contents can then be chosen freely.

Verifying the payments is equally important. Alice’s wallet—the software she uses to make payments—uses a secret key to generate a digital signature. This provides mathematical proof of approval for the payment, which others can verify without learning her secret key. They also check that the coins being spent are available. Success in the mining competition does not make an unauthorized payment valid.

Why invest in equipment and electricity? A miner whose valid block becomes part of the accepted history can receive newly created bitcoins and the fees associated with its transactions. Many miners cooperate through a pool, a group that combines its efforts and shares the proceeds. These rewards provide an incentive to undertake the work, although costs can still exceed earnings.

Other blockchains do not necessarily rely on this competition. Ethereum uses proof of stake. The participants who propose and check its blocks, called validators, put some of their digital money at risk as a form of security deposit. They can earn rewards and lose part of that deposit for certain rule violations. The method differs, but it addresses the same question of how new pages are proposed and accepted.

What Is the Lesson Here?

A blockchain is a shared notebook whose pages are connected by checking codes. Many computers maintain and verify its records, and new pages must comply with the network’s rules. Together, these features make the history easier to verify and more difficult to alter unnoticed.

We began with Alice depending on Bob to maintain an honest record. The lesson is not that computers eliminate the need for trust. It is that people need not rely entirely on one person’s word. Rather than simply asking, “Do I trust the notebook’s keeper?”, they can ask, “Can I verify the record for myself?”