The Bitcoin Cash system, unlike traditional banking and payment systems, is based on decentralized trust. Instead of a central trusted authority, in bitcoin, trust is achieved as an emergent property from the interactions of different participants in the Bitcoin Cash system. In this chapter, we will examine bitcoin from a high level by tracking a single transaction through the Bitcoin Cash system and watch as it becomes "trusted" and accepted by the bitcoin mechanism of distributed consensus and is finally recorded on the blockchain, the distributed ledger of all transactions. Subsequent chapters will delve into the technology behind transactions, the network, and mining.
In the overview diagram shown in Bitcoin Cash overview, we see that the Bitcoin Cash system consists of users with wallets containing keys, transactions that are propagated across the network, and miners who produce (through competitive computation) the consensus blockchain, which is the authoritative ledger of all transactions.
Each example in this chapter is based on an actual transaction made on the Bitcoin Cash network, simulating the interactions between the users (Jun’ichi, Aya, Boku, and Gopesh) by sending funds from one wallet to another. While tracking a transaction through the Bitcoin Cash network to the blockchain, we will use a blockchain explorer site to visualize each step. A blockchain explorer is a web application that operates as a bitcoin search engine, in that it allows you to search for addresses, transactions, and blocks and see the relationships and flows between them.
Popular blockchain explorers include:
Each of these has a search function that can take a Bitcoin Cash address, transaction hash, block number, or block hash and retrieve corresponding information from the Bitcoin Cash network. With each transaction or block example, we will provide a URL so you can look it up yourself and study it in detail.
Aya, introduced in the previous chapter, is a new user who has just acquired her first bitcoin. In [ch01.asciidoc/getting_first_bitcoin], Aya met with her friend Jun’ichi to exchange some cash for bitcoin. The transaction created by Jun’ichi funded Aya’s wallet with 0.10 BCH. Now Aya will make her first retail transaction, buying a cup of coffee at Boku’s coffee shop in Palo Alto, California.
Boku’s Cafe recently started accepting Bitcoin Cash payments by adding the option to its point-of-sale system. The prices at Boku’s Cafe are listed in the local currency (Japanese Yen), but at the register, customers have the option of paying in either dollars or bitcoin. Aya places her order for a cup of coffee and Boku enters it into the register, as he does for all transactions. The point-of-sale system automatically converts the total price from US dollars to bitcoin at the prevailing market rate and displays the price in both currencies:
Total: JPY: 400 BCH: 0.01452936 Exchange Rate (JPY/BCH): 27,530
Boku says, "That’s one-dollar-fifty, or fifteen millibits."
Boku’s point-of-sale system will also automatically create a special QR code containing a payment request (see Payment request QR code).
Unlike a QR code that simply contains a destination Bitcoin Cash address, a payment request is a QR-encoded URL that contains a destination address, and a payment amount. I some wallets it may also contain a generic description such as "Boku’s Cafe." This allows a bitcoin wallet application to prefill the information used to send the payment while showing a human-readable description to thep user. You can scan the QR code with a bitcoin wallet application to see what Aya would see.
Tip
|
Try to scan this with your wallet to see the address and amount but DO NOT SEND MONEY. At current exchange it requests an amount in BCH that is equivalent to JPY 400, though exchange rates have probably changed by the time you scan this. |
bitcoincash:qpa3pkvrns5hcwgp2n3d8pahwqj73x85uy5huzkzmn?amount=0.00935234
Components of the URL:
-
A Bitcoin Cash address: "qp2xdtz0y40avz477cr37kvdepwxmt9wacylfk5skn"
-
The payment amount: "0.00935234"
Aya uses her smartphone to scan the barcode on display. Her smartphone shows a payment of 0.00935234 BCH and she presses Confirm to authorize the payment. Within a few seconds (about the same amount of time as a credit card authorization), Boku sees the transaction on the register, completing the transaction.
In the following sections, we will examine this transaction in more detail. We’ll see how Aya’s wallet constructed it, how it was propagated across the network, how it was verified, and finally, how Boku can spend that amount in subsequent transactions.
Note
|
The Bitcoin Cash network can transact in fractional values, e.g., from millibitcoin (1/1000th of a bitcoin) down to 1/100,000,000th of a bitcoin, which is known as a satoshi. Throughout this book, we’ll use the term “bitcoin” to refer to any quantity of bitcoin currency, from the smallest unit (1 satoshi) to the total number (21,000,000) of all bitcoin that will ever be mined. |
You can examine Aya’s transaction to Boku’s Cafe on the blockchain using a block explorer site (View Aya’s transaction on blockchair.com):
https://blockchair.com/bitcoin-cash/transaction/d9de82eb8d5a325d84520b949cf55789a88066f355f1501bd0e6626549738f93
In simple terms, a transaction tells the network that the owner of some bitcoin value has authorized the transfer of that value to another owner. The new owner can now spend the bitcoin by creating another transaction that authorizes the transfer to another owner, and so on, in a chain of ownership.
Transactions are like lines in a double-entry bookkeeping ledger. Each transaction contains one or more "inputs," which are like debits against a bitcoin account. On the other side of the transaction, there are one or more "outputs," which are like credits added to a bitcoin account. The inputs and outputs (debits and credits) do not necessarily add up to the same amount. Instead, outputs add up to slightly less than inputs and the difference represents an implied transaction fee, which is a small payment collected by the miner who includes the transaction in the ledger. A bitcoin transaction is shown as a bookkeeping ledger entry in Transaction as double-entry bookkeeping.
The transaction also contains proof of ownership for each amount of bitcoin (inputs) whose value is being spent, in the form of a digital signature from the owner, which can be independently validated by anyone. In bitcoin terms, "spending" is signing a transaction that transfers value from a previous transaction over to a new owner identified by a Bitcoin Cash address.
Aya’s payment to Boku’s Cafe uses a previous transaction’s output as its input. In the previous chapter, Aya received bitcoin from her friend Jun’ichi in return for cash. That transaction created a bitcoin value locked by Aya’s key. Her new transaction to Boku’s Cafe references the previous transaction as an input and creates new outputs to pay for the cup of coffee and receive change. The transactions form a chain, where the inputs from the latest transaction correspond to outputs from previous transactions. Aya’s key provides the signature that unlocks those previous transaction outputs, thereby proving to the Bitcoin Cash network that she owns the funds. She attaches the payment for coffee to Boku’s address, thereby "encumbering" that output with the requirement that Boku produces a signature in order to spend that amount. This represents a transfer of value between Aya and Boku. This chain of transactions, from Jun’ichi to Aya to Boku to Boku’s supplier, Gopesh, is illustrated in the following transctions.
Many bitcoin transactions will include outputs that reference both an address of the new owner and an address of the current owner, called the change address. This is because transaction inputs, like currency notes, cannot be divided. If you purchase a $5 US dollar item in a store but use a $20 US dollar bill to pay for the item, you expect to receive $15 US dollars in change. The same concept applies to bitcoin transaction inputs. If you purchased an item that costs 5 bitcoin but only had a 20 bitcoin input to use, your wallet would create a single transaction that sends two outputs, one output of 5 bitcoin to the store owner and one output of 15 bitcoin back to yourself as change (less any applicable transaction fee). Importantly, the change address does not have to be the same address as that of the input and for privacy reasons is often a new address from the owner’s wallet.
Different wallets may use different strategies when aggregating inputs to make a payment requested by the user. They might aggregate many small inputs, or use one that is equal to or larger than the desired payment. Unless the wallet can aggregate inputs in such a way to exactly match the desired payment plus transaction fees, the wallet will need to generate some change. This is very similar to how people handle cash. If you always use the largest bill in your pocket, you will end up with a pocket full of loose change. If you only use the loose change, you’ll always have only big bills. People subconsciously find a balance between these two extremes, and bitcoin wallet developers strive to program this balance.
In summary, transactions move value from transaction inputs to transaction outputs. An input is a reference to a previous transaction’s output, showing where the value is coming from. A transaction usually includes an output that directs a specific value to a new owner’s Bitcoin Cash address and a change output back to the original owner. Outputs from one transaction can be used as inputs in a new transaction, thus creating a chain of ownership as the value is moved from owner to owner (see The transaction from Jun’Ichi to Aya of 0.1 BCH).
The most common form of transaction is a simple payment from one address to another, which often includes some "change" returned to the original owner. This type of transaction has one input and two outputs and is shown in Most common transaction.
Another common form of transaction is one that aggregates several inputs into a single output (see Transaction aggregating funds). This represents the real-world equivalent of exchanging a pile of coins and currency notes for a single larger note. Transactions like these are sometimes generated by wallet applications to clean up lots of smaller amounts that were received as change for payments.
Finally, another transaction form that is seen often on the bitcoin ledger is a batched transaction, which distributes one input to multiple outputs representing multiple recipients, a technique called "transaction batching" (see Transaction distributing funds). Since this type of transaction is useful for saving in transaction fees, it is commonly used by commercial entities to distribute funds, such as when a company is processing payroll payments to multiple employees or when a bitcoin exchange is processing multiple customers' withdrawals in a single transaction.
Aya’s wallet application contains all the logic for selecting appropriate inputs and outputs to build a transaction to Aya’s specification. Aya only needs to specify a destination and an amount, and the rest happens in the wallet application without her seeing the details. Importantly, a wallet application can construct transactions even if it is completely offline. Like writing a check at home and later sending it to the bank in an envelope, the transaction does not need to be constructed and signed while connected to the Bitcoin Cash network.
Aya’s wallet application will first have to find inputs that can pay the amount she wants to send to Boku. Most wallets keep track of all the available outputs belonging to addresses in the wallet. Therefore, Aya’s wallet would contain a copy of the transaction output from Jun’ichi’s transaction, which was created in exchange for cash (see [getting_first_bitcoin]). A bitcoin wallet application that runs as a full-node client actually contains a copy of every unspent output from every transaction in the blockchain. This allows a wallet to construct transaction inputs as well as quickly verify incoming transactions as having correct inputs. However, because a full-node client takes up a lot of disk space, most user wallets run "lightweight" clients that track only the user’s own unspent outputs.
If the wallet application does not maintain a copy of unspent transaction outputs, it can query the Bitcoin Cash network to retrieve this information using a variety of APIs available by different providers or by asking a full-node using an application programming interface (API) call. Look up all the unspent outputs for Aya’s Bitcoin Cash address shows an API request, constructed as an HTTP GET command to a specific URL. This URL will return all the unspent transaction outputs for an address, giving any application the information it needs to construct transaction inputs for spending. We use the simple command-line HTTP client cURL to retrieve the response.
$ curl https://rest.bch.actorforth.org/v2/address/utxo/bitcoincash:qrhuqpz58v500r8lzejw5f57lvnd2xvt3vv4ju6vzy
{
"utxos": [
{
"height": 799880,
"txid": "d9de82eb8d5a325d84520b949cf55789a88066f355f1501bd0e6626549738f93",
"vout": 1,
"satoshis": 9064547,
"amount": 0.09064547,
"confirmations": 856
}
],
"legacyAddress": "1NrgXR9PxUiLknEhkAotnvQvF75yfCSMgs",
"cashAddress": "bitcoincash:qrhuqpz58v500r8lzejw5f57lvnd2xvt3vv4ju6vzy",
"slpAddress": "simpleledger:qrhuqpz58v500r8lzejw5f57lvnd2xvt3vqwe80vu6",
"scriptPubKey": "76a914efc004543b28f78cff1664ea269efb26d5198b8b88ac",
"asm": "OP_DUP OP_HASH160 efc004543b28f78cff1664ea269efb26d5198b8b OP_EQUALVERIFY OP_CHECKSIG"
}
The response in Look up all the unspent outputs for Aya’s Bitcoin Cash address shows one unspent output (one that has not been redeemed yet) under the ownership of Aya’s address bitcoincash:qrhuqpz58v500r8lzejw5f57lvnd2xvt3vv4ju6vzy, which is the output of her transaction to Boku’s Cafe that was returned to her. The response includes the reference to the transaction in which this unspent output is contained (the payment from Jun’ichi) and its value in satoshis. With this information, Aya’s wallet application can construct a new transaction to transfer that value to another new owner addresses.
Tip
|
View the transaction from Aya to Boku. |
As you can see, Aya’s wallet contained enough BCH in a single unspent output to pay for the cup of coffee. Had this not been the case, Aya’s wallet application might have to "rummage" through a pile of smaller unspent outputs, like picking coins from a purse until it could find enough to pay for the coffee. In both cases, there might be a need to get some change back, which we will see in the next section, as the wallet application creates the transaction outputs (payments).
A transaction output is created in the form of a script that creates an encumbrance on the value and can only be redeemed by the introduction of a solution to the script. In simpler terms, Aya’s transaction output will contain a script that says something like, "This output is payable to whoever can present a signature from the key corresponding to Boku’s address." Because only Boku has the wallet with the keys corresponding to that address, only Boku’s wallet can present such a signature to redeem this output. Aya will therefore "encumber" the output value with a demand for a signature from Boku.
This transaction will also include a second output, because Aya’s funds are in the form of a 0.10 BCH output, too much money for the 0.00935234 BCH cup of coffee. Aya will need 0.09064547 BCH in change. Aya’s change payment is created by Aya’s wallet as an output in the very same transaction as the payment to Boku. Essentially, Aya’s wallet breaks her funds into two payments: one to Boku and one back to herself. She can then use (spend) the change output in a subsequent transaction.
Finally, for the transaction to be processed by the network in a timely fashion, Aya’s wallet application will add a small fee. This is not explicit in the transaction; it is implied by the difference between inputs and outputs. Note that the outputs don’t fully add up to the input of 0.1BCH The resulting difference is the transaction fee that is collected by the miner as a fee for validating and including the transaction in a block to be recorded on the blockchain.
The resulting transaction can be seen using a blockchain explorer web application, as shown in Aya’s transaction to Boku’s Cafe.
Tip
|
View the transaction from Aya to Boku’s Cafe. |
The transaction created by Aya’s wallet application is 219 bytes long and contains everything necessary to confirm ownership of the funds and assign new owners. Now, the transaction must be transmitted to the Bitcoin Cash network where it will become part of the blockchain. In the next section we will see how a transaction becomes part of a new block and how the block is "mined." Finally, we will see how the new block, once added to the blockchain, is increasingly trusted by the network as more blocks are added.
Because the transaction contains all the information necessary to process, it does not matter how or where it is transmitted to the Bitcoin Cash network. The Bitcoin Cash network is a peer-to-peer network, with each Bitcoin Cash client participating by connecting to several other Bitcoin Cash clients. The purpose of the Bitcoin Cash network is to propagate transactions and blocks to all participants.
Any system, such as a server, desktop application, or wallet, that participates in the Bitcoin Cash network by "speaking" the Bitcoin Cash protocol is called a Bitcoin Cash node. Aya’s wallet application can send the new transaction to any Bitcoin Cash node it is connected to over any type of connection: wired, WiFi, mobile, etc. Her bitcoin wallet does not have to be connected to Boku’s bitcoin wallet directly and she does not have to use the internet connection offered by the cafe, though both those options are possible, too. Any Bitcoin Cash node that receives a valid transaction it has not seen before will immediately forward it to all other nodes to which it is connected, a propagation technique known as flooding. Thus, the transaction rapidly propagates out across the peer-to-peer network, reaching a large percentage of the nodes within a few seconds.
If Boku’s bitcoin wallet application is directly connected to Aya’s wallet application, Boku’s wallet application might be the first node to receive the transaction. However, even if Aya’s wallet sends the transaction through other nodes, it will reach Boku’s wallet within a few seconds. Boku’s wallet will immediately identify Aya’s transaction as an incoming payment because it contains outputs redeemable by Boku’s keys. Boku’s wallet application can also independently verify that the transaction is well formed, uses previously unspent outputs, and contains sufficient transaction fees to be included in the next block. At this point Boku can assume, with little risk, that the transaction will shortly be included in a block and confirmed.
Tip
|
A common misconception about bitcoin transactions is that they must be "confirmed" by waiting 10 minutes for a new block, or up to 60 minutes for a full six confirmations. Although confirmations ensure the transaction has been accepted by the whole network, such a delay is unnecessary for small-value items such as a cup of coffee. A merchant may accept a valid small-value transaction with no confirmations, with no more risk than a credit card payment made without an ID or a signature, as merchants routinely accept today. |
Aya’s transaction is now propagated on the Bitcoin Cash network. It does not become part of the blockchain until it is verified and included in a block by a process called mining. See [mining] for a detailed explanation.
The Bitcoin Cash system of trust is based on computation. Transactions are bundled into blocks, which require an enormous amount of computation to prove, but only a small amount of computation to verify as proven. The mining process serves two purposes in bitcoin:
-
Mining nodes validate all transactions by reference to bitcoin’s consensus rules. Therefore, mining provides security for bitcoin transactions by rejecting invalid or malformed transactions.
-
Mining creates new bitcoin in each block, almost like a central bank printing new money. The amount of bitcoin created per block is limited and diminishes with time, following a fixed issuance schedule.
Mining achieves a fine balance between cost and reward. Mining uses electricity to solve a mathematical problem. A successful miner will collect a reward in the form of new bitcoin and transaction fees. However, the reward will only be collected if the miner has correctly validated all the transactions, to the satisfaction of the rules of consensus. This delicate balance provides security for bitcoin without a central authority.
A good way to describe mining is like a giant competitive game of sudoku that resets every time someone finds a solution and whose difficulty automatically adjusts so that it takes approximately 10 minutes to find a solution. Imagine a giant sudoku puzzle, several thousand rows and columns in size. If I show you a completed puzzle you can verify it quite quickly. However, if the puzzle has a few squares filled and the rest are empty, it takes a lot of work to solve! The difficulty of the sudoku can be adjusted by changing its size (more or fewer rows and columns), but it can still be verified quite easily even if it is very large. The "puzzle" used in bitcoin is based on a cryptographic hash and exhibits similar characteristics: it is asymmetrically hard to solve but easy to verify, and its difficulty can be adjusted.
In [user-stories], we introduced Jing, an entrepreneur in Shanghai. Jing runs a mining farm, which is a business that runs thousands of specialized mining computers, competing for the reward. Every 10 minutes or so, Jing’s mining computers compete against thousands of similar systems in a global race to find a solution to a block of transactions. Finding such a solution, the so-called Proof-of-Work (PoW), requires quadrillions of hashing operations per second across the entire Bitcoin Cash network. The algorithm for Proof-of-Work involves repeatedly hashing the header of the block and a random number with the SHA256 cryptographic algorithm until a solution matching a predetermined pattern emerges. The first miner to find such a solution wins the round of competition and publishes that block into the blockchain.
Jing started mining in 2010 using a very fast desktop computer to find a suitable Proof-of-Work for new blocks. As more miners started joining the Bitcoin Cash network, the difficulty of the problem increased rapidly. Soon, Jing and other miners upgraded to more specialized hardware, with high-end dedicated graphical processing units (GPUs), often used in gaming desktops or consoles. At the time of this writing, the difficulty is so high that it is profitable only to mine with application-specific integrated circuits (ASIC), essentially hundreds of mining algorithms printed in hardware, running in parallel on a single silicon chip. Jing’s company also participates in a mining pool, which much like a lottery pool allows several participants to share their efforts and rewards. Jing’s company now runs a warehouse containing thousands of ASIC miners to mine for bitcoin 24 hours a day. The company pays its electricity costs by selling the bitcoin it is able to generate from mining, creating some income from the profits.
New transactions are constantly flowing into the network from user wallets and other applications. As these are seen by the Bitcoin Cash network nodes, they get added to a temporary pool of unverified transactions maintained by each node. As miners construct a new block, they add unverified transactions from this pool to the new block and then attempt to prove the validity of that new block, with the mining algorithm (Proof-of-Work). The process of mining is explained in detail in [mining].
Transactions are added to the new block, prioritized by the highest-fee transactions first and a few other criteria. Each miner starts the process of mining a new block of transactions as soon as they receive the previous block from the network, knowing they have lost that previous round of competition. They immediately create a new block, fill it with transactions and the fingerprint of the previous block, and start calculating the Proof-of-Work for the new block. Each miner includes a special transaction in their block, one that pays their own Bitcoin Cash address the block reward (currently 6.25 newly created bitcoin) plus the sum of transaction fees from all the transactions included in the block. If they find a solution that makes that block valid, they "win" this reward because their successful block is added to the global blockchain and the reward transaction they included becomes spendable. Jing, who participates in a mining pool, has set up his software to create new blocks that assign the reward to a pool address. From there, a share of the reward is distributed to Jing and other miners in proportion to the amount of work they contributed in the last round.
Aya’s transaction was picked up by the network and included in the pool of unverified transactions. Once validated by the mining software it was included in a new block, called a candidate block, generated by Jing’s mining pool. All the miners participating in that mining pool immediately start computing Proof-of-Work for the candidate block. Approximately five minutes after the transaction was first transmitted by Aya’s wallet, one of Jing’s ASIC miners found a solution for the candidate block and announced it to the network. Once other miners validated the winning block they started the race to generate the next block.
Jing’s winning block became part of the blockchain as block #277316, containing 419 transactions, including Aya’s transaction. The block containing Aya’s transaction is counted as one "confirmation" of that transaction.
Tip
|
You can see the block that includes Aya’s transaction. |
Approximately 5 minutes later, a new block, #799881, is mined by another miner. Because this new block is built on top of block #799880 that contained Aya’s transaction, it added even more computation to the blockchain, thereby strengthening the trust in those transactions. Each block mined on top of the one containing the transaction counts as an additional confirmation for Aya’s transaction. As the blocks pile on top of each other, it becomes exponentially harder to reverse the transaction, thereby making it more and more trusted by the network.
$ curl https://rest.bch.actorforth.org/v2/block/detailsByHeight/799880
{
"hash": "000000000000000001d6dbc5d2e05d820b2f0da74a2492fef648d85dda1661d3",
"confirmations": 993,
"size": 113844,
"height": 799880,
"version": 739360768,
"versionHex": "2c11c000",
"merkleroot": "e971fbf6684a74ad08ab789777e5423e3e9b5297bd5d097acb132d9c6e5408ba",
"tx": [
"...redacted..."
"d9de82eb8d5a325d84520b949cf55789a88066f355f1501bd0e6626549738f93",
"dace19a8c321a3000ce90e08875595f58a9f97024b58c58ec779efebcf136e95",
"db15963b0f650587300f0e1310bf952e52dbf00e9908f5c7a0cc79c5ae56a1b2",
"dc5a0fa1d2beffbb7bd8654b118f15c569989cb9961ca2cbc927f148f4baa40b",
"dd0f39cd5bd889a95e3e0befffe898959c76a7b7a1f680cd4c9539d10e3137e1",
"ddd91962fb223eb6761f0c83d9b7abed4e15e06c863bb3676df414875f6fa4d6",
"de4041a1e22f87ec2d91492882cd1de3a6db0c2a7fa2b60739496f59f9c385be",
"de42fd593ad3f0bc69c642fe6559afcde056e066d42e27525d68fb486c1097c6",
"deeb9e4c1386644b75311f2304cf69da3c345d795aad9600469c2f1e88f9bd93",
"dfdee6102a85715e73c3e88950bf71e0458c6e54ddcb243493ba538fd870688f",
"...redacted..."
],
"time": 1688205804,
"mediantime": 1688202291,
"nonce": 3976919370,
"bits": "18025249",
"difficulty": 473628995749.2271,
"chainwork": "000000000000000000000000000000000000000001bfea2d4451106d4b86781a",
"previousblockhash": "00000000000000000020c8ac61df51ef243765753031535855afefdaee11418a",
"nextblockhash": "000000000000000001b681e7ee1c3ad1c4a5f08735f7a23dc40af65212b5449b",
"isMainChain": true,
"poolInfo": {},
"reward": 6.25496015e-08
}
In the link above we have redacted most of the transactions except for the range that includes the two transactions we submitted that were included in block, d9de82eb8d5a325d84520b949cf55789a88066f355f1501bd0e6626549738f93 (Aya to Boku) and dfdee6102a85715e73c3e88950bf71e0458c6e54ddcb243493ba538fd870688f (Boku to Gopesh). We can see block #799880, which contains Aya’s transaction. Below it are 799,879 blocks (including block #0), linked to each other in a chain of blocks (blockchain) all the way back to block #0, known as the genesis block. Over time, as the "height" in blocks increases, so does the computation difficulty for each block and the chain as a whole. The blocks mined after the one that contains Aya’s transaction act as further assurance, as they pile on more computation in a longer and longer chain. By convention, any block with more than six confirmations is considered irrevocable, because it would require an immense amount of computation to invalidate and recalculate six blocks. We will examine the process of mining and the way it builds trust in more detail in [mining].
Now that Aya’s transaction has been embedded in the blockchain as part of a block, it is part of the distributed ledger of bitcoin and visible to all bitcoin applications. Each Bitcoin Cash client can independently verify the transaction as valid and spendable. Full-node clients can track the source of the funds from the moment the bitcoin were first generated in a block, incrementally from transaction to transaction, until they reach Boku’s address. Lightweight clients can do what is called a simplified payment verification (see [spv_nodes]) by confirming that the transaction is in the blockchain and has several blocks mined after it, thus providing assurance that the miners accepted it as valid.
Boku can now spend the output from this and other transactions. For example, Boku can pay a contractor or supplier by transferring value from Aya’s coffee cup payment to these new owners. Most likely, Boku’s bitcoin software will aggregate many small payments into a larger payment, perhaps concentrating all the day’s bitcoin revenue into a single transaction. This would aggregate the various payments into a single output (and a single address). For a diagram of an aggregating transaction, see Transaction aggregating funds.
As Boku spends the payments received from Aya and other customers, he extends the chain of transactions. Let’s assume that Boku pays his web designer Gopesh in Bangalore for a new web page. Now the chain of transactions will look like Aya’s transaction as part of a transaction chain from Jun’ichi to Gopesh, where the output of one transaction is spent as the input of the next transaction.
In this chapter, we saw how transactions build a chain that moves value from owner to owner. We also tracked Aya’s transaction, from the moment it was created in her wallet, through the Bitcoin Cash network and to the miners who recorded it on the blockchain. In the rest of this book, we will examine the specific technologies behind wallets, addresses, signatures, transactions, the network, and finally mining.