Funded by the European Union. Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the National Agency. Neither the European Union nor National Agency can be held responsible for them.

3.1 Bitcoin Deep Dive

Bitcoin Transactions

After having learned about Bitcoin transactions on a high-level overview before, we will now look at Bitcoin transactions in a more detailed manner.

There are No Bitcoins

It is important to note that there are no Bitcoins, only records of Bitcoin transactions. Bitcoins technically do not exist anywhere, not even on a hard drive. If you search for a specific Bitcoin address, you will not find any digital Bitcoins there. There is no physical object or a digital file that “is” Bitcoin. Instead, there are only records of transactions between different addresses with balances that have either increased or decreased. Every transaction that has ever been executed is stored in a public ledger (the blockchain).

If you want to calculate the balance of any Bitcoin address, you must calculate it using the blockchain, because no information is stored in the address.

Any user on the Bitcoin network can view every transaction ever made via the Bitcoin Blockchain. As we already know, Bitcoin transactions are secured by digital signatures and are sent back and forth between Bitcoin wallets via their addresses.

Transaction Confirmation Time

Transaction confirmation can take minutes, hours, or days because a transaction needs to be confirmed by miners. Depending on the transaction fee that you paid, your transaction may remain in the transaction pool for a long period of time, simply because the provided incentive (i.e., the transaction fee) is not high enough for your transaction to be included in a block right away. Depending on the traffic on the Bitcoin network, this can delay the transaction by hours or days or can even lead to the rejection of the transaction.

The Bitcoin protocol is set so that each block takes about ten minutes to be mined. Some traders make the user wait until the block is confirmed. On the other hand, there are some traders who do not wait until the transaction is confirmed. They take the risk and assume that people will not try to spend their Bitcoins on other things before the transaction is confirmed. This is common for low transactions (micropayments) where the risk of fraud is not so high. Each recipient can decide for themselves how many confirmations they require. The principle is that more confirmations make the transaction more secure, but also slow it down.

The Logic of Bitcoin Transactions & Bitcoin Stored in Your Wallet 

Since Bitcoins exist only as records of transactions, many different transactions may be tied to a specific Bitcoin address. Perhaps Jane sent Alice two Bitcoins, Chris sent her one Bitcoin, and Eve sent only one - all as separate transactions at separate times. They are not automatically converted to Alice's wallet to six existing bitcoins in one file, but they exist only as different transaction records. When Alice wants to send Bob bitcoins, her wallet will try to use transaction records with different amounts that add up to the amount of bitcoins she wanted to send Bob. Unlike on your bank account, amounts of Bitcoin accumulating in your wallet, on a technical level, do not add up to one mass but remain individual entities. 

There is a possibility that Alice's wallet does not have the exact amount of addable transaction records that she wants to send to Bob. If Alice wants to send, say, 1.5 BTC to Bob and none of the transactions she has in her wallet match that amount or can be added to that amount, then the following happens: Alice sends the two

Bitcoins she got from Jane to Bob. Jane is the input and Bob is the output. However, since Alice wants to send the amount of 1.5 BTC, her wallet automatically creates two outputs for her transaction: 1.5 BTC to Bob and 0.5 BTC to a new address created to hold the change from Bob for Alice.  Bitcoin transactions are divisible. One Satoshi is one hundred millionth of a Bitcoin. It is possible to send a Bitcoin transaction in the amount of 5,730 Satoshi.

Bitcoins (In)ability to Handle Transactions

Bitcoin is supposed to be an electronic money system where participants can send money directly to each other. A money system that is not controlled by a central office but is based on a computer protocol. Theoretically, this money system should be accessible to everyone in the world. This would provide a universal monetary standard; a common "language" for all mankind.

But theory does not translate so easily into reality. Even though Bitcoin is already an electronic money system without controlling middlemen, it cannot be used by everyone. The reason for this is the scalability it requires.

The problem becomes clear when you imagine how many transactions take place every day in the global economy. While Bitcoin technology can easily transfer gigantic sums, it reaches its limits when it comes to a high frequency of transactions. The reason for this is technical: the blockchain, on which all transactions are recorded, only offers limited space for transactions.

You can think of it a bit like a bus. This bus has a limited number of seats. When all the seats are full, no more people can ride. This is quite a similar mechanism to the blocks in the Bitcoin blockchain. These also only have a certain number of "seats" for transactions. When all the seats are taken, no more transactions can "ride" on the bus (i.e., be confirmed). An oft-recited metric when it comes to Bitcoin's functionality is transactions per second. A block in Bitcoin can be a maximum of 1 megabyte in size. An average transaction is 400 bytes in size. That means, on average, 2,500 transactions can fit in one block. A new block is found approximately every 10 minutes. Consequently, the Bitcoin system can process about 4 transactions per second.

However, the so-called "SegWit" upgrade now also allows blocks up to 4 MB but is not yet supported by all nodes. With the SegWit update for Bitcoin in 2017, an intelligent solution was found to circumvent this limit. This increased the possible number of transactions per second fourfold.

While the Bitcoin blockchain reaches its limit at more than four transactions per second, PayPal can process up to 115 transactions per second. The Visa payment network claims to be able to process up to 24,000 transactions per second. The SegWit update helps with scalability but does not achieve Visa payment network-like numbers.

One mechanism in Bitcoin is that transactions can secure a seat on the bus through their transaction fee. That is, if Alice wants to send an important transaction to Bob that should find a seat on the next bus, she can pay a higher-than-average fee. The "bus driver" (the miner) does not have to let the transaction ride, though he can earn a relatively high transaction fee if he does. As a result, he has an economic incentive to make room for the transaction on his bus. The problem comes if everyone trying to send a transaction provided a higher-than-average fee. The space on the blockchain, the space on the next block, on the next bus, is fixed. As more and more people want to use the Bitcoin monetary system, as more and more transactions want to crowd onto the bus, the transaction fees go up. This is because transactions compete for a spot on the blockchain through their fees. In December 2017, you could see an example of this bidding up of transaction fees. The transaction fee is thus not dependent on how much Bitcoin you are trying to send but dependent on the competition in other unconfirmed transactions and how high of a transaction fee they are bidding. 

However, two nuances must also be mentioned in the scalability discussion: The transaction size and the finality of a transaction.

In Bitcoin, it does not matter to the fees and the network whether an amount of 0.001 BTC or 10,000 BTC is sent. What matters is the number of inputs and outputs of the transaction. With alternative payment systems like Visa and PayPal, you usually pay a percentage fee on the transaction amount instead. Sending large amounts is accordingly more expensive.

The finality of the transaction describes the possibility that the transaction can be reversed. With Bitcoin, this is very difficult: once a transaction is sent and written to a block, it can hardly be undone. This is an advantage, because sellers can thus be sure that the supposedly friendly customer will not cheat them afterward. This is different with PayPal and Visa: here there is a period (usually 30 to 120 days) in which the payment can be revoked. This is possible because PayPal or Visa are the central authority in the monetary system. They determine the history of the transactions and can also change it in hindsight. While Bitcoin is lagging in transaction frequency, the technology can already score massively in terms of transaction size and financial finality.

Solution Approaches for Scaling: On-chain vs. Off-chain

The transaction capacity question is also often called the scaling question. At its core, it has come to take on the same character as the Gretchen question in Goethe's Faust:

Now tell me, how are you at scaling?

Basically, the answers can be divided into two camps: on-chain scaling and off-chain scaling.

The approach on-chain advocates, to go back to the bus example is to scale up the bus. That is to limit the blocks to 1 megabyte, a new upper limit is set for the block. This way, more transactions can fit on the bus, which still leaves every 10 minutes. Assuming the block size increases to 10 megabytes, the number of transactions per second also increases by a factor of 10. This means that it would then be possible to process about 40 transactions per second. The way to improve the capacity of the blockchain by increasing the block size is expressed in the Bitcoin hard fork Bitcoin Cash (BCH).

The alternative to this is off-chain scaling. Here, the aim is not to improve the transaction capacity of the blockchain itself, but to create a second layer for transactions that docks onto the first layer, the blockchain. This second layer would inherit the security aspects of Bitcoin and would also allow a magnitude more transactions. So instead of scaling linearly, as with the on-chain approach, the second layer could handle millions of transactions. And they could be done instantly, for very small amounts, and with similar security to the Bitcoin system itself. This method of scaling Bitcoin outside of the blockchain also goes by the name Lightning Network.

Lightning Network

The Lightning Network is a time-locked off-chain payment channel. This means that users can fix BTC off- chain, i.e., away from the Bitcoin blockchain, and send it to other users. Sending value is almost instantaneous and, similar to on-chain transactions, does not require a trusted third party. The Lightning Network is seen as a promising scaling solution for Bitcoin. For many Bitcoin proponents, the Lightning Network (LN) is the logical next development of the Bitcoin payment system. You can imagine the architecture like a cake with several layers. The Bitcoin Blockchain is the bottom, or the so-called base layer. The Lightning Network would be built on top of that. Certain characteristics of the base layer could be inherited, such as security, while other limitations no longer apply, such as the limited number of transactions. The link between the base layer and the lightning network is achieved by a number of cryptographic mechanisms.

Payment Channels

The core of the Lightning Network is payment channels. A payment channel can be thought of as a tunnel between two parties, Alice, and Bob. It connects Alice and Bob directly. The difference between a payment channel and a transaction on the blockchain is that payments within the tunnel are not recorded on the blockchain. Instead, Alice and Bob can keep updating the state of the payment channel and only write the last state to the blockchain when they are "done." Updating the payment channel happens outside of the blockchain and is not bound by its limitations. Alice and Bob could refresh the state of their channel several times per second. In other words, micro-transactions become not only possible but plausible. Instead of sending multiple transactions, the amount owed is summed up after a certain amount of time only then is it settled on the main blockchain.

Bitcoin Mining Deep Dive

In Module 1, you have already gained an understanding of the purpose and working mechanism of the Bitcoin mining process. Now, you will dive into the details of mining such as hardware and energy requirements and the legality of mining in different countries in the Generation Blockchain Podcast on Bitcoin mining.

Click here to listen to the Generation Blockchain podcast on Bitcoin mining.

© 2024 Generation Blockchain. All rights reserved.