1. Trang chủ
  2. » Kinh Doanh - Tiếp Thị

Take control of cryptocurrency

137 0 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề Take Control of Cryptocurrency
Tác giả Jonathan Taplin
Chuyên ngành Finance
Thể loại Book
Định dạng
Số trang 137
Dung lượng 4,2 MB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Take Control of Cryptocurrency, Glenn Fleishman casts aside the headlines and hype around cryptocurrency to dig in on the fundamentals. You learn everything you need to know as an individual from the ground up about cryptocurrency, including details about the popular forms of it. You’ll find out what risks it poses for the planet—and for your pocketbook. Discover the role of a cryptocurrency wallet, how to find the best one, and how to use it safely. You will understand the ins and outs of buying and selling cryptocurrency and using it for real-world purchases and sales. Glenn also explains the mystery of NFTs (non-fungible tokens), which are a peculiar but popular use of cryptocurrency that lets you own unique digital artwork. Cryptocurrency is a new way of representing value that’s going through the throes of change and no one knows exactly what form of it will survive and thrive. It hit the mainstream years ago but 2021 seemed to whip people into a frenzy over Bitcoin, Ethereum, Tether, and several other popular forms. Valuations—the price in cash one could get when selling cryptocurrency—soared. But cryptocurrency doesn’t have an inherent price: it’s worth only what people will pay for it. In May 2021, most cryptocurrencies plunged in value by half or more. Meanwhile, a similar furor arose over the introduction of “non-fungible tokens” (NFTs), a way to use an aspect of cryptocurrency to buy and sell unique ownership of digital assets, like born-digital art and clips from NBA basketball games. NFTs similarly suffered a giant drop in value from a peak in May 2021. What is this all about, anyway? Why did cryptocurrency and NFTs tank? Take Control of Cryptocurrency ignores the hype in favor of the reality beneath it. This new form of currency is not going away, even if the price in dollars, euros, and renminbi may fluctuate madly. The future of the economy will incorporate cryptocurrency and you can get to know it in great but understandable detail with the help of author Glenn Fleishman. This book teaches you what cryptocurrency really is and how it relates to government-backed money. Glenn walks through all the parts of a cryptocurrency in clear detail—like a wallet, blockchain, and transactions—and explains how cryptocurrencies produce permanent transfers. He also lets you see two different kinds of risk: the side effects of Bitcoin and others in consuming massive amounts of electricity and the rise of ransomware on the back of somewhat anonymized payments, and the risk to your pocketbook from scams and thefts (and how to guard against them). Of course, you also learn how to manage cryptocurrency: find out what a wallet does and how to obtain one (and which might be a good fit); buying, selling, and exchanging cryptocurrency; and even purchasing or selling items in the physical world using cryptocurrency. Glenn also delves into how NFTs swept the news in early 2021, as creators and others staked a claim on defining an “original” item in a digital world, and how—and whether—to get involved in buying and selling NFTs.

Trang 2

Cryptocurrency is a new form of money Since its first practical emergence, when Bitcoin fired

up on January 3, 2009, it represented a new kind of way in the history of humanity to store,transfer, and represent value What value? Well, that’s the question

Every day, the majority of the people in the world pay for goods and services or accept paymentdigitally They dip a credit card, scan an Alipay or WeChat Pay QR Code (about a billion people

in China), tap a smartphone, pay by SMS (as with M-Pesa across parts of Africa), or click abutton to send their financial details to a website Hundreds of billions of dollars annually aretransferred electronically by international migrant workers, sending remittances home

These massive transfers of value electronically power and have accelerated the global economy.Despite the ease with which many of them work, they are mostly somewhat to very inefficientbecause of the number of parties involved, each of whom takes some piece of the action Andthey all rely on trust in the institutions involved

Cryptocurrency is a way to remove intermediaries (and thus inefficiency and costs) while

replacing trust in the value, ownership, and transfer of something with proof based on

mathematics in the form of encryption implemented in a common set of software At its heart,that’s all it is, but the word “all” does a lot of work there

Instead of moving around government-backed electronic equivalents of money (or even physicalcurrency), cryptocurrencies lock every transaction—every shift of ownership from one party toanother—in an immutable, verifiable fashion in a public record that nonetheless preserves manyaspects of anonymity

Encryption allows the owner of cryptocurrency to demonstrate ownership in a manner that otherpeople, systems, and algorithms can validate without trusting that ostensible owner With printedcurrency, possession of the cash is proof of ownership; with cryptocurrency, possession ofencryption keys provides an analogous proof (Just as with cash, your ownership may bedisputed by legal means, but you still possess the value until a change is forced upon you.)

At some level, cryptocurrency is just a more efficient way to hand a bag of cash to someone else;

at other levels, it’s an entirely new creature whose attributes haven’t yet been fully explored.Regardless, the purported value of the two most popular digital coins—Bitcoin and Ethereum—coupled with dozens of more specialized and niche ones is over $1 trillion, so it’s a beast toexamine carefully

Skyrocketing exchange rates pushed cryptocurrency into heavy mainstream coverage across thepandemic in 2020 And in early 2021, a way to sell a form of ownership of a digital work of art,

a non-fungible token or NFT, went from an obscure corner of the internet into a

multi-billion-dollar business in which the NBA, Christie’s, and other reputable and well-known partiesparticipated

Trang 3

It’s all a little overwhelming, and this book is your key to unlock cryptocurrency’s innards.

It’s not a recommendation (nor a prospectus) to invest in it or purchase digital value Nor is about valuation, or what cryptocurrency is worth in dollars or euros or renminbi—that would

delve into investment advice and trying to understand why a market attributes a certain exchangerange to various coins

Rather, what you’ll achieve by the end of this book is a solid working knowledge of all thepieces that fit together in a cryptocurrency, plus an idea of how various ones may mature andwhat the future brings

The book spends a fair amount of time on background knowledge You’ll learn how money andcryptocurrency stand in relationship to each other and then all the fundamentals of acryptocurrency, like the blockchain, mining, and wallets

Along the way, I introduce cryptographic concepts necessary to achieve a deeper insight,

like public-key cryptography There’s very little math, however, and a perfect understanding of

cryptography isn’t critical to understanding how a cryptocurrency works—it just adds to yourexpertise (I separated some of the most technical bits into an appendix for reference.)

I also dig into the dangers cryptocurrency poses to the planet and to financial markets, as well asrisks you could experience from the dark sides, legal and otherwise

With that understood, I explain how to buy, hold, and sell cryptocurrency; how to purchasedigital and physical assets with it; and what, in fact, an NFT really is (Spoiler: It’s not precisely

a digital asset nor really ownership of a digital asset It’s closer to bragging rights.)

My hope is that you’ll achieve a level of comfort and familiarity with the concepts and thatwhether you become a participant in cryptocurrency in any way, or you say, “thanks, but nothanks,” you do so from an informed position of comfortable knowledge

Cryptocurrency Quick Start

Cryptocurrency can be overwhelming, so I recommend figuring out how you want to approachlearning about it You can work your way sequentially through the book, which is designed tobuild on knowledge Or you can jump ahead to chapters on risk, buying or selling, or NFTs ifyou want to dig into one of those subjects first

Master the basics:

 Start with first concepts as you examine what money is, where cryptocurrency fits in, andlearn about liquidity; see Understand Cryptocurrency

 Get to know all the elements of a cryptocurrency; see Learn How Encryption BindsCryptocurrency

Trang 4

 Become an expert in mining, the reward-based mechanism that records permanenttransactions; see Dig into Currency Mining.

 Learn the salient facts about each major cryptocurrency; see Discover How MajorCryptocurrencies Work

Understand the risks:

 Hazards abound in the ongoing maintenance of cryptocurrencies; see ExploreEnvironmental and Structural Hazards

 You might experience danger to your finances, health, and freedom; see Avoid the DarkSide of Cryptocurrency

Participate in cryptocurrency:

 Buy, sell, and purchase stuff with cryptocurrency; see Buy and Sell Cryptocurrency

 Peer into the future of unique digital purchases; see Understand Non-Fungible Tokens(NFTs)

Understand Cryptocurrency

Cryptocurrency was once the province of geeks, people who believed leaving the gold standardwas a mistake, conspiracy theorists, black marketeers, speculators, criminals, and people with an

obsessive sense of curiosity—to name just a few categories It was also of keen interest to

modern economic theorists, computer scientists, encryption researchers, and people who dabbled

as a side interest in one or more of those areas of study and practice

The space opened up over time as the exchange value of Bitcoin and cryptocurrencies thatfollowed became significant—into the billions of dollars—and the tools that let peopleparticipate became simpler Originally, cryptocurrency required a good understanding ofencryption, security, and command-line interactions, including potentially installing andcompiling software But participation evolved into friendlier, GUI-based “wallets” to holdcurrency and ultimately to websites that perform the heavy lifting

Along the way, more people began to participate by buying, holding, and selling cryptocurrency,which led reported coverage of the field to grow from mentions in specialized publications tomainstream business stories in widely read periodicals and websites

Cryptocurrency’s reach and ability to appeal to more people grew as global politics and financialmarkets roiled, unsettling enough people to a large enough extent to try to find safe ways totransfer money into something they thought might be outside the vagaries of government

Trang 5

oversight and mismanagement For some, that also meant largely outside the gaze of regulators,prosecutors, and tax collectors.

The increasing involvement by people with extreme wealth, venture capitalists, highlycapitalized public companies (notably, the Tesla electric-car firm run by Elon Musk), PayPal andits Venmo division, and government regulators have made Bitcoin and Ethereum in particular—the two leading digital money types—appear more rational to interact with, even though nothinghas truly changed in terms of their basics, volatility, or inherent value

For all that, I would wager (in any currency) that most people who participate in cryptocurrencymarkets in any fashion don’t know all the ins and outs of how they work Since the point of this

book is to give you a basis of understanding and teach you how to engage with cryptocurrency,

this chapter starts with the fundamentals

Before we dig into the technical details of cryptocurrency, we have to look at philosophical ones

This includes defining what money is—what it means and how it works—and then the space

cryptocurrency fills in the current global financial market and internet space

Finally, you must grasp the concept of liquidity, the difference between assets that are freely

exchangeable and tied up in a significant way I feel a lack of discussion of liquidity’s role incryptocurrency is one of the greatest missing pieces in everyday writing and reporting about it.WHAT IS CRYPTOGRAPHY?

Let me slip in this concise explanation of cryptography: it is the science of hiding information in

a way that people who don’t know a secret can’t uncover it Forms of encryption—the practical

application of cryptography—date back millennia

Methods can be as simple as letter-substitution ciphers, in which an A in a piece of text isreplaced by a D, a B by an E, a C by an F, and so on These methods are quickly broken

More secure methods require the use of mathematical algorithms, sequences of operations that

transform source material into a form that can’t be understood without knowing a secret Some

encryption algorithms rely on a key that allows someone else with the same key to decrypt and

make use of the original material In other situations, an algorithm allows someone to

prove possession of a secret.

More details about cryptography applied to cryptocurrency appear throughout the book:see Public-Key Cryptography and a quite technical explanation in an appendix, Make a Hash of

It

What Is Money?

What is money, anyway? It’s a representation of value: some kind of token we use to signifybuying power, to denominate debts in, to allow repayment of money owed, and often to indicatewealth or its absence

Trang 6

It can be a sign of prestige or importance if you have a lot of it relative to what you can get for it,like a house or a yacht or a law in your favor; it can be a target for those who want what youhave, particularly those who think you have too much.

Money can also be defined as liquid wealth Liquid means that it can be accessed and used

immediately or nearly so, whether it’s cash or cash equivalents—like certificates of deposit—toexchange for stuff or services Money can usually be easily converted into other forms of itself,

too (Figure 1) (Illiquid assets, such as ownership stakes in private business, real estate, funds

held in retirement accounts, art, and stock options, have to be liquidated This usually takes

time.)

Figure 1: These are all forms of

cash (Photo by John McArthur )

Tip: For more about liquidity, see Understand Liquidity

At its essence, though, money is a form of promise Until recent years, it’s been a commitment

made by members of a society in cooperation with a civil government or ruling empire that apiece of metal, like a coin, or a bill, bond, or other piece of paper—like the scrip issued bycompanies, co-ops, or merchant groups—or electronic versions of any of those, has a redeemablevalue among those who believe in that promise If someone doesn’t buy into the promise behindthe money you proffer, or you disbelieve in the money you’re offered, it has no real value (Insome scenarios, you are forced to accept or remit certain forms of money, however.)

Note: This does get into “Tinkerbell” territory or consensual group hallucinations Money has

value because we all agree it does If we stop believing, which has happened in many countriesacross history, the value disappears A comedic example is the famous Monty Python sketchabout apartments (flats) built entirely by hypnosis

Trang 7

Government bonds, for instance, used to be gorgeously engraved documents, in part because the

engraving was extremely difficult to copy and forge (Figure 2)—shades of cryptography! A

bond’s text explained that the paper represented an amount of money and an associated amount

of interest to be paid on a schedule over a period of time These bonds are almost always backedwith the “full faith and credit” of a nation: no matter what happens, that bond will be redeemablefor currency according to the terms agreed upon That backing means that the government entitywould have to go bankrupt to avoid repaying or willfully violate the bond’s terms and try toavoid a court judgement

Figure 2: A tax-free bond issued

by the U.S government in 1877, which promised to repay the initial $50 plus 4% interest annually for 30 years (Image from JHerbstman via Wikimedia Commons )

Note: The United States as a nation has never defaulted on such an obligation It’s one reason

that people believe in its promises and buy U.S bonds as the safest investment in times ofturmoil

Bonds make a promise explicit, but any money issued by a government has an implicit

promise Fiat currency is the term for state-backed circulating value, because the state calls it into being—fiat being Latin for an assertion, “let it be done,” that stands on its own Fiat

currency has no intrinsic value; it is worth what people believe it to be worth, and is not tied toassets, precious metals, or other material goods

Let me repeat that: fiat currency is worth nothing—nothing but the trust placed in the

government that issues that At various points, government currency has been backed by specificassets

Under the gold standard, for instance, currency is freely redeemable on demand for the portion

of gold the currency represented No government currently uses the gold standard, because itstrangles economic growth (That parenthetical will leave people with certain economic notionsparalyzed by rage.)

A central bank typically issues fiat currency, and can literally “print money,” or push morebanknotes or corresponding electronic value into their monetary system If money is printed toofast, it can cause a surge in inflation, which reduces the buying power of a unit of currency, and

Trang 8

which can put a country into a spiral in which they issue more and more cash, and which leads

to hyperinflation.

Note: Printing money to increase its supply is different from selling bonds: the former literally

makes something out of nothing and may cause a drop in the total outstanding value as the newmoney dilutes the old; the latter is a debt that must be repaid

In the modern age, the value associated with fiat currency is largely held in electronic ledgers.Central banks use electronic transactions to produce more of it and loan it to banks

The United States, for instance, has $21.4 trillion dollars in currency outstanding as of November

2021, but only $2.2 trillion of that is circulating in the form of banknotes and coins

Note: Those totals come from the M2 money supply, which is more or less the total of all

deposits that don’t belong to the U.S Treasury or Federal Reserve and that can be immediately

or fairly readily withdrawn as cash

However, the electronic-only portion of currency isn’t by any means cryptocurrency Bloombergcolumnist Matt Levine, a former investment banker and financial lawyer, wrote a remarkablyconcise and witty explanation of the electronic component of central banking:

If you have $5,476.23 in a checking account at a bank, that money consists only of a computer entry at the bank The computer entry isn’t a reference to a box containing 50 $100 bills, 23 $20 bills, a $10 bill, a $5 bill, a $1 bill, two dimes and three pennies, all neatly labeled with your name and account number There is no box, there are no bills, and the money in your checking account is, only, the computer entry at the bank.…The electronic entries are not “just a way to move money”—some external thing in the world—“electronically”; the electronic entries are money itself.

Many central banks view it as their mission to achieve several overlapping goals:

 Prevent inflation to keep goods and services affordable for a working class

 Maintain stable interest rates for lending and borrowing

 Encourage investment, hiring, modest wage growth, and stable employment

 Keep volatility of their currency low, which means small changes over time in the marketexchange rate with other stable currencies

 Keep the relative value of their currency as low as feasible to make exports of their goodsaffordable to other countries

 Provide liquidity to banks to ensure a steady availability of money to loan to individuals,commercial institutions, and government entities (see Understand Liquidity)

Trang 9

 Issue bonds or repurchase outstanding bonds depending on inflation, governmentrevenue, and other factors.

That’s a lot of jobs, and a lot of competing interests As you’ll soon see, cryptocurrencies have

almost nothing in common with central banks, except the issuing of a kind of currency from

nothing—but it’s distinctly not fiat currency, as there is no entity behind a cryptocoin

What Is Cryptocurrency?

One way to look at cryptocurrency is that it’s like paper money Each piece is designed to beunique Generally, possession is ownership And transferring it often involves less overhead thanchecks, credit cards, electronic transfers, and precious metals and jewels (For cash, that’s true ofrelative physical proximity for transfers: once you have to ship cash somewhere, it becomes veryproblematic.) This makes both cash and cryptocurrency useful for performing illegal transactionsand for legal ones that someone wants to be untraceable to avoid a trail used to confirm requiredtaxes were paid on sales, gains, or transfers

While cryptocurrencies like Bitcoin are represented only electronically, so is the majority of

currency issued by central banks, as noted above (Figure 3) What’s the difference between 90%

of America’s M2 money supply that’s purely represented as bits and 100% of Ethereum’s Ethervirtual coins, which are represented purely by bits?

Figure 3: This is not cash These

are coins with a Bitcoin symbol on them that sell three for $7 on Amazon and have no intrinsic value, virtual or otherwise (Photo by Dmitry Demidko )

It’s both a lot and not much Cryptocurrency isn’t just “digital cash,” because digital cash isessentially an unvalidated ledger that a central bank manages If it loans money to a bank, thebank receives the right to spend that money, but only the central bank effectively validates thebalance transferred is “real.” Each participant in a banking system has to operate systems thatcan’t invent value, too, but this is based on accounting software, not cryptographic proof

Note: I am highly simplifying the checks and balances and all the record-keeping done to ensure

that money flowing across the central bank and private institutions is accurate But it is

Trang 10

uncomplicated to say that none of the confirmation methods involve immutable, irreversiblecryptographic elements.

In cryptocurrency, there’s no real way to create fake transactions and there’s no way to inventvalue, because all creation of value and all transfer of value happens through cryptographicprocesses that are recorded, distributed, and publicly verifiable by any party

TRANSFERS PROVE OWNERSHIP

Cryptocurrency is entirely built on transfers Every transaction conducted transfers some amount

of value in a cryptographically provable fashion from one party to another (The exception ismining, in which the system effectively awards value, though that’s a form of transfer; see Diginto Currency Mining.)

There’s no invoicing, debt, money requests, or the like built into these systems Companies canintegrate cryptocurrency into a banking approach, like a mythical PalPay that lets you invoicesomeone and requires payment in Litecoin

Because the system tracks only transfers, no central entity tracks balances With a stock or bankaccount, some institution maintains your balance and can report it to you in paper statement orelectronically A cryptocurrency “balance” is just the sum of all the transactions that transferredvalue to you

The academic and cryptocurrency researcher Jan Lansky spelled out six conditions that definesuch systems, and I’ll use his rubric with more detail to explain it:

Distributed consensus: Authority exists by the consensus of parties participating in the

cryptocurrency A form of “proof”—based on effort, participation, or other measurableinputs—is used to automatically, algorithmically, and irreversibly agree on the state ofthings (See Proof Forms Consensus.) This varies by system No central party (no centralbank) controls it

Central ledger: A cryptocurrency’s active system provides a view into outstanding units

of value and ownership It provides pseudo-anonymity, because this transparency allowstransactions to be tracked They can be associated with an entity, but it may beimpossible or difficult to link that entity with an individual, group, company, orgovernment

Currency supply: A cryptocurrency may allow for the creation of additional units of

value, and describes how they are made and who owns them when they are produced.These are made in some distributed fashion, too, so that no party or parties have a specialright to add value and to own that added value

Trang 11

Note: The exception comes when a cryptocurrency is created, which produces some

amount of seed value that can be distributed

Cryptographic proof of ownership: The only way to prove ownership is through

cryptography More specifically, possessing an encryption secret both lets you

demonstrate irrefutably to others you own the value and gives you the ability to transfer

it

Tip: For a quick explanation of cryptography, refer back to What Is Cryptography?

Transferrable ownership: The cryptocurrency system has a mechanism to allow

verifiable transfer of value Each transfer is typically immutable after an often shortperiod and is typically irreversible; in some very limited circumstances, it may berefundable (This gets very hairy, and I talk about it in Blockchain Hijacking.) This isprobably the closest thing in common between fiat currency represented electronicallyand cryptocurrency

Resolution of “double spending”: If a system receives two competing transactions to

transfer ownership of the same cryptographic units—sometimes occurring at the sametime for maximum confusion—it completes only one of the transfers according to a set ofrules Such a problem is called “double spending,” and it has plagued some electronicpayment systems in the past

There are a couple of other elements that aren’t inherent to cryptocurrencies but demonstratemore of how they differ from currency represented in paper or electronically:

Where value is held: In a cryptocurrency, 100% of value resides in the transaction

ledger That ledger is cryptographically generated and distributed No party controls it.It’s as if the accounting books of central financial authorities and banks were a single set

of records, but the only way to understand who owns what is to tally all the transactionsever performed

Government participation: No cryptocurrency is currently government backed or

controlled While there’s a lot of interest in providing a sort of melding between bank electronic ledgers and cryptocurrency principles, no such thing exists yet Theclosest is China’s rollout of a test version of a central-bank version of renminbi, thecountry’s cash Governments are very interested in the aspect of creating a secured,immutable record to avoid fraud and potentially to track tax owed and collect it moreefficiently

Trang 12

central-Note: A lot of interesting and creepy ideas could result from state-issued cryptocurrency It

could be set to deflate in value over time or expire; the latter is being tested in China’s version.And all transactions would be visible to central authorities, even if there were an attempt atanonymity in the system

One could ask after reading this, what is the problem that cryptocurrency solves thatgovernment-backed currency doesn’t? You would be in good company asking that question, as

it’s something Nobel Prize recipient and New York Times opinion columnist Paul

Krugman wants to know, too:

But I’ve been in numerous meetings with enthusiasts for cryptocurrency and/or blockchain, the concept that underlies it In such meetings I and others always ask, as politely as we can: “What problem does this technology solve? What does it do that other, much cheaper and easier-to-use technologies can’t do just as well or better?” I still haven’t heard a clear answer.

I’m no award-winning economist, but I would argue cryptocurrency does attempt to solve a fewspecific impossibilities and inefficiencies, some of which are fundamental and some of which are

an artifact of our current financial systems:

 Move value without impediment across national borders without converting currency orpaying fees for the privilege of sending or receiving it

 Transfer value without intermediate institutions merely by publishing the value transfer

on a global network, like a Craigslist that finds parties to make transactions permanent

 Establish a permanent, transparent, cryptographically provable record of transactions that

no government, hacker, company, or individual could forge or modify

There’s one more element you should be sure you know regarding cryptocurrency and its

relationship to fiat currency: liquidity Liquidity is essentially the ability to turn the value you

possess in one form into something else: goods, services, financial instruments, or anothercurrency, whether cryptographically based or government backed

For instance, because of the mostly continuous run-up in housing prices over the last few

decades, many homeowners are house rich, cash poor They have a lot of equity in their home—

the difference between their mortgage and the sale price—but can’t do anything with that equity

Trang 13

except by selling their house in a market in which there are buyers for homes (And then where

do you live?) At the same time, they may not be earning enough or have saved enough to haveliquid assets, and sensible lenders won’t even give them a home equity line of credit against theirequity because of their cashflow

This illiquidity crushed a number of people during the 2007–2008 housing crisis as predatorylenders had issued mortgages to vast numbers of people who couldn’t afford payments on theloans Housing prices ran up, building equity for people who were then often encouraged to takeout high-interest home equity lines of credit to have cash on hand to pay the mortgage None ofthis was sustainable When it came crashing down, housing prices dropped in many markets somuch that people couldn’t sell their houses above what they owed or even above what they had

paid for them This caused a liquidity crisis which put homeowners into bankruptcy, roiled the

financial markets, and brought down a large number of institutions

You don’t live in a Bitcoin, though, so what’s the analogy here? Sadly, cryptocurrencies have anoddly similar liquidity problem to the housing market Because it’s difficult to use digital coins

to pay directly for many services or goods, you have to turn to an exchange, which is a

marketplace that converts cryptocurrency into fiat currency or other cryptocurrency Theexchange collects a fee, often just a slight premium, to convert your bits into fiat currency andvice versa They make their money off having a high volume of transactions

A central bank provides liquidity for regular cash During the 2007–2008 financial crisis, forinstance, central banks moved to shore up institutions, act as purchasers of commercial loans,and generally lubricate the markets so that plenty of money was circulating around to prevent anabsolute crash by firms and individuals liquidating assets During 2020 and early 2021, centralbanks again assured liquidity as companies had to pause activities

Central banks can draw on vast assets or even print money to improve liquidity Incryptocurrencies, any movement in and out of the coin requires an exchange In that sense, thecollective set of exchanges that handle a given digital currency provide liquidity

But they aren’t set up to manage huge amounts of risk, nor do they have assets in reserve toweather crises Exchanges work more like stock trading, in which an intermediary (the trader)handles the deal between parties One party may want to sell 100,000 shares of a stock, and theintermediary finds one or more buyers and takes a cut (the spread between selling and buyingprice)

If people suddenly lose confidence in a cryptocurrency and want to shelter virtual assets in fiatcurrency, the exchange must find buyers who are looking to get in That’s very difficult when acryptocurrency falls rapidly, which happens frequently Across 2021, Bitcoin and othercryptocurrencies dropped by 50%, then went up by tens of percentages points and back down.Chinese banned cryptocurrency outright in September 2021, and after a short fall, Bitcoin rose tojust exceed its all-time high—and then fell again by a third!

With a huge number of sellers and few buyers, the price of any asset valued in how it floats in amarket—housing, stocks, or a cryptocurrency—can plummet as buyers set the terms for what

Trang 14

they’re willing to pay They offer lower and lower prices, which sinks the price people will getfor their assets, and produces more of a rush out.

This lack of true liquidity can have big effects, like crashing a cryptocurrency’s exchange price;

or small ones, like it being normal to require hours or days to sell any part of your holdings Idiscuss this further in Buy and Sell Cryptocurrency

IT DROPPED LIKE AN IRON BALLOON

On June 17, 2021, choices made by Iron Financial across three separate, interrelatedcryptocurrencies they managed caused all three to crash due to what was effectively a liquiditycrunch—a run on the virtual bank The firm accidentally created an incentive to investors thatcaused one of three currencies to skyrocket When investors in that coin panicked and started tosell out their positions, the currency plummeted to the ground as sellers found few buyers It alsotanked the two related cryptocurrencies (The details are absurdly complicated, but for atechnical explanation, read this Rekt article.)

Cryptocurrency

Cryptocurrency obviously mashes the words “crypto” and “currency” together, but you can’t justsay a buzzword and make it real (I mean, in some parts of the tech world you can.) The theoryunderlying cryptocurrency relies on a smart application of existing principles in encryption thatallow proof and validation of possession of a secret and apply that by reference to the ownership

of a specific number of units of a digital-only asset

The key concepts in cryptocurrency are as follows:

The node, peer-to-peer software that collectively forms the network

The unit of coin, the currency and its division

A transaction, which specifies the transfer of value from one party to another by creating

an entry in the blockchain

The blockchain, a distributed ledger of transactions available publicly but the entries of

which are abstracted from identities

The wallet, used by individuals and organizations to manage the cryptographic secrets

required to buy, hold, and sell cryptocurrency

Trang 15

Mining, a way to lock transactions into blocks that extend the blockchain while receiving

a reward paid in the cryptocurrency itself as well as fees for each transaction added (andultimately making ledger entries immutable and thus irreversible)

Note: Mining is such an extensive topic it receives its own chapter following this one, Dig intoCurrency Mining

These components are described in an evolving standards or specifications document thatoutlines every detail to the nth degree of how a cryptocurrency works That starts with the node

Note: With Bitcoin as the big gorilla that set the model for what followed, I’ll use it largely as

the example In the chapter Discover How Major Cryptocurrencies Work, I explain the specifics

of a number of the biggest value holders

Each instance of this software is called a node Nodes are peer-to-peer, meaning they all

discover each other instead of having a central server or party that coordinates them Nodesparticipate by issuing and relaying transactions, holding full copies of the ledger of transactions,and validating data that arrives A sufficient number of nodes are always running that have a fullcopy (or the equivalent) of the entire ledger of transactions that have ever occurred

Note: Nodes come in different forms Among them, full nodes verify transactions and blocks,

while lightweight ones allow querying transactions Bitcoin and Ethereum each have either

around 10,000 or 100,000 full nodes each No centralization means no agreement on how tocount them!

Everyone participating in a given cryptocurrency must run software that conforms to the sameversion of the standard People running nodes based on different versions of the standardeffectively aren’t using the same cryptocurrency! (I explain more about what happens when thatoccurs in What’s the Fork?, below.)

Early in the book, I said that cryptocurrency replaces trust in people with a reliance on the cold,

irrefutable nature of math But really, because that math is implemented in software, it’s moreelaborately “trust that the software that runs the networks isn’t cooking the math.”

As Bruce Schneier wrote on his blog in 2019:

What blockchain does is shift some of the trust in people and institutions to trust in technology You need to trust the cryptography, the protocols, the software, the computers and the network And you need to trust them absolutely, because they’re often single points of failure.

Trang 16

Software flaws undermine the trust in a system, and can cause billions or more in exchange value

to be shed, lose participants, or even sink a cryptocurrency When those flaws are intentional, ashas been the case with some dubious new coin issuances, it can allow massive fraud

The Coin and the Token

For seemingly being the fundamental unit of a cryptocurrency, it’s surprisingly easy to describe acoin—far less complex than nearly any other portion of digital cash A complement to a coin is atoken, a more general form of digital asset that can be used more flexibly to represent ownershipbeyond value held in a coin Let’s look at the two

The Coin

A coin is just a unit of counting In cryptocurrency, there’s no inherent meaning or value to it.One Bitcoin is just one Bitcoin The only value attached to it is what you or other people agreeit’s worth

Crypto coins can be subdivided into tiny fractions In Bitcoin, the satoshi is the smallest unit, and

it’s 100-millionth of a Bitcoin unit (It’s named after Bitcoin’s pseudonymous creator.) That can

be represented as 0.00000001 Bitcoin, a dot followed by seven zeroes followed by a one, or1×10-8 in scientific notation That value must have seemed ridiculous when 1 Bitcoin was worth

$5, but makes slightly more sense when it trades at $50,000, making a satoshi $0.0005 or 1/20 of

a cent

Ethereum is denominated in units of the Ether, which can be divided down to the wei,

one-quintillionth of an ether or 1×10-18 (Wei is named for Wei Dai, a cryptography advocate.) Ether

are often described in abbreviated multiples of wei, such as gwei for gigawei, or a billion wei,

which is 1×10-9 of an Ether (A gwei is sometimes referred to as a shannon, referring to Claude

Shannon, who established the field of information theory.)

STABLECOINS TIE VALUE TO UNIT

There’s an exception to every rule, and a category of cryptocurrencies called stablecoins do have

an inherent value—they claim one at least These coins claim to keep reserves of fiat currency orcommodities on hand to allow them to peg their coin to the global financial system Often,stablecoins peg 1 unit to 1 U.S dollar You can read more about stablecoins in Stablecoins.The Token

When reading about coins or using cryptocurrency wallets and exchanges to buy, sell, or trade

value, you quickly come across the term token It’s often used in parallel, like “coins and

tokens.” At first glance, they may seem like a sub-type of coin, because they also store digitalvalue But tokens have a number of differences and limitations:

Trang 17

Coins are the native currency for the system they’re part of; tokens leverage other systems For example, Bitcoins are a native, fundamental part of the Bitcoin ecosystem.

In contrast, tokens are a special kind of transaction with no native value in thecryptocurrency Instead, a token transaction contains instructions about ownerships and

behavior These transactions are a form of smart contract, and tokens are usually

embedded on the Ethereum blockchain See Ethereum Smart Contracts for more details

Coins always represent value; tokens can represent many kinds of things With all

major cryptocurrencies and in nearly all others, the coin represents value held in thesystem expressed in some units A token can function just like a coin, but it can alsorepresent things like fractional ownership in physical artwork, shares in a “decentralized

financial” or DeFi venture, or allocated votes that can be cast towards decisions in

projects

Launching a new coin requires a lot of effort; tokens can be much more easily produced Because of the infrastructure of a cryptocurrency, it’s quite difficult to get a

competitor or complement to Bitcoin, Ethereum, or others deployed Because tokens rely

on existing systems, they’re much easier to launch We could produce a Take Controltoken quite easily using one of several platforms designed to help manage these projects

This book doesn’t emphasize tokens very much at all because tokens are often used for moreobscure, niche, risky, or technical purposes than cryptocoins—with one exception A special

subtype of token known as a non-fungible token or NFT was developed to allow the sale and

ownership of digital-only art and other goods I address NFTs in Understand Non-FungibleTokens (NFTs)

The Transaction

A cryptocurrency transaction records the transfer of value from one party to another, represented

by cryptographically defined addresses, explained in full in The Wallet later in this chapter The

transaction is the truth in the system: the only record that proves ownership.

Pass Value and Recoup Change

In the larger financial system, we’re used to paying for things in direct transactions with a moneyorder or cashier’s check (if you’re old school), a credit card, or cash; if the total is more than thepayment required, a retail clerk, say, will return the change

People accepting physical payment rely on conventions and checks and balances: a retail clerkmay look for security features in a bill above a moderate denomination; a credit card charge isprocessed through a network that validates the card is active, not stolen, and has enough of acredit limit left; for a cashier’s check, the recipient may call their bank or an issuing bank, orimpose a quasi-escrow of a waiting period for the check to clear the system successfully In the

Trang 18

olden days, we had to sign for things, too, and our signature checked against government-issued

ID was considered yet another quantum of validation

Cryptocurrency can be analogized to be somewhat the same A person making a payment usescoins that at least equal the value of the transaction, though they often exceed it They receive theremainder back

Payments are made to an address, which acts very much like a bank routing number and account

number: it provides a unique destination for someone to send value to you without interactingdirectly with you You can have as many addresses as you want, and no central authority assignsthem (It’s explained much further in The Wallet.)

Like a stored-value credit card, each cryptocurrency address has a balance: with a credit card,that balance is tracked and reported by the credit card issuer; in cryptocurrency, it’s the sum ofall previous transactions related to the address

In a conventional financial system, you would log in to your bank account or credit card accountand view the outstanding balance In cryptocurrency, it’s like logging in, downloading all

transactions ever performed with the account, and summing up a total for yourself, since there is

Nodes in a system that participate in distributing transactions and validating blocks—in Bitcoin,

these are full nodes, described above—keep a sort of running tally in a database of all addresses

that have available balances This tally allows rapid confirmation that a transaction draws alegitimate amount from an address or addresses

CH-CH-CH-CHANGE

Spending cryptocurrency doesn’t just “subtract” value from the originating address Instead, iteffectively creates two operations: the transfer requested is one; the second is that the balance on

the sending address is transferred to another address.

That difference, often described as the change, is more formally called the unspent transaction

output (UXTO) You may occasionally see that abbreviation in cryptocurrency discussions Therunning tally of unspent balances in addresses is the UXTO database

Wallets handle creating the destination address; users of a cryptocurrency long ago had to makemore decisions to ensure they retained the UXTO, but no longer Without a change address,

Trang 19

unspent balances go to the party that produced the block that contains the transaction I explainthat just ahead in The Blockchain.

That solves the balance part, but as a distributed system, cryptocurrency can’t rely on real-worldstyle mechanisms to ensure that a payment is legitimate—there’s nobody to check whether thecash is counterfeit, the check is a forgery, or the credit card belongs to someone else A digitalsignature suffices: it’s a way to produce a cryptographic proof that the person posting the

transaction has the right to spend (or unlock) the coins listed in the transaction.

Note: A digital signature on a transaction has a threefold role: it proves someone possesses the

secrets for the addresses used, it ensures the transaction was authorized by that person, and by itsnature it also proves that the transaction hasn’t been modified since it was posted to thecryptocurrency network

As a result, by the time a transaction is ready to be added to the cryptocurrency’s ledger, thedistributed system has confirmed that available funds of at least as much as the total to be spentare in place, and that the transaction sports a digital signature that proves the funds can be spent

Your right to spend that money has been confirmed.

The recipient doesn’t have to validate their right to receive money It’s only when they want to

spend it that they have to prove through the same process that they possess the necessary secrets.What Makes Up a Transaction

To be more technically explicit, a typical transaction has several elements Let’s use Bitcoin’stransaction details as an example, as it’s used as the basis of most cryptocurrency transactions:

 A unique transaction identifier that allows it to be distinguished forever from all othertransactions on the blockchain

One or more source addresses, or inputs, from which to draw payment, summing up to

have value which equals or exceeds the payment value; a wallet automatically selects theright combination (see The Wallet)

 For each input, two pieces of information that validate the legitimate owner of the inputs

referenced in the transaction, called the unlocking script

 An amount specified in the cryptocurrency coinage

A destination set of addresses, or outputs, including one that receives the leftover value

from the payment (this is also handled by a wallet)

Trang 20

For each output, a locking script or something similar: a puzzle that might be specified in

a simplified scripting language that can only be solved by the person who possesses thesecret connected to the specific output address

 An implicit, optional fee paid to miners for including the transaction in a block,calculated as the amount left over when subtracting the sum of outputs from inputs (thiscan be modified in a wallet)

Note: Fees reflect the pressure of uncommitted transactions given the relatively low rate of

transaction recording in some cryptocurrencies, such as Bitcoin Miners preferentially mint thehighest-fee transactions first See Proof Forms Consensus

Now that we know what’s in a transaction, we need to tackle the knotty problem of recording it,

so that a transfer of values takes place This all happens on the blockchain.

The Blockchain

One of the biggest problems with creating a system that records transactions without a centralparty to maintain an authoritative list or resolve conflicts in double spending is ensuring thatentries in a ledger become immutable If the records could change or weren’t reliable, therewould be no basis on which to establish provable ownership

The blockchain is that list, often called a distributed ledger, because it’s maintained by the

participation of everyone in a cryptocurrency system As the ledger grows, subsequent entries arecryptographically linked to earlier ones, which makes those earlier ones effectively impossible tochange after a short interval following their addition to the blockchain

To understand the blockchain, let’s start with a homely metaphor

All in All, It’s Just Another Brick in the Wall

Imagine a rectangular building of brick that’s under permanent construction—a sort of Tower ofBabel that rises ever higher as courses of bricks are laid on top of existing ones The building has

no limit on its height, but its stability is entirely based on well-laid bricks (Figure 4) Unlike

normal masonry, each brick laid depends on the stability of the previous brick, as well as allthose that precede that one

The people engaged in construction are masons who make their own bricks and charge rent tooccupy space in the ever-growing facility The masons agree among themselves to rules abouthow to pay for laying bricks These rules include that each brick has a series of unique ridges andfurrows in it, and a mason must find a brick to lay on top that matches those ridges and troughs

so it fits snugly in place

Trang 21

Figure 4: The journey of a billion

floors begins with a single brick (Photo by Karen Uppal )

As bricks are laid, anyone who works in the building can use an infinitely extensible ladder andmagnifying glass to read these receipts and perform accounting based on them

Masons are always competing to lay the next brick But they have to search through their store ofbricks to find the right one The first to do so gets paid for laying it, although they have to wait awhile—100 more bricks must be laid before they receive their payment, which is locked into thebrick they made as a date-stamped I.O.U This delay is to ensure they mortared in the brick welland that masons have an incentive to keep building It takes about the same amount of time to layeach brick

The masons are hard on themselves If they become more productive and can lay bricks faster,they agree to penalize themselves for their productivity by making it even harder to find a brickthat matches! Anything to keep the speed of bricklaying stable If the building grew too fast, theycouldn’t rent out the new space quickly enough

Sometimes builders get into a sort of competition for payment when two bricks are placedseparately at around the same time at different places on the top course The building winds upwith multiple towers or branches heading upward When that happens, masons don’t removebricks and start over Instead, some choose to add bricks on top of one pile, while others work onthe other (Let’s also imagine physics doesn’t apply here, so they can build two or more branchesside by side without structural integrity issues.)

Trang 22

You can see how this plays out: if the majority of masons (even by a slight margin) work on onetower and a minority on the other, the majority will always build faster.

Another rule they agree on is that when this occurs, the tallest tower always wins Within a fewbricks, it’s clear which tower is growing faster, and the shorter branch is abandoned (and themasons who worked on it aren’t paid for that work)

Note: Some masons might refuse to give up, and continue building their tower off to the side.

That’s fine, but it’s no longer connected to the original building, and they don’t get a share of therent from the main building’s newer construction or vice versa

Effectively, bricks become permanent and effectively immovable not very long after they’reinitially mortared in—with a key workaround Sometimes masons may disagree with thedirection the building process took They’ll walk back a brick or several and start building a newtower from that point Their goal is to overtake the main branch they left behind

But it still takes them just as long to lay each brick from the point they chose—whether it’s backone brick or 1,000—as it does each new brick on the main tower As a result, these dissidentbricklayers can only eventually overtake their comrades if they represent over half of themasonry power available With more than half, they will slowly but surely catch up

And the task might be futile, as the masons aren’t sure they have and will continue to haveenough bricklaying capability to build higher The process may lead to defections from themasons involved: because it subverts the system they all agreed to, it’s very hard to keep enoughpeople signed on to this re-laying project

And fellow masons, seeing the majority of their comrades no longer working on the main branchwill certainly have their suspicions about what’s going on This could shatter the building

How the Blockchain Really Works

My metaphor isn’t that far off The blockchain is a series of blocks—our metaphorical bricks.Each block contains a number of transactions that people have conducted over thecryptocurrency network

Cryptocurrency transactions can’t be finalized until they are recorded in a block that is

successfully mined, as described in Dig into Currency Mining, later in this chapter Mining islike sealing our figurative slips of paper into transparent bricks and mortaring a brick into place

Cryptography underlies the whole process The unique set of transactions in a block is validated

by the mining process, which produces a sort of signature that can’t be forged or faked If asingle bit of the block is changed on its transmission across the cryptocurrency system, it can bedetermined instantly by every participant

Trang 23

The block is also cryptographically bound to the previous block, hence the term blockchain: each

subsequent block is like a brick rigidly mortared to the previous one Any manipulation of aprevious block prevents the validation of all blocks that follow

The metaphor about masons building separate branches of a tower applies, too Sometimesdifferent miners will produce a valid block at the same time at different places in the globalnetwork of nodes that forms a cryptocurrency If so, because these systems are distributed,there’s no decision made about which block is valid

Instead, other miners—sometimes by choice and sometimes arbitrarily—build on one or another(or sometimes multiple) of the near-simultaneously mined blocks The greater percentage ofminers that build on one block to the exclusion of one or all others, the quicker that blockchaingrows

Cryptocurrencies typically all rely on the rule that the longest blockchain is the best one So asblocks are added faster to one potential blockchain versus others, it quickly becomes clear which

is the longest and which “wins.” The other blockchains are abandoned I’ll get into this more

in Dig into Currency Mining, and in Proof of Work about how it affects transactions recorded inthose abandoned blocks

Note: There can be malicious attempts to fork a blockchain by going back several blocks or

more and mining new blocks, allowing or resulting in double spending This is

called reorganization and requires a majority of computing capacity See Blockchain Hijacking

Anyone can download the entire blockchain, and to use a cryptocurrency effectively, you sort ofneed to have a copy of the whole thing (Many kinds of cryptocurrency nodes automaticallydownload the entire chain.) As discussed earlier, the current state of ownership of value in adigital cash system is the process of looking through all transactions from start to finish Asblocks are added, nodes are appended to their local copy of the blockchain

INSTITUTIONS LIKE THE THOUGHT OF IMMUTABLE TRANSACTIONS

You can see why banks and governments have some excitement about the blockchain, a way tocreate an immutable ledger, even if they don’t care for the currency part But in all existingcryptocurrencies, the value and the blockchain are completely intertwined: the way thattransactions are uniquely locked into blocks derives from the reward miners receive forperforming the task of proof I describe these jobs in Proof Forms Consensus

What’s the Fork?

You may know the term fork from free or open-source software worlds It’s most often used to

describe when a given software project finds itself with competing opinions about its future, and

it branches—or forks—into two or more paths One group prefers a new webpage renderinglibrary on a browser project, while another wants to rewrite from scratch the library that’s beenused all along

Trang 24

Depending on the software license, these disagreements lead to a fork The code diverges and

rarely joins up again, though there are exceptions (“The Road Not Taken” doesn’t usuallyapply.)

With cryptocurrency, there are generally two categories of fork, accidental and intentional, and two varieties of intentional: soft and hard These work as follows:

Accidental: An accidental fork is common Whenever two or more miners find a block at

about the same moment, the blockchain forks, as described above The fork is resolved

by the longest chain, and the other or others are orphaned.

Soft fork: A soft fork allows minor upgrades to a cryptocurrency protocol that’s

backward compatible with nodes running older software Only a majority of miningcapacity has to shift to an upgraded standard Older nodes can’t mine blocks accepted bynew ones, and they ignore transactions of the newer type Ultimately, older nodes have to

be updated if their operators want to continue participating in the system, but no one canmade to do so

Hard fork: Divergent ideas about a cryptocurrency can result in significant changes to

the protocol that produce two different, incompatible blockchains from the point somenodes introduce the change Because both blockchains are still valid, this sometimesresults in the introduction of a new currency Among successful hard forks are BitcoinCash and Bitcoin Gold, cleaved from the Bitcoin blockchain Several hard forks fromcryptocurrencies have failed to find an audience, however, including multiple attempts toupdate Bitcoin’s standard to include more transactions in each block for efficiency’ssake

To chop this up a different way, here’s the key distinction between a fork that doesn’t upset theapple cart and one that does:

 Accidental forks and soft forks retain compatibility and rely on the longest-chainapproach: the majority of mining capacity defines the valid chain

 Hard forks result in two distinct chains with a common history at the point they diverge

With knowledge in mind about how the blockchain works, we can move on to the wallet, amethod for individuals using cryptocurrency to handle the encryption components and producetransactions

Trang 25

The Wallet

Like a cryptocurrency coin, a wallet is a simple virtual object at heart: it’s the place where youmanage the cryptographic elements necessary to tell others how to pay you in cryptocoin and tospend it, while securing private details against intrusion or access by others

Tip: This section offers background about wallets and how they work For details on picking a

wallet and putting it to use, see Get a Wallet

Just like physical credit cards with long numbers you typically don’t memorize are stored in anactual wallet or purse that you keep secure against theft, a digital wallet contains very longnumbers that correspond to payments and ownership You dip or tap (or even swipe) a creditcard to make a payment in the retail world; you use your wallet to perform the equivalentoperations with a cryptocurrency

Note: There’s no monolithic “wallet” software because the nature of cryptocurrency is there is

no central authority that dictates anything!

Bitcoin and other cryptocurrencies have no requirement for a wallet as such A wallet is more of

a convenience, as cryptocurrency interactions require the routine exercise of a small range ofencryption tasks

The crispest definition I’ve read is found at Bankrate: “[T]he information stored on the walletonly points to your cash’s location on the blockchain.”

To explain a wallet, I have to start with some cryptography Let’s understand what public-key cryptography is and how it relates to payment addresses in cryptocurrency, which are used in

transactions

THIS IS NOT WHAT A WALLET IS

A wallet is often explained incorrectly in periodical coverage and even in specializedpublications On June 8, 2021, a Washington Post story about the FBI recovering some of thecryptocurrency obtained in a ransomware attack noted:

“The bureau obtained the ‘private key’ for the wallet address, according to an affidavit for thewarrant The key is basically a password that enabled the FBI to move bitcoin out of the wallet.”

As you’ll read next, the FBI did obtain a secret (the private key) created by a wallet, but onedoesn’t move “bitcoin out of the wallet”—Bitcoin and all cryptocurrency is only on theblockchain!

And the otherwise excellent resource for cryptocurrency explanations, Investopedia, notes ofwallets: “A Bitcoin wallet is a software program in which Bitcoins are stored Technically,Bitcoins are not stored anywhere.” I can’t imagine anything more contradictory!

Trang 26

Public-Key Cryptography

Since the advent of something akin to modern cryptography hundreds of years ago, the keyproblem has been keys—rather, the secrecy of keys Early crypto geniuses developed algorithmsthat exceeded the abilities of anyone but other geniuses of their day to crack in a “brute-force”manner of trying all possible letter and number combinations

But the weakness is that two or more parties had to share a key (for ciphers, which used math) or

a code book (for codes that typically substituted words) How can you share those secrets safely?You needed to meet in person, send innocuous information by pre-arrangement that containedsecrets embedded in them, use messengers, rely on books you both owned (of the same printingand edition!), and so forth Often, you couldn’t securely exchange keys

Note: Benjamin Franklin used a cipher with diplomat Charles Guillaumes Frédéric Dumas, who

devised it The encryption was based on the introduction of a book Dumas had written and sent

to Franklin!

Whatever key-exchange method you chose was almost always liable to literal brute-force

extraction (Figure 5) Not having to exchange keys directly provided fewer opportunities for

interception—or violence!

Figure 5: While paper beats rock,

wrench beats secret ( xkcd )

It took until the 1970s for mathematicians to develop a practical method for key exchange thatallowed two parties to share their respective keys openly, even publish them, without being

susceptible to decryption This became known as public-key cryptography.

With this approach, an algorithm generates two distinct keys using a one-way function—something so intractable that reversing it is currently infeasible

One key is the public key and the other the private key The public key may be freely shared,

published online, placed on business cards, and so forth Knowledge of the public key provides

Trang 27

no effective help in cracking the private key As a result, the private key is the true secret andmust be kept absolutely secure.

This key pair allows two fantastic advantages:

Secret one-way messages: Someone with the public key can send a secret message only

the recipient with the private key can read No one else can decipher it

Tamper-defeating transmitted messages: Someone with the private key can digitally

sign an unencrypted message and transmit it privately or publicly That allows anyone

with the public key to validate the message, which proves three related aspects:

o Only the person possessing the private key corresponding to the public key couldhave signed it

o That person with the key intended to sign it, thus vouching for the contents of themessage (They might have been fooled, but it’s a very intentional act.)

o The message is identical bit-for-bit with what the sender saw or created when theysigned it If it’s tampered with in any fashion, public-key validation fails

Cryptocurrency transactions rely on public-key cryptography All interactions in acryptocurrency are transfers, and you have to transfer coins somewhere Since a cryptocurrency

is the sum of all transactions on its blockchain, it follows that no one possesses value per se,except as the calculation of blockchain interactions

Ownership is thus effectively held entirely by possessing private keys corresponding to validtransactions If there’s any secret—or just a point of real obscurity—in cryptocurrency, that’s it

Note: Back in The Transaction I explained that cryptocurrency relies on digital signatures tounlock value stored on the blockchain and spend it Now you can see how that works: thesignature is a form of validation and proof all at once

AVOID LOSING A PRIVATE KEY

It follows that because the private key is your ultimate and sole proof of ownership, losing access

to it means the value associated can never be recovered That can happen because a device ordrive is stolen, destroyed, thrown away, or fails, or you forgot or lose a passphrase that lets youunlock hardware that is storing your private keys It’s thought that a double-digit percentage ofall Bitcoins—potentially well over one hundred billion of dollars of exchange-based value—isinaccessible forever due to lost keys This one man has spent years of his life and (maybe)destroyed his marriage over trying to recover a dead hard drive from a UK dump

Trang 28

Because of this risk, wallets often offer a way to generate a long but memorable passphrase—aset of words, typically—that allows recovery of the key pair There’s a myth that truly randompasswords are always best, like JaFsab4s6Yg*L; I wrote about this myth in 2015 and see Take Control of Your Passwords But when you need to memorize something or enter it easily, wordsare better and can be plenty secure if they are generated in random combinations.

A wallet creates necessary key pairs as you ask people to pay you and spend cryptocurrency Thewallet provides the infrastructure and management, so that it can be effectively invisible to you

Note: Wallets generally don’t generate key pairs on demand, but use a seed key that produces a

vast number of potential key pairs you can use across various currencies I explain how thisworks in Wallets You Can Hold much later in the book

There’s an important twist here at the end Public keys aren’t published directly to receivecryptocurrency payments anymore, although they were at one point One reason is that they’rerather long at 64 hexadecimal digits People don’t generally type in cryptocurrency paymentinformation, but it can still be unwieldy to manage such a long run of text

Tip: Not sure what hexadecimal is? Read Learn About Hexadecimal

But there’s also more than a little concern about the future Public-key cryptography relies oncurrent trends in the increase of computational power keeping private keys secure from brute-force discovery, and there’s no practical means in sight However, there are theoretical worries: aflaw in a critical algorithm so far undiscovered could be revealed, or the advent of quantumcomputing might provide near-instantaneous solutions of the previously intractable factoringalgorithm that underlies this form of encryption

Because the creators and advocates of cryptocurrency think of it as something that will last farinto the future, the direct use of public keys could be a long-term risk To layer in additionalcomplexity and deter possible future cracking, most cryptocurrencies replace posting a public

key as a payment location with an address, which is derived from a public key or even more

complicated payment arrangements Addresses are our next topic

PGP USES PUBLIC-KEY CRYPTOGRAPHY IN PART

If you know about PGP (Pretty Good Privacy), the above explanation might seem a little off.PGP is used with documents and email messages, and lets you send messages to multiplerecipients That’s because PGP combines public-key cryptography and regular symmetricencryption, where the same secret key encrypts and decrypts a message

In PGP, a special header contains the key encrypted separately with each recipient’s public key,while the body is encrypted with the symmetric key A recipient’s email or other app uses theirprivate key to unlock the symmetric key and read the message

Trang 29

Cryptocurrency Addresses

Every payment you receive or send involves value sent to a cryptocurrency address In nearly all

cryptocurrencies, that’s an algorithmic and cryptographic transformation of public keys held in awallet into a form that can’t be reversed out However, the owner of the public and private keycan use both to prove ownership and spend coin

You can think of the private key, public, and address as having a relationship like a special postoffice with a nearly infinite number of boxes that can be rented for delivery:

 The private key is like the key to a post office box

 The public key is the number on the front of the box that the private key unlocks

 The address is what’s used by postal clerks to deliver envelopes to a post office boxwithout knowing the number—they only have a formula on how to figure which box orboxes to slide envelopes into from the backside in the sorting plant

In this analogy, if someone sends you a check, that person doesn’t know your actual box number,but postal sorters can deliver it, and only you can find the right box, unlock it, remove theenvelope, and deposit the check Even if someone developed a way to create usable post officebox keys from box numbers, they wouldn’t know where to start—they wouldn’t know thenumbers of any boxes

AN ADDRESS IS ALSO LIKE A CHIP OR MOBILE TRANSACTION

To ground this again in things we all know, an address’s relationship to a public key is actuallyquite like the way in which credit card transactions are handled by a chip dipping into a point-of-sale reader, an NFC tap-and-pay action, or mobile payment via Apple Pay, Android Pay, and thelike

When you used to swipe a card or when you still enter a card’s details, it’s like using both thepublic and private key: someone with the number and confirming digits could hijack youraccount When you chip, tap, or pay by mobile, the chip or mobile device generates a unique set

of transaction details that are passed along preventing the merchant or anyone grabbing themerchant’s data from obtaining enough credit card information to conduct additional payments

Addresses are more precisely a way to let someone who possesses a valid public/private key pair

to prove that ownership and spend coin The proof comes in the form of code written in a verysimple scripting language—Bitcoin’s language is literally named Script The script details acryptographic puzzle that has to be solved, and only the owner of the encryption data associatedwith an address can demonstrate they know how to produce that solution

The code can be very simple The most popular Bitcoin transaction merely confirms that the

person spending coin owns the public key associated with an address As part of the transaction,

Trang 30

the owner provides the full public key (previously hidden) and a digitally signed version of thepublic key A simple script checks that the key was signed by the private key and matches theversion in the address If that’s valid, the value at that address can be spent.

The address and script have this metaphorical relationship: The address is a locked box with asecurity slot on it into which people can push money that’s handed around by one person tocollect cash A combination lock secures the box People can add value to the box just byknowing where it is To extract the cash, however, one needs a set of instructions of how to turnthe dial on the combination lock (the script) and the combination numbers (the associated privatekey)

Note: Such a box can have multiple combination locks with a more sophisticated set of

instructions, requiring multiple people fiddle with dials on each combination lock before the boxopens

The script is used in a transaction in two complementary ways:

To lock a transaction, by imposing conditions on how value associated with the address

can be spent

To unlock a transaction, allowing the party that owns an address to meet those conditions

and spend the associated value

Tip: Don’t worry about learning how to write a script to create a payment address: any wallet

will perform all the math and management involved But it’s good to understand the whys behindchoices made in producing addresses

Your wallet creates an address every time you want to receive a unique payment People cantransfer payments to an address simply by knowing it and including it as a destination or output

in their transaction to spend coin You might use an address for a while or for a single purpose.The only overhead is uniqueness: you need a new key pair for every address, but wallets aredesigned for precisely that purpose

QR CODES MAKE USING ADDRESSES EASIER

An advantage of using an address instead of the public key is that the address formats are shortenough to type in a pinch But they can also be easily converted to small QR codes, two-dimensional graphical encodings of data, like text They’re compact, and can be read by walletsoftware and automatically recognized by the built-in camera apps in Android phones, iPhones,and iPads for the last several years

These addresses vary in form across systems, so I’ll talk about the widely used Bitcoin andEthereum formats here, and discuss other versions in Discover How Major CryptocurrenciesWork for each coin covered

Trang 31

BLOCKCHAINS PROVIDE PSEUDO-ANONYMITY

The big cryptocurrencies and most of the others don’t provide true anonymity from outsidescrutiny, because the use of addresses and the public nature of the distributed ledger allow forms

of tracking This has enabled researchers and law enforcement to trace coin payments, andsometimes tie them to an exchange, which can have its records subpoenaed or seized

This is more properly pseudo-anonymity or partial anonymity, in that in most cases and for most

purposes it’s anonymous enough Some cryptocurrencies do engage additional cryptographictricks to provide something closer to full anonymity across the blockchain, like Monero andZcash

Bitcoin Addresses

While Bitcoin started with simpler forms of addresses, three are commonly used now, each ofwhich has a unique numerical prefix

Note: Addresses require a transformation known as hashing, which takes any length input and

produces a fixed-length output that can’t be reversed to find the input This is explained in ProofForms Consensus, as hashing is a key part of mining

Here are the three most-popular formats:

Pay to Public Key Hash (P2PKH), prefix 1: This simple script is a common addressing

format to accept a payment intended for a single party (See the sidebar below for howthe public key is transformed.) Dash, Dogecoin, and Litecoin use an identical format,with prefixes X, D and L, respectively An example address lookslike: 18XrbDTEeDmKj42nj12fbbr6bLMPNG9DCD

Tip: Dying to know in detail how this format is calculated? See How a P2PKH BitcoinAddress Is Computed

Pay to Script Hash (P2SH), prefix 3: For transactions including more than two

receiving parties and other complexities, a more complex script can be used, and theaddress isn’t an encoded hash of a public key, but a hash of the script that includes thepayment addresses The script itself is only provided when someone wants to spend coinassociated with the address; until then, it’s a mystery to everyone involved in thecryptocurrency

Segregated Witness (SegWit), prefix 3 or bc1: Segregated Witness solved a flaw in

Bitcoin and some other cryptocurrencies described below by moving the digital signature

part of transactions, called the witness, to a separate part of the block For backwards

compatibility with older nodes and wallets, SegWit transactions can be made inside of

Trang 32

P2SH and those have a prefix of 3; native SegWit transactions use a different hashingalgorithm (bech32) and start with bc1 About half of all Bitcoin transactions now use

like: bc1q3a53pf6gkwa5axsaa2z8cwj688yk2wnj69ht3f

Warning! Older wallet software may not appropriately manage sending money to addresses that

start with bc1, even though they may allow the transactions You could lose access to that value.Check that your wallet handles native SegWit transactions

SEGWIT SOLVED A BITCOIN BUG

SegWit mitigated a flaw in Bitcoin that allows malicious parties to duplicate transactions queuedfor mining with small changes that let them remain valid, but, if approved before the legitimatetransaction, would lock the transferred value away forever It doesn’t result in theft, but it’sdisruptive and wasteful A large-scale attack based on this flaw took place in 2015 In 2017,SegWit rolled out to Bitcoin A few other cryptocurrencies adopted it as well

SegWit required changes in how Bitcoin stores transactions in a block: less information would be

in the body of the transaction by segregating some of the validation details in a separatestructure This allowed backwards compatibility with older Bitcoin nodes and wallets thatadhered to a 1 MB limit per block set in 2010

However, it also allowed more transactions to be mined in each block, a point of somecontention Miners want to preserve pressure on adding transactions to keep fees higher—particularly as Bitcoin moves towards an inevitable future in which there are no rewards forblock mining (See Bitcoin.)

In the end, nearly all people running the peer-to-peer nodes that power Bitcoin revolted overminers’ rejection of SegWit, and it was incorporated—and more transactions per block camewith it

Ethereum Addresses

Ethereum addresses are always in hexadecimal and always start with 0x These kinds of

addresses are known in Ethereum as external accounts That’s to distinguish from smart

contracts, which have a different kind of address; I discuss them in Ethereum Smart Contracts

Tip: For slightly more technical detail, see Ethereum Addresses Hash and Truncate

Ethereum also supports smart contracts, an attempt to encode business logic into a transaction.

Each smart contract has an address Read more about how this works in Ethereum

Now that you know about public-key cryptography and addresses, it’s time to look at theunderlying basis of the whole system: mining

table of contents

Trang 33

Dig into Currency Mining

The heart of cryptocurrency is mining A miner, a specialized participant in a cryptocurrency

network, takes transactions and binds them up into the unit of the blockchain—the block Theythen distribute these blocks, which the rest of the cryptocurrency system validates and then adds

to the blockchain Miners make the transactions embedded in blocks as permanent as anythingcan be in cryptocurrency

Much like wresting minerals from the earth, mining requires some kind of hard effort and justlike resource mining, the reason to do this is profit Cryptocurrencies offer a reward for miningthat varies widely among systems in use and which are issued in the form of the samecryptocurrency that they’re mining

The miners don’t need to care about the transactions—they only want the reward But theconcepts under cryptocurrency are designed to align the reward they obtain with an importantoutcome: locking transactions so that the unique value associated with a transaction can only bespent once (Mining is essentially a very elaborate anti-counterfeiting effort.)

In the same way that most people don’t work for a government mint or know anyone who printscurrency or stamps coins, most people and institutions participating in a cryptocurrency systemhave no connection to mining at all They don’t exactly care about the miners—not in a callousway, but a practical one However, they want the miners to keep working busily away forever,like an ant colony’s workers wanting the queen to keep producing eggs that allow the colony topersist Those engaged in transactions in a cryptocurrency want them to be written to theblockchain as securely and rapidly as possible

Note: I mentioned that cryptocurrency requires peer-to-peer software known as nodes Miners

run entirely different software to create proof needed for a given cryptocurrency They use anode only to broadcast their result Only miners need to run mining software

In this chapter, I start by explaining aspects of mining that help you understand its place in thecryptocurrency ecosystem In the next section, Proof Forms Consensus, I dive into proofs, or

ways in which consensus is achieved to assure blocks are valid

Trang 34

MINING VERSUS VALIDATION

Cryptocurrencies extend a blockchain through a consensus mechanism, a method of assuring

everyone agrees that a block is valid and should be added to the ledger The vast majority of

value tied up in cryptocurrencies currently relies on coins that are produced through proof of work, which requires mining; see Proof of Work

However, as I explain later in this chapter, other forms of consensus are achieved through

different kinds of proof, the most significant of which require validation, or an agreement among

participating parties on how to assure a block should be added without calculating fiendishpuzzles I explain this starting in Proof of Stake

You can approach mining by starting with the elements shared across all cryptocurrencies, andfor which I provide links to where these details are discussed at length:

 Preserving the uniqueness of transactions and transfer of value to avoid double spendingand paradoxes; this is explained above in What’s the Fork? and below in What RoleMiners Occupy

 Locking transactions into a block; see How Blocks Are Mined and Proof FormsConsensus

 Linking one block to its predecessor to create a verifiable blockchain; see Proof FormsConsensus

 Receipt of a reward for mining the block; see How Blocks Are Mined

 Receipt of a fee for each transaction recorded in a block; see How Blocks Are MinedLet’s start with how miners work within the system

What Role Miners Occupy

Cryptocurrency in general combines a lot of economic and political theory, but mining is the

crucible in which the theories are tested Mining contains aspects of anarcho-syndicalism, in

which action is taken directly by individuals to produce a cooperative, un-hierarchical

economy; libertarianism, which stresses personal autonomy and decision making; and faire, an economic system that frees parties from regulations and most constraints.

laissez-With no central authority, no entity can coerce any participant into using the system, and no one

is forced to mine No rules can be imposed on anyone who agrees to be part of the system; theycan always create a splinter movement if they disagree with majority actions

Trang 35

Instead, miners effectively control operations, because they engage in a critical task Decisions inmost cryptocurrencies are made nearly exclusively by a majority of mining capacity: take thecomputational capacity of all miners in the system, and 51% of that is enough to make adecision But no parties need collaborate; instead, each can independently make a decision about,say, whether to adopt a new transaction type or protocol change.

(There’s an opposing theory, by the way, that though miners may control the most important part

of the system, that software developers are actually more powerful: miners may want some part

of a system changed, but only developers with the recondite knowledge required to build global,real-time, peer-to-peer cryptocurrency systems can implement those changes…and have tochoose to do so.)

Nearly all miners associate—again, freely and uncoerced—with at least some others Such anassociation is called a mining pool A pool allows participants to share a reward on some basis,such as contributed mining capacity, no matter which member of the pool mines the latest block.This reduces volatility in return and overcomes some of the necessary pseudo-randomness bakedinto how blocks are found

DANGER LURKS IN THE WATER

Mining pools and dominant miners are dangerous in a cryptocurrency, because any one party orcabal having a majority of computational capacity can let them roll back the blockchain orimpose changes to the standard by effectively outvoting the minority Even a large plurality,according to some academic papers, could allow disruption or roll backs

This is horribly destabilizing and would shake confidence in the value of a digital system, andthus be so counterproductive as to make no sense It’s also expensive, because every cycle amajority mining pool devoted to rolling back blocks is a cycle they’re paying for in terms of

equipment and electricity and other overhead and not using to mine new blocks and acquire new

value (An excellent explanation of this theory appears at Coindesk.)

Because of the fears people have of majority control, however, pools seem to avoid eitheraccumulating that much power or talking about it publicly In 2014, one Bitcoin pool, GHash.io,voluntarily reduced its size after crossing 51% capacity

Miners may use personal computers to carry out the tasks required to earn rewards But in theleading cryptocurrencies, the minimum computational requirements are absurdly high Instead,miners spend millions of dollars or much more on custom servers running specialized chipsoptimized for the proof required in a given cryptocurrency

These servers are run by the hundreds to tens of thousands in data centers around the world,almost all of which are now located on power grids where the miners can obtain inexpensiveelectrical rates, or even generate it through renewable sources, like solar or wind (I’ll get intothe environmental issues of electrical use in Explore Environmental and Structural Hazards, andhow cities, regions, and countries are cracking down.)

Trang 36

Given that miners derive their reward from the value associated with the cryptocurrency, and yetthese have no value without miners being involved, how does a digital system ever get started—who’s the chicken and who’s the egg?

The answer is that it took years for the first effective cryptocurrency, Bitcoin, to gather speed andhave much participation beyond people with more of an academic or crypto-anarchic interest.Later systems have benefitted from people eager to replicate Bitcoin’s success They create anew cryptocurrency, often from Bitcoin or other open-source templates A cryptocurrency’sdevelopers often pre-seed their currency with some amount of coinage that they can retain anddistribute They can provide miners an incentive from the get-go by giving them “free” value inaddition to rewards they obtain by mining

How Blocks Are Mined

Mining can be explained without any math in a straightforward way This is generally how itworks:

1 People are constantly creating transactions, which are distributed across the peer-to-peercryptocurrency network

2 Full nodes receive transactions, validate them, and hold them in reserve until they arerecorded into a block

3 The instant after a previous block mined by anyone is broadcast and verified by a miner’snode, that node gathers a set of available transactions, combines it with a cryptographicsignature from the previous block, and starts cycling through attempts to match a pattern.The pattern is hard to find and infeasible to predict: you can’t throw math at it to figureout how long it will take

Note: This is true for proof of work; other proofs may yet become a reality, as I explain

in Proof Forms Consensus next

4 One or more miners’ nodes finds a match with the pattern They broadcast the result, andother nodes verify the block If it’s correct—which it would be unless something trulyterrible had happened—mining nodes all start working on the next block, excludingtransactions just mined in the just-completed one

5 Some number of blocks later, the miner receives their reward This doesn’t happeninstantly to avoid problems resulting from accidental forks, and to provide an incentive tokeep miners working on extending the chain to receive their payment In Bitcoin, rewardsare transferred in the 101st block after the one mined

Trang 37

For this activity, a successful miner receives two kinds of rewards:

 Some fixed amount of coin denominated in the cryptocurrency awarded by the network,baked into the protocol and software

 A fee for each transaction recorded in the mined block; the fee may be different for everytransaction, and is set by the party who wants to record it

Note: I’ll talk more about how the specifics of this process for each coin type in Discover HowMajor Cryptocurrencies Work

So far, I’ve avoided talking much about math and cryptography in a book about cryptocurrency

In the next section on proof, I start picking away at those details

Proof Forms Consensus

Back in What Is Money?, I suggested in passing that fiat currency is a form of consensualhallucination: we all agree to believe in it, and as long as we believe, it retains value Moreaccurately, we accept the value of money in part based on the stability and validity of thegovernment that issues it

Cryptocurrency is a harder nut to crack when it comes to belief Without a government thatmoves money around through a central bank, Bitcoin and its comrades require an even higherdegree of shared belief that the ridiculous thing they’re playing with has real value

But those engaged in cryptocurrency would emphasize that it has a leg up on regular old money

Third, when there’s doubt, consensus wins In cryptocurrency, consensus is a

protocol-based agreement about how to define legitimate transactions Collectively, these are

known as consensus mechanisms.

Tip: More briefly: a cryptocurrency exists as an association of people who agree on protocols

that describe how to produce valid and verifiable transactions in the system

Trang 38

Start with Proof

Consensus mechanisms are described as proof, where that word is used a bit like mathematical

proof In math, a proof lists the steps that are taken from start to finish to demonstrate the truth of

a proposition In cryptocurrency, proof is some process that demonstrates a valid block for theblockchain with a set of legitimate transactions

But cryptocurrency requires the same amount of effort to spoof as to create for legitimatepurposes For instance, in most cryptocurrency mining, each block takes exactly as manycalculations on average to mine as any other over short periods of time, like a few days Tocreate a replacement block that’s valid, you have to perform just as many calculations on average

as the legitimate block you’re attempting to supplant

Proof is also the thing that prevents double spending, which is a form of counterfeiting for

encrypted coinage Double spending destroys the value and integrity of the system byundermining faith that a given transaction, once issued—and a certain short period of time haspassed to resolve accidental forking; see What’s the Fork?—is permanent

Tip: Again, more briefly: proof lets a blockchain grow in a manner all participants agree is valid

while preventing double spending

This is absolutely akin to how fraudulent currency—whether coinage or serial-numbered papermoney—can undermine trust, and thus the value of, an entire monetary system

Note: Forgers may print unique serial numbers on bills, but the principle is the same: they’re

spending money that doesn’t have a legitimate existence in the system

In cryptocurrency, every transaction is uniquely numbered and locked with encryption Atransaction can’t be forged or duplicated, so the value associated with a transaction can’t be spenttwice

Note: There have been successful exploits that destroy value, by creating duplicate transactions

that produce a result that prevents anyone from ever retrieving the value This was the reason forthe development of the SegWit address discussed in Bitcoin Addresses

With physical currency, central banks employ ever more sophisticated measures to resist forgery

and make it possible for end users (banks, stores, and even average people) to validate a bill by

looking for particular features (Figure 6).

Trang 39

Figure 6: The current $50 bill has

raised printing, microprinting, and color-shifted printing of the 50 (lower-right corner), while the paper has an embedded security thread (it’s visible, but also glows yellow in ultraviolet light), contains raised portions, includes a watermark of the president, and has red and blue fibers woven throughout (Image: U.S Bureau of Engraving and Printing)

Mining provides a way to validate transactions and unique spending automatically andcryptographically by building the structure of a block around a set of transactions Building thatstructure, or creating proof, requires resources It must “cost” as much in some form to mine areplacement block as the original, defeating that utility in most cases

In a distributed system, proof has to do the work of a central authority like a central bank.Nobody individually or organizationally can validate the uniqueness of a transaction—only thesystem as a whole can via mining based on proof

I’ve been talking about proof generically, and there are several forms of it that could be used So

far, only proof of work, described first below, has shown itself effective in practice It drives

Bitcoin, Ethereum, and all other major cryptocurrencies But it comes with a terriblewastefulness, as I describe next and in Explore Environmental and Structural Hazards What if

we don’t want to burn the planet down with proof of work? Aren’t there alternatives “Yes—but”

is the answer

Bitcoin wasn’t designed around the notion of an entire country’s worth of electricity calculatinghashes, but neither is there a good way for it to step back from the brink Ethereum, in contrast,

has planned a move for several years to a less unjustifiable proof, proof of stake, which appears

to be on track to happen between late 2021 and early 2022

There are also other kinds of consensus mechanisms that have been tested or are underconsideration, and which I describe near the end

Trang 40

Solve a Puzzle By Coming in Below a Target

The idea is that to prevent people from carrying out an action that’s deleterious to a system, youmake it cost them processing cycles This relies on a mathematical hunt for a needle in ahaystack that uses an algorithm with a trick to it The trick prevents shortcuts to finding theneedle, making all efforts to find it consume nearly the same amount of computational resources

You can find the needle only by looking really hard—you can’t jump into the haystack with a

magnet

Note: This search involves a complicated use of a cryptographic hashing algorithm If you’re

dying to know the full story, consult Make a Hash of It in Appendix A: Technical Explanations

In the case of cryptocurrency, your unit of measure is a transaction, and the desired outcome is ablock that contains a set of transactions that every node on the currency’s network can usecryptography to verify independently Proof of work ensures that it is just as “expensive”computationally (and possibly in actual cash expended) to create a replacement block as it was tocreate the original one

Proof of work is the method of mining for cryptocurrencies that represent the vast majority ofexchange-based value, providing the underpinning of Bitcoin, Ethereum, Ethereum Classic,Litecoin, and Bitcoin Cash Even the “joke” cryptocurrency Dogecoin that you may have heard

of relies on it

Mining software begins the process by examining all transactions broadcast across the peer network that makes up the cryptocurrency Miners use their own algorithms for selectingtransactions to include in a block—about 200 fit in a block for Ethereum and 2,000 for Bitcoin

peer-to-A miner’s software selects the highest-value transactions first to maximize the return for asuccessfully mined block With Bitcoin and many other popular cryptocurrencies, there

are always enough transactions waiting to be mined to fill a block many times over.

Note: I explain fees in greater depth in Discover How Major CryptocurrenciesWork for Bitcoin and Ethereum

A miner takes these transactions and combines them into a test block that includes acryptographically tied reference to the previous block and also embeds an increment counter set

to zero It runs the block through a standard cryptographic transformation and checks whetherthe result is below a certain target number adjusted regularly to ensure blocks are issued at

certain intervals The target number is derived from the current network difficulty, an adjustment

designed to keep blocks being mined at regular time intervals

For example, Bitcoin is designed to always adjust so that miners find a block below that targetnumber about every 10 minutes Every two weeks or so, the network checks that cadence andadjusts difficulty up or down depending on the time blocks actually took

Ngày đăng: 17/07/2024, 09:27

🧩 Sản phẩm bạn có thể quan tâm

w