Bitcoin Cash is a collection of concepts and technologies that form the basis of a digital money ecosystem. Units of currency called bitcoin are used to store and transmit value among participants in the Bitcoin Cash network. Bitcoin Cash users communicate with each other using the Bitcoin Cash protocol primarily via the internet, although other transport networks can also be used. The Bitcoin Cash protocol stack, available as open source software, can be run on a wide range of computing devices, including laptops and smartphones, making the technology easily accessible.
Tip
|
Notice how the unit of currency is called "bitcoin" with a small b, and the system is called "Bitcoin Cash", with a capital B and a capital C. |
Users can transfer bitcoin over the network to do just about anything that can be done with conventional currencies, including buying and selling goods, sending money to people or organizations, or extending credit. Bitcoins can be purchased, sold, and exchanged for other currencies at specialized currency exchanges. Bitcoin Cash in a sense is the perfect form of money for the internet because it is fast, secure, and borderless.
Unlike traditional currencies, bitcoin is entirely virtual. There are no physical coins or even digital coins per se. The coins are implied in transactions that transfer value from sender to recipient. Users of Bitcoin Cash own keys that allow them to prove ownership of bitcoin in the Bitcoin Cash network. With these keys, they can sign transactions to unlock the value and spend it by transferring it to a new owner. Keys are often stored in a digital wallet on each user’s computer or smartphone. Possession of the key that can sign a transaction is the only prerequisite to spending bitcoin, putting the control entirely in the hands of each user.
Bitcoin Cash is a distributed, peer-to-peer system. As such, there is no "central" server or point of control. Bitcoins, i.e. units of bitcoin, are created through a process called "mining," which involves competing to find solutions to a mathematical problem while processing Bitcoin Cash transactions. Any participant in the Bitcoin Cash network (i.e., anyone using a device running the full Bitcoin Cash protocol stack) may operate as a miner, using their computer’s processing power to verify and record transactions. Every 10 minutes, on average, a Bitcoin Cash miner can validate the transactions of the past 10 minutes and is rewarded with brand new bitcoin. Essentially, Bitcoin Cash mining decentralizes the currency-issuance and clearing functions of a central bank and replaces the need for any central bank.
The Bitcoin Cash protocol includes built-in algorithms that regulate the mining function across the network. The difficulty of the processing task that miners must perform is adjusted dynamically so that, on average, someone succeeds every 10 minutes regardless of how many miners (and how much processing) are competing at any moment. The protocol also halves the rate at which new bitcoin is created every 4 years, and limits the total number of bitcoin that will be created to a fixed total just below 21 million coins. The result is that the number of bitcoin in circulation closely follows an easily predictable curve that approaches 21 million by the year 2140. Due to bitcoin’s diminishing rate of issuance, over the long term, the Bitcoin Cash currency is deflationary. Furthermore, bitcoin cannot be inflated by "printing" new money above and beyond the expected issuance rate.
Behind the scenes, Bitcoin Cash is also the name of the protocol, a peer-to-peer network, and a distributed computing innovation. The bitcoin currency is really only the first application of this invention. Bitcoin Cash represents the culmination of decades of research in cryptography and distributed systems and includes four key innovations brought together in a unique and powerful combination. Bitcoin Cash consists of:
-
A decentralized peer-to-peer network (the Bitcoin Cash protocol)
-
A public transaction ledger (the blockchain)
-
A set of rules for independent transaction validation and currency issuance (consensus rules)
-
A mechanism for reaching global decentralized consensus on the valid blockchain (Proof-of-Work algorithm)
As developers, we see Bitcoin Cash as akin to the internet of money, a network for propagating value and securing the ownership of digital assets via distributed computation. There’s a lot more to Bitcoin Cash than first meets the eye.
In this chapter we’ll get started by explaining some of the main concepts and terms, getting the necessary software, and using Bitcoin Cash for simple transactions. In the following chapters, we’ll start unwrapping the layers of technology that make Bitcoin Cash possible and examine the inner workings of the Bitcoin Cash network and protocol.
The emergence of viable digital money is closely linked to developments in cryptography. This is not surprising when one considers the fundamental challenges involved with using bits to represent value that can be exchanged for goods and services. Three basic questions for anyone accepting digital money are:
-
Can I trust that the money is authentic and not counterfeit?
-
Can I trust that the digital money can only be spent once (known as the “double-spend” problem)?
-
Can I be sure that no one else can claim this money belongs to them and not me?
Issuers of paper money are constantly battling the counterfeiting problem by using increasingly sophisticated papers and printing technology. Physical money addresses the double-spend issue easily because the same paper note cannot be in two places at once. Of course, conventional money is also often stored and transmitted digitally. In these cases, the counterfeiting and double-spend issues are handled by clearing all electronic transactions through central authorities that have a global view of the currency in circulation. For digital money, which cannot take advantage of esoteric inks or holographic strips, cryptography provides the basis for trusting the legitimacy of a user’s claim to value. Specifically, cryptographic digital signatures enable a user to sign a digital asset or transaction proving the ownership of that asset. With the appropriate architecture, digital signatures also can be used to address the double-spend issue.
When cryptography started becoming more broadly available and understood in the late 1980s, many researchers began trying to use cryptography to build digital currencies. These early digital currency projects issued digital money, usually backed by a national currency or precious metal such as gold.
Although these earlier digital currencies worked, they were centralized and, as a result, were easy to attack by governments and hackers. Early digital currencies used a central clearinghouse to settle all transactions at regular intervals, just like a traditional banking system. Unfortunately, in most cases, these nascent digital currencies were targeted by worried governments and eventually litigated out of existence. Some failed in spectacular crashes when the parent company liquidated abruptly. To be robust against intervention by antagonists, whether legitimate governments or criminal elements, a decentralized digital currency was needed to avoid a single point of attack. Bitcoin Cash is such a system, decentralized by design, and free of any central authority or point of control that can be attacked or corrupted.
Bitcoin was invented in 2008 with the publication of a paper titled "Bitcoin: A Peer-to-Peer Electronic Cash System,"[1] written under the alias of Satoshi Nakamoto (see [satoshi_whitepaper]). Nakamoto combined several prior inventions such as b-money and HashCash to create a completely decentralized electronic cash system that does not rely on a central authority for currency issuance or settlement and validation of transactions. The key innovation was to use a distributed computation system (called a "Proof-of-Work" algorithm) to conduct a global "election" every 10 minutes, allowing the decentralized network to arrive at consensus about the state of transactions. This elegantly solves the issue of double-spend where a single currency unit can be spent twice. Previously, the double-spend problem was a weakness of digital currency and was addressed by clearing all transactions through a central clearinghouse.
The Bitcoin network started in 2009, based on a reference implementation published by Nakamoto and since revised by many other programmers. The implementation of the Proof-of-Work algorithm (mining) that provides security and resilience for Bitcoin has increased in power exponentially. Satoshi Nakamoto withdrew from the public in April 2011, leaving the responsibility of developing the code and network to a thriving group of volunteers. The identity of the person or people behind Bitcoin is still unknown. However, neither Satoshi Nakamoto nor anyone else exerts individual control over the Bitcoin system, which operates based on fully transparent mathematical principles, open source code, and consensus among participants. The invention itself is groundbreaking and has already spawned new science in the fields of distributed computing, economics, and econometrics.
We don’t want to relitigate old divisions, but at this point we probably cannot proceed without addressing the elephant in the room. Today there are two important versions, called hard forks, of the original Bitcoin network. These forks are now known as as Bitcoin Cash and Bitcoin Core. As the popularity of Bitcoin increased, the limited storage space inside individual blocks placed a cap on the number of transactions that the Bitcoin network could handle. Lacking any meaningful guidance from Satoshi or any other central authority, the volunteers who influenced the future of Bitcoin became divided about how to increase the volume of Bitcoin transactions supported by the network. The period from 2015 to 2017 was marked by rancor and internal divisions between the Big Blockers and the Small Blockers in what became known as the "Blocksize Wars".
The Big Blockers wanted to increase the scalability of Bitcoin by increasing the size of each block, increasing the number of transactions in each block, thereby lowering fees and making everyday use of Bitcoin more accessible. The Small Blockers countered with two criticisms. The first, and most important, is any increase in the blocksize would require a hard fork, or an irreversible, non-backwards compatible code split that could be tricky to implement. The Small Blockers have subsequently managed to avoid any hard forks. The second criticism addressed longer-term concerns that larger blocks would require more computational power and storage and limit the number of peole who could ultimately take part in the Bitcoin network.
There were other bones of contention. One involved a soft fork implemented on July 21, 2017 known as Segregated Witness, or SegWit, that eventually doubled the number of transactions per block on the Bitcoin Core network and enabled a layer-2 protocol called Lightning Network, neither of which are supported by Bitcoin Cash and are beyond the scope of this book. Big Blockers opposed the Lightning Network on the grounds that it is a complicated solution that will never achieve its scalability goals and would lead to very hub-and-spoke financial cenralization that Bitcoin was invented to circumvent. On August 1, 2017 a hard fork took effect that increased the blocksize from 1MB to 8MB. Network participants had to select one fork or the other, and the failure to achieve consensus resulted in a split. The 8MB block split became known as Bitcoin Cash, while the SegWit split is now Bitcoin Core. Both Bitcoin Cash and Bitcoin Core are derived from the Bitcoin network envisioned by Satoshi, and both recognize blocks created prior to the split, but subsequent blocks are incompatible.
This brief description will not satisfy proponents of either Bitcoin Cash or Bitcoin Core. Plenty of ink has already been spilled on the topic, but if you are reading this book, you probably fall on the "big block" side of debate already. Although Bitcoin Core "won" the Bitcoin brand (and the BTC ticker symbol) in the short-term, it faces severe scalability issues and high fees that price routine transactions out of the network, which the Lightning Network has failed to fix and will likely never succeed in fixing. The several thousand bitcoin locked up in Lightning Network channels is a tiny fraction of the number of bitcoin locked up in "wrapped" bitcoin contracts on the Ethereum network, which is now the de facto layer-2 network for Bitcong Core and which itself is also experiencing issues with scalability and high transaction fees. while "Bitcoin Maximalists", or proponents of the Bitcoin Core network, obsess over laser eyes, "number go up" technology, and encoding images (of all things) directly on the blockchain, apparently without any sense of irony. Bitcoin Core has become stripped of utility and more closely resembles a meme coin than the backbone of the global financial system. Meanwhile, participants on the Bitcoin Cash network are quietly building the technology, toolkits, and features that will be used to scale the original Bitcoin network to the next level of adoption.
Satoshi Nakamoto’s invention is also a practical and novel solution to a problem in distributed computing, known as the "Byzantine Generals' Problem." Briefly, the problem consists of trying to agree on a course of action or the state of a system by exchanging information over an unreliable and potentially compromised network. Satoshi Nakamoto’s solution, which uses the concept of Proof-of-Work to achieve consensus without a central trusted authority, represents a breakthrough in distributed computing and has wide applicability beyond currency. It can be used to achieve consensus on decentralized networks to prove the fairness of elections, lotteries, asset registries, digital notarization, and more.
Bitcoin Cash is an innovation in the ancient technology of money. At its core, money simply facilitates the exchange of value between people. Therefore, in order to fully understand Bitcoin Cash and its uses, we’ll examine it from the perspective of people using it. Each of the people and their stories, as listed here, illustrates one or more specific use cases. We’ll be seeing them throughout the book:
- North American low-value retail
-
Aya lives in Northern California’s Bay Area. She has heard about Bitcoin Cash from her techie friends and wants to start using it. We will follow her story as she learns about Bitcoin Cash, acquires some, and then spends some of her bitcoin to buy a cup of coffee at Boku’s Cafe in Palo Alto. This story will introduce us to the software, the exchanges, and basic transactions from the perspective of a retail consumer.
- North American high-value retail
-
Carol is an art gallery owner in San Francisco. She sells expensive paintings for Bitcoin Cash. This story will introduce the risks of a "51%" consensus attack for retailers of high-value items.
- Offshore contract services
-
Boku, the cafe owner in Palo Alto, is building a new website. He has contracted with an Indian web developer, Gopesh, who lives in Bangalore, India. Gopesh has agreed to be paid in bitcoin. This story will examine the use of Bitcoin Cash for outsourcing, contract services, and international wire transfers.
- Web store
-
Gabriel is an enterprising young teenager in Rio de Janeiro, running a small web store that sells Bitcoin Cash-branded t-shirts, coffee mugs, and stickers. Gabriel is too young to have a bank account, but his parents are encouraging his entrepreneurial spirit.
- Charitable donations
-
Eugenia is the director of a children’s charity in the Philippines. Recently she has discovered Bitcoin Cash and wants to use it to reach a whole new group of foreign and domestic donors to fundraise for her charity. She’s also investigating ways to use Bitcoin Cash to distribute funds quickly to areas of need. This story will show the use of Bitcoin Cash for global fundraising across currencies and borders and the use of an open ledger for transparency in charitable organizations.
- Import/export
-
Mohammed is an electronics importer in Dubai. He’s trying to use Bitcoin Cash to buy electronics from the United States and China for import into the UAE to accelerate the process of payments for imports. This story will show how Bitcoin Cash can be used for large business-to-business international payments tied to physical goods.
- Mining for bitcoin
-
Jing is a computer engineering student in Shanghai. He has built a "mining" rig to mine for bitcoin using his engineering skills to supplement his income. This story will examine the "industrial" base of Bitcoin Cash: the specialized equipment used to secure the Bitcoin Cash network and issue new currency.
Each of these stories is based on the real people and real industries currently using Bitcoin Cash to create new markets, new industries, and innovative solutions to global economic issues.
Bitcoin Cash is a protocol that can be accessed using a client application that speaks the protocol. A "Bitcoin Cash wallet" is the most common user interface to the Bitcoin Cash system, just like a web browser is the most common user interface for the HTTP protocol. There are many implementations and brands of Bitcoin Cash wallets, just like there are many brands of web browsers (e.g., Chrome, Safari, Firefox, and Internet Explorer). And just like we all have our favorite browsers (Mozilla Firefox, Yay!) and our villains (Internet Explorer, Yuck!), Bitcoin Cash wallets vary in quality, performance, security, privacy, and reliability. There is also a popular implementation of the Bitcoin Cash protocol that includes a wallet, known as Bitcoin Cash Node that is forked from "Bitcoin Core," which is derived from the original implementation written by Satoshi Nakamoto.
Bitcoin Cash wallets are one of the most actively developed applications in the Bitcoin Cash ecosystem. There is intense competition, and while a new wallet is probably being developed right now, several wallets from last year are no longer actively maintained. Many wallets focus on specific platforms or specific uses and some are more suitable for beginners while others are filled with features for advanced users. Choosing a wallet is highly subjective and depends on the use and user expertise. Therefore it would be pointless to recommend a specific brand or wallet. However, we can categorize Bitcoin Cash wallets according to their platform and function and provide some clarity about all the different types of wallets that exist. Better yet, moving keys or seeds between Bitcoin Cash wallets is relatively easy, so it is worth trying out several different wallets until you find one that fits your needs.
Bitcoin Cash wallets can be categorized as follows, according to the platform:
- Desktop wallet
-
A desktop wallet was the first type of Bitcoin Cash wallet created as a reference implementation and many users run desktop wallets for the features, autonomy, and control they offer. Running on general-use operating systems such as Windows and Mac OS has certain security disadvantages, however, as these platforms are often insecure and poorly configured.
- Mobile wallet
-
A mobile wallet is the most common type of Bitcoin Cash wallet. Running on smart-phone operating systems such as Apple iOS and Android, these wallets are often a great choice for new users. Many are designed for simplicity and ease-of-use, but there are also fully featured mobile wallets for power users.
- Web wallet
-
Web wallets are accessed through a web browser and store the user’s wallet on a server owned by a third party. This is similar to webmail in that it relies entirely on a third-party server. Some of these services operate using client-side code running in the user’s browser, which keeps control of the Bitcoin Cash keys in the hands of the user. Most, however, present a compromise by taking control of the Bitcoin Cash keys from users in exchange for ease-of-use. It is inadvisable to store large amounts of bitcoin on third-party systems.
- Hardware wallet
-
Hardware wallets are devices that operate a secure self-contained Bitcoin Cash wallet on special-purpose hardware. They usually connect to a desktop or mobile device via USB cable or near-field-communication (NFC), and are operated with a web browser or accompanying software. By handling all Bitcoin Cash-related operations on the specialized hardware, these wallets are considered very secure and suitable for storing large amounts of bitcoin.
Another way to categorize bitcoin wallets is by their degree of autonomy and how they interact with the Bitcoin Cash network:
- Full-node client
-
A full client, or "full node," is a client that stores the entire history of Bitcoin Cash transactions (every transaction by every user, ever), manages users' wallets, and can initiate transactions directly on the Bitcoin Cash network. A full node handles all aspects of the protocol and can independently validate the entire blockchain and any transaction. A full-node client consumes substantial computer resources (e.g., more than 125 GB of disk, 2 GB of RAM) but offers complete autonomy and independent transaction verification.
- Lightweight client
-
A lightweight client, also known as a simplified-payment-verification (SPV) client, connects to Bitcoin Cash full nodes (mentioned previously) for access to the Bitcoin Cash transaction information, but stores the user wallet locally and independently creates, validates, and transmits transactions. Lightweight clients interact directly with the Bitcoin Cash network, without an intermediary.
- Third-party API client
-
A third-party API client is one that interacts with Bitcoin Cash through a third-party system of application programming interfaces (APIs), rather than by connecting to the Bitcoin Cash network directly. The wallet may be stored by the user or by third-party servers, but all transactions go through a third party.
Combining these categorizations, many Bitcoin Cash wallets fall into a few groups, with the three most common being desktop full client, mobile lightweight wallet, and web third-party wallet. The lines between different categories are often blurry, as many wallets run on multiple platforms and can interact with the network in different ways.
For the purposes of this book, we will be demonstrating the use of a variety of downloadable Bitcoin Cash clients, from the most popular implementation (Bitcoin Cash Node) to mobile and web wallets. Some of the examples will require the use of Bitcoin Cash Node, which, in addition to being a full client, also exposes APIs to the wallet, network, and transaction services. If you are planning to explore the programmatic interfaces into the Bitcoin Cash system, you will need to run Bitcoin Cash Node, or one of the alternative clients.
Aya, who we introduced in Bitcoin Cash Uses, Users, and Their Stories, is not a technical user and only recently heard about Bitcoin Cash from her friend Jun’ichi. While at a party, Jun’ichi is once again enthusiastically explaining Bitcoin Cash to all around him and is offering a demonstration. Intrigued, Aya asks how she can get started with Bitcoin Cash. Jun’ichi says that a mobile wallet is best for new users and he recommends a few of his favorite wallets. Aya downloads "Selene Wallet" (available for Android, iOS version in development) and installs it on her phone.
When Aya runs her wallet application for the first time, Selene automatically generated a random private key (described in more details in [private_keys]) which will be used to derive Bitcoin Cash addresses that direct to her new wallet. Selene generates one such address derived from her private key and displays it as a QR code that she can receive bitcoin from others. The QR code is the square with a pattern of black and white dots, serving as a form of barcode that contains the same information in a format that can be scanned by Jun’ichi’s smartphone camera. Next to the wallet’s QR code is the Bitcoin Cash address it encodes, and Aya may choose to manually send her address to Jun’ichi by copying it onto her clipboard with a tap.
Later, she will need to backup her mnemonic phrase, described below, but the Selene wallet is particularly easy to use and gets her straight to what she wants to do: receive Bitcoin Cash.
At this point, her Bitcoin Cash addresses are not known to the Bitcoin Cash network or "registered" with any part of the Bitcoin Cash system. Her Bitcoin Cash addresses are simply random numbers that correspond to her private key that she can use to control access to the funds. The addresses are generated independently by her wallet without reference or registration with any service. In fact, in most wallets, there is no association between a Bitcoin Cash address and any externally identifiable information including the user’s identity. Until the moment an address is referenced as the recipient of value in a transaction posted on the bitcoin ledger, the Bitcoin Cash address is simply part of the vast number of possible addresses that are valid in bitcoin. Only once an address has been associated with a transaction does it become part of the known addresses in the network.
Tip
|
Bitcoin Cash addresses start with 1 or 3 (legacy format), or p or q ("cash address" or CashAddr format, usually prefixed by "bitcoincash:"). Like email addresses, they can be shared with other bitcoin users who can use them to send bitcoin directly to your wallet. There is nothing sensitive, from a security perspective, about the Bitcoin Cash address. It can be posted anywhere without risking the security of the account. Unlike email addresses, you can create new addresses as often as you like, all of which will direct funds to your wallet. In fact, many modern wallets automatically create a new address for every transaction to maximize privacy. A wallet is simply a collection of addresses and the keys that unlock the funds within. |
There are several ways Aya can acquire bitcoin:
-
She can exchange some of her national currency (e.g. USD) at a cryptocurrency exchange
-
She can buy some from a friend, or an acquaintance from a Bitcoin Cash Meetup, in exchange for cash
-
She can find a Bitcoin ATM in her area, which acts as a vending machine, selling bitcoin for cash
-
She can offer her skills or a product she sells and accepts payment in bitcoin
-
She can ask her employer or clients to pay her in bitcoin
All of these methods have varying degrees of difficulty, and many will involve paying a fee. Some financial institutions will also require Aya to provide identification documents to comply with local banking regulations/anti-money laundering (AML) practices, a process which is known as Know Your Customer (KYC). However, with all these methods, Aya will be able to receive bitcoin.
Tip
|
One of the advantages of bitcoin over other payment systems is that, when used correctly, it affords users much more privacy. Acquiring, holding, and spending bitcoin does not require you to divulge sensitive and personally identifiable information to third parties. However, where bitcoin touches traditional systems, such as currency exchanges, national and international regulations often apply. In order to exchange bitcoin for your national currency, you will often be required to provide proof of identity and banking information. Users should be aware that once a Bitcoin Cash address is attached to an identity, all associated bitcoin transactions are also easy to identify and track. This is one reason many users choose to maintain dedicated exchange accounts unlinked to their wallets. |
Aya was introduced to bitcoin by a friend so she has an easy way to acquire her first bitcoin. Next, we will look at how she buys bitcoin from her friend Jun’ichi and how Jun’ichi sends the bitcoin to her wallet.
Before Aya can buy bitcoin from Jun’ichi, they have to agree on the exchange rate between bitcoin and US dollars. This brings up a common question for those new to bitcoin: "Who sets the bitcoin price?" The short answer is that the price is set by markets.
Bitcoin Cash, like most other currencies, has a floating exchange rate. That means that the value of bitcoin vis-a-vis any other currency fluctuates according to supply and demand in the various markets where it is traded. For example, the "price" of bitcoin in US dollars is calculated in each market based on the most recent trade of bitcoin and US dollars. As such, the price tends to fluctuate minutely several times per second. A pricing service will aggregate the prices from several markets and calculate a volume-weighted average representing the broad market exchange rate of a currency pair (e.g., BCH/JPY).
There are hundreds of applications and websites that can provide the current market rate. Here are some of the most popular:
- Bitcoin.com Markets
-
A commercial company that has provided substantial support for Bitcoin Cash, including a popular wallet app.
- CoinCap
-
A service listing the market capitalization and exchange rates of hundreds of crypto-currencies, including bitcoin.
- CoinMarketCap
-
Another service that is similar to CoinCap.
- Bitcoin Cash Average
-
Now a commercial service that provides a simple API for application developers.
In addition to these various sites and applications, most bitcoin wallets will automatically convert amounts between bitcoin and other currencies. Jun’ichi will use his wallet to convert the price automatically before sending BCH to Aya.
Aya has decided to purchase BCH 0.1 from Jun’ichi and they have agreed on a price of exchange JPY 4,300 Japanese yen, so as not to risk too much money on this new technology. She gives Jun’ichi 4,300 yen in cash, opens her Selene mobile wallet application, and displays the QR code with Aya’s first Bitcoin Cash address.
Jun’ichi then opens his Selene smartphone wallet and is presented with a screen containing the following options:
-
Scan
-
Send
He can use the scan option to use the camera to scan Aya’s QR code. Alternatively, he can use the Send button and provide the following information:
-
A destination Bitcoin Cash address (from the clipboard, in the current version)
-
The amount to send.
Jun’ichi taps the Scan button and it activates the smartphone camera, scanning the QR code displayed on Aya’s smartphone.
Jun’ichi now has Aya’s Bitcoin Cash address set as the recipient. The Selene wallet now shows him an input amount to send, in bitcoin (BCH) or his local currency (JPY). Jun’ichi enters the amount as 0.1 BCH and his wallet converts it by accessing the most recent exchange rate from an online service, both of which are shown on the payment screen The app displays the amount in both BCH and the reference currency.
Tip
|
The price of BCH has changed a lot over time, and an incredible amount since the first edition of this book was written. Many examples in this book reference real-life past transactions, when the price of bitcoin was much lower and transactions with zero fees were still possible. Think about how generous of a friend Jun’ichi would have been if he had made the same agreement with Aya today! |
Using Selene ewallet, Jun’ichi carefully checks to make sure he has entered the correct amount, because he is about to transmit money and mistakes are irreversible. For simplicity sake, we will assume that Jun’ichi does not pay any transaction fees. The purpose and setting of transaction fees are covered in subsequent chapters. After double-checking the address and amount, he presses Send to transmit the transaction. Jun’ichi’s mobile bitcoin wallet constructs a transaction that assigns BCH to the address provided by Aya, sourcing the funds from Jun’ichi’s wallet and signing the transaction with Jun’ichi’s private keys. This tells the Bitcoin Cash network that Jun’ichi has authorized a transfer of value to Aya’s new address. As the transaction is transmitted via the peer-to-peer protocol, it quickly propagates across the Bitcoin Cash network. In less than a second, most of the well-connected nodes in the network receive the transaction and see Aya’s address for the first time.
Meanwhile, Aya’s wallet is constantly "listening" to published transactions on the Bitcoin Cash network, looking for any that match the addresses it contains. A few seconds after Jun’ichi’s wallet transmits the transaction, Aya’s wallet will indicate that it is receiving 0.1 BCH.
Tip
|
Each bitcoin can be subdivided into 100 million units, each called a "satoshi" (singular) or "satoshis" (plural). Named for Bitcoin’s creator, the Satoshi is the smallest unit of bitcoin, equivalent to 0.00000001 BCH. |
In some wallet apps, Aya’s wallet might show the transaction from Jun’ichi as "Unconfirmed" at first. This means that the transaction has been propagated to the network (the mempool) but has not yet been recorded in the bitcoin transaction ledger, known as the blockchain. To be confirmed, a transaction must be included in a block and added to the blockchain, which happens every 10 minutes, on average. In traditional financial terms this is known as clearing. This book will cover in detail the propagation, validation, and clearing (or confirmation) of bitcoin transactions.
In Bitcoin Core unconfirmed transactions can be hacked by some wallets to be double-spent, potentially robbing the first transaction "recipient" of the funds they were expecting, thanks to a feature known as Replace By Fee (RBF) that was introduced to Bitcoin Core after the Bitcoin Cash fork, as a way of dealing with transaction backlogs and long confirmation times. However, Bitcoin Cash has introduced Double-Spend notifications that almost completely nullify the ability of wallets to double-spend unspent transaction ouputs in this way. Double-spend is such a negligible in Bitcoin Cash that Selene and other wallets don’t bother users of confirmed versus unconfirmed transaction status updates.
Aya is now the proud owner of BCH that she can spend. In the next chapter we will look at her first purchase with bitcoin, and examine the underlying transaction and propagation technologies in more detail.
Later, when Aya has some bitcoin in her wallet, she takes a moment away from Jun’ichi and all other parties to write down a secret mnemonic phrase in order on a piece of paper. As explained by the mobile wallet and by Jun’ichi earlier, the mnemonic phrase allows Aya to restore her wallet in case she loses her mobile device and grants her access to her funds on another device. After creating her wallet and securing her mnemonic phrase, Aya can tap on her wallet to see her bitcoin amount, transaction history, as well as two buttons that allow her to either receive or send bitcoin, shown in Aya uses the Receive screen on her Selene mobile Bitcoin Cash wallet, and displays her address to Boku in a QR code format.
A modern Bitcoin Cash wallet will provide a mnemonic phrase (also sometimes called a "seed" or "seed phrase") for Aya to back up. The mnemonic phrase consists of 12-24 English words, selected randomly by the software, and used as the basis for the keys that are generated by the wallet. The mnemonic phrase can be used by Aya to restore all the transactions and funds in her wallet in the case of an event such as a lost mobile device, a software bug, or memory corruption.
Tip
|
The correct term for these backup words is "mnemonic phrase". We avoid the use of the term "seed" to refer to a mnemonic phrase, because even though its use is common it is incorrect. |
Aya needs to be careful to store the mnemonic phrase in a way that balances the need to prevent theft and accidental loss. If she doesn’t protect it enough, her mnemonic will be at risk of being stolen. If she protects it too much, her mnemonic will be at risk of being permanently lost. The recommended way to properly balance these risks is to write two copies of the mnemonic phrase on paper, with each of the words numbered as the order matters.
Once Aya has recorded the mnemonic phrase, she should plan to store each copy in a separate secure location such as a locked desk drawer or a fireproof safe.
Warning
|
Never attempt a "DIY" security scheme that deviates in any way from the best practice recommendation in Storing the Mnemonic Safely. Do not cut your mnemonic in half, make screenshots, store on USB drives, email or cloud drives, encrypt it, or try any other non-standard method. You will tip the balance in such a way as to risk permanent loss or theft. Many people have lost funds, not from theft but because they tried a non-standard solution without having the expertise to balance the risks involved. The best practice recommendation is carefully balanced by experts and suitable for the vast majority of users. |