In our previous post we talked about the background and history of blockchains and where it has come to. In this post we will take a deeper dive into Bitcoin, discussing what it is, how it works and what the data looks like.
Bitcoin is known as a peer-to-peer and distributed “electronic cash system” with no third party. Let’s break this down.
There’s a lot of cryptography and other security principles involved, but we can get to that in the future.
Here is a high level overview about how the system works. We omit many of the technical details for simplicity.
There are also two types of data, blocks and transactions. A Transaction is a record which shows coins being sent between parties. A Block is a group of verified and accepted transactions.
In Bitcoin there are two types of participants, miners and users.
Users send and receive coins to each other using their public addresses. When a user sends a transaction, they also attach a fee. This fee is an incentive to encourage the transaction to be accepted by the miners. It is like when you buy something with your credit card, the bank takes a fee and in return checks the transaction is okay. Unlike traditional finance, blockchain transactions are permanent meaning they cannot be reversed under normal circumstances. Once the coins are sent they can’t come back, unless the recipient sends them back in a new transaction.
Miners mint new coins and validate users transactions. To mint new coins a miner has to make new blocks. Blocks are groups of valid transactions from users. To make coin minting fair for everyone to have a chance, the miners must solve a hard maths puzzle in order to create new blocks. Once you have an answer it’s easy to check if it’s correct.
Once a miner finds a solution, they must then tells everyone on the network. The other people on the network check the answer. If more than half of the network accept, then the miner gets the prize (new unused Bitcoins and all transaction fees of the transactions). All the transactions they choose go into the ledger as a new block. As of 13th August 2020 a new block mints 7BTC which is roughly $80,000 USD.
Note that a miner can also be a user and vice versa.
Now lets put this all together. Let’s say that our friend Alice wants to send Bob 5 Bitcoins.
As mentioned previously, Bitcoin has two types of data, blocks and transactions. A Transaction is a record which shows coins being sent between parties. A Block is a group of verified and accepted transactions.
Above is an example of a bitcoin block. A bitcoin block contains data such as the time it was made, the amount of fees that were rewarded from the transactions, the transactions in the block, the block number (its position within all the blocks) and its unique identifiers.
Above we have obtained an example transaction with some fields omitted for simplicity. A transaction contains information such as who was sending the coins (input), who received the coins (outputs), the identifiers of the people who send and received the coins (addresses), the amount of coins send and received, the block this was confirmed in and the unique identifier of the transaction (hash).
In our example above, we have a single sender who sent 0.7436288 Bitcoins to two addresses.
The first address (3EunooPX1BQQ6PHEUwicLbkGXuc8AXkQCX) received 0.5438396 Bitcoins, the second address (1EnnACZL3YzUNqhgTM9yBCuSn6bEtRKA3Q) received 0.1991202 Bitcoins, the remaining bitcoins (0.0000669 Bitcoins) were the transaction fee.
This data is stored in Bitcoin nodes. If you want to get access you can simply download the bitcoin client https://github.com/bitcoin/bitcoin/ and run it in full mode. Watch out for our next blog post where we will explain how you can run this node and some free tools to get access to this data!