Getting your head around how a payment network can be run by a series of different computers worldwide, all performing combined functions to keep a network processing and secure, is a tough ask, and it will take time. To understand how bitcoin works, you should focus on the pieces that make up the network, and as you know each piece, you can see how they fit together in such an elegant design.
The Bitcoin network runs on a distributed public ledger that records the ownership and transactions of all bitcoin, or UTXOs, that make up the native digital asset BTC. As transactions take place over the network, transaction data are grouped into “blocks” and added chronologically to the network’s ongoing linear chain of data blocks — hence the term “blockchain.”
However, as blockchain has become such a bastardised term due to altcoin misuse, some bitcoiners prefer to refer to it as a “timechain”. The blocks that make up the blockchain’s ongoing sequence of transactions are intended to be structurally identical.
How did the block size come to be part of bitcoin?
Satoshi Nakamoto launched the bitcoin blockchain and mined the bitcoin’s genesis block in 2009, and at the time, there was no explicit block size limit. He introduced the block size limit a year later when he realised it was the only way to prevent miners from creating blocks larger than other miners, and to an extent, nodes could accept and process without issue.
He incorporated code that limited the block size to 1 MB.
At the time of the change, actual block sizes were much smaller than 1 MB, and Nakamoto likely did not anticipate that blocks would ever become overcrowded with data. Nakamoto picked the size as the upper limit for data processing. Any higher in size, nodes would need a faster internet connection and require more data storage and processing power to manage, which would be a centralising effect on the network.
Some people believe that Nakamoto’s limit was unwise and limited throughput on the base chain, limiting bitcoin’s transaction capacity. Bitcoin has often faced criticism for its transaction rate, which is currently around 3- 7 transactions per second (on the base chain).
At this speed, not all transactions make it into a block during busy periods and have to wait in queue for the next block, which can create serious delays in processing during network congestion.
What is the bitcoin blocksise?
Bitcoin’s block size remained at 1MB for many years until it started to cause network congestion and fees began to skyrocket; developers and community members looked at possible solutions and eventually settled on SegWit.
The block size cap in Bitcoin was substituted in 2017 by a network recommended weight of 4 million value units. This altered the way data in blocks is “counted”: specific data has a larger weight than others. Maybe more specifically, it reflected a successful block size cap increase.
This is thanks to an upgrade to the Bitcoin protocol called Segregated Witness, or SegWit for short. SegWit replaced the concept of block size with block weight and virtually increased the size by four times (in theory, at least, since real blocks rarely approach that size).
Bitcoin’s block size may be greater than 1 MB, and many blocks published nowadays are larger than that, as you can see from the graph below.
In addition to having a flexible measurement for block space, SegWit also helped enable the ability to create hashed time lock contracts, the vault to which bitcoin can be locked and used on the Lightning Network, which further reduced the need for block space.
A brief history of the bitcoin block size debate
In 2017 as the debate raged on about whether bitcoin’s block size limit should be increased to enable a higher transactions-per-second rate, it resulted in a split of the community, which is labelled “The Block Size War”.
One side pushed for SegWit and the Lightning network as their preferred option for scaling, while another side pushed for increasing the block size. Bitcoin (BTC) ended up with the SegWit update, and the Lightning Network grew from strength to strength.
While the resulting hard fork Bitcoin Cash (BCH) has 32 MB blocks and can handle far more throughput than bitcoin on the base chain, but is far more centralised and resource-intensive to remain decentralised, and the price of the asset has plummeted when compared to bitcoin.
Note: To get a better understanding of the Block Size War, we recommend you check out the book by Jonathan Bier – The Blocksize War: The Battle Over Who Controls Bitcoin’s Protocol Rules.
What makes up a bitcoin block?
Each block contains a block header and transaction data — two crucial sets of information integral to the network’s proper function and ability to transfer value. Each block must also contain certain specific information to be recognised by the network and subsequently become properly validated and appended to the blockchain.
The overall structure of a bitcoin block always includes the following elements:
- Magic number: This 4-byte field always contains the value 0xD9B4BEF9, which indicates that the file format adheres to a data structure that corresponds to the Bitcoin network.
- Blocksize: This 4-byte field sets a cap on the amount of data contained in a block.
- Block header: This 80-byte field consists of six individual components, discussed in more detail below.
- Transaction counter: This field can range in size from one to nine bytes and is a positive integer that represents the number of transactions contained in the Bitcoin block.
- Transactions: This variable size field contains the list of all transactions in the block and is typically filled with enough transactions to fill the 1MB Bitcoin block size limit.
The block header and the transaction data represent the two main categories of data in any given block.
What is the life cycle of a bitcoin block?
When a bitcoin block is compiled, certain information needs to be collected and formated before the block can be processed by a miner. In a bitcoin block, transaction data makes up the majority of information inside the block’s data structure.
In a traditional bitcoin transaction, the block contains both inputs and outputs, a generation transaction mints new BTC from the protocol itself. The rest of a block’s transaction data includes addresses of senders and receivers, the amount of BTC in each transaction, private key signatures authorising the sending of BTC, and timestamps that cryptographically verify exactly when each transaction occurred.
For each individual transaction, the following data is included:
- Txin_count: This indicates the total number of transaction inputs.
- Txins: This contains a list of all transaction inputs.
- Txout_count: This indicates the total number of transaction outputs.
- Txouts: This contains a list of all transaction outputs.
- Script_witnesses: This contains a serialisation of all the witness data for SegWit transactions.
- Lock_time: This 4-byte field sets the block number or timestamp until the transaction is locked. It is typically set to zero, meaning the transaction becomes valid immediately after the block is finalised.
As mentioned previously, the bitcoin network supports “Segregated Witness” (SegWit), which enables transaction signature data to be segregated and compiled efficiently — keeping the block at one MB while increasing block space for transaction data.
The following transaction data is only included in SegWit transactions:
- Version: This 4-byte field indicates the version number of the Bitcoin protocol being used and typically contains the value “1.”
- Marker: If present, this 1-byte field indicates that the transaction uses SegWit and contains the value “0x00.” If the transaction does not use SegWit, this field contains the value “null.”
- Flag: If present, this 1-byte field also indicates that the transaction uses SegWit and contains the value “0x01.” If the transaction does not use SegWit, this field contains the value “null.”
What is the competition for block space?
When you broadcast a transaction to the bitcoin network, it is first placed in the mempool; once in the pool, miners will select transactions to compile a block based on the rules of the network and limitations. If the miner is the lucky one to mine the next block, his proof of the block will be added to the chain, and your transaction will be confirmed within that block.
When there is a lot of traffic on a blockchain network, blocks sometimes get filled to their limit. This means that some transactions can’t be included in one block and have to wait for the next one.
As people become impatient and want to have transactions processed, they increase the transaction fee to get miners to process their transactions, and as more people bid to be part of the next block, the higher the fees for a transaction become.
Have you performed an on-chain bitcoin transaction?
Have you had to deal with a block space costing a premium? How do you manage your on-chain transactions? Let us know in the comments down below.