Show your support: 17ojFGrjczRtoAznoa1K4PZGvUSQ695hQX – or on my Donate page
This is episode 3 of my Bitcoin 101 series. Playlist here.
What is a Blockchain?
A blockchain is a public decentralized ledger.
Ledgers are a special kind of database. Where databases are generally not concerned with order or time, ledgers are databases primarily concerned with order and time. They are almost exclusively used in financial applications.
A blockchain keeps track of information in a way that is tamper resistant, government resistant, and public, by decentralizing a traditionally centralized role.
The blockchain solution was discovered by Satoshi Nakamoto for implementation into bitcoin. He never used the term “blockchain”, but did use the two word variety “block chain”.
The reason blockchains exist is to enforce scarcity. In the Digital Cash episode of this series I talked about the why cash used to be physical, and how that physical nature enforced scarcity on the money. With the advent of the internet, the physical nature became a hindrance, physical things can’t be sent over the internet. We don’t have transporters yet, to transport a physical object from here to there. To use money on the internet, we made dollars digital, and to enforce some level of scarcity, we used trusted third parties. We entrusted humans with the very thing that makes money money in the first place, the scarcity of it.
Decentralization of money is of the utmost importance. When money is centralized it becomes political. It can be frozen, stolen, or copy and pasted.
I covered three types of data structure in bitcoin, the digital token, the transaction, and the block. My definition are not 100% accurate, but they are generally accurate. If you are interested to learn more, please do your own research.
The digital token, “bitcoin” is a scarce piece of data. This data can be viewed by the public and is, in fact, tracked by every node. The key characteristic of this piece of data that makes it scarce is the ability to send it. To send bitcoin you must be able to sign a transaction with the private key that corresponds to those coins.
A bitcoin transaction is made up of inputs as digital tokens (technically Unspent Transaction Outputs (UTXO) is more accurate), outputs, and a signature or multiple signatures in the case of multisig transactions. A fee to the miner to encourage priority inclusion is added as an unclaimed output.
A block consists of a header and transactions. There must be at least one transaction per block, called the coinbase transaction, where the creator of the block rewards themselves with the block reward (currently 12.5 btc). Each block contains the hash of the previous block, resulting in an unbreakable chain. Miners/nodes will always accept the longest chain (the one with the most Proof of Work) as the true state of the network. If a historic block is mettled with, it will change the hash and invalidate all blocks after it. Only when an attacker can recreate all the PoW of all the proceeding blocks is there a possibility of an attack.
The minimum computer power of the network needed to pull off this task is 51%, hence the 51% attack. It must be a majority of the computer power, because it must work faster than the rest of the network combined to catch up by creating a new chain as long as the one the attack wants to replace. In practice, it’s my opinion this is extremely rare at more than three blocks in the past. To do more than three blocks worth of work, before the rest of the network finds a block requires a large majority of the computer power, not just the 51%, probably closer to 75%.
Hash function and hashes
A hash function is any function that can be used to map data of arbitrary size to data of fixed size. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes. One use is a data structure called a hash table, widely used in computer software for rapid data lookup. Hash functions accelerate table or database lookup by detecting duplicated records in a large file. An example is finding similar stretches in DNA sequences. They are also useful in cryptography. A cryptographic hash function allows one to easily verify that some input data maps to a given hash value, but if the input data is unknown, it is deliberately difficult to reconstruct it (or equivalent alternatives) by knowing the stored hash value. This is used for assuring integrity of transmitted data, and is the building block for HMACs, which provide message authentication. 1
Miners are the users that do all the hashing on the network. They secure the network through their incentivized behavior. Their good behavior creates a basis for the value of the token they are mining. Miners race to find an input to a problem that will hash to a specific level of difficulty. They must incur cost to discover an answer. Once they find an answer, they include all the transactions that have happened on the network they like, and transmit the block to the network. Miners chain blocks together by putting hashs of the previous state (block) in the new block.
- “Hash function.” Wikipedia: The Free Encyclopedia. Wikimedia Foundation, Inc. 17 Dec 2016. Web. 21 Dec 2016. ↩