ELI5 Blockchain: A blockchain is a sequence of entries where any attempt to modify a previous entry would modify the entire chain. Each entry is a block which holds some data and points to the block before.
It is an immutable data structure that stores blocks in chronological order of insertion. The data stored in blocks committed to the blockchain cannot be tampered with or everyone would immediately be able to notice.
Each “entry” in a blockchain is, you guessed it, called a block.
Blocks can be of any size, from tiny kilobyte sized blocks to several gigabytes large. Making blocks too large will require larger computers to process the signature (hash) of each block and will also make it more difficult to fill these blocks with data (such as transactions in Bitcoin).
Therefore, it is convenient to choose appropriate size blocks to store the kind of data each specific application requires. This, of course, depends on the specific type of data that will be stored in the blockchain.
E.g. If the average entry is just a few tens of bytes in size, like Bitcoin TX’s, then blocks can be limited to the megabyte scale and still be capable of storing a reasonable amount of entries. In fact, Bitcoin had fixed its block size to 1MB before SegWit. After SegWit, lots of larger Bitcoin blocks are being mined, some even passing the 2MB size mark.
If, on the other hand, the specific application requires large binary objects (BLOB’s) to be stored on the blockchain, perhaps a larger block size would be convenient.
Blocks can be stored in any kind of file. In Bitcoin, a directory called
blocks/ stores raw data received from the Bitcoin Core network. Each block is stored in regular files and contains all the recently mined Bitcoin transactions from the latest blocks. Other cryptocurrencies may use different storage systems, such as SQLite or Berkeley databases. There is no set requirement for Bitcoin storage, as long as each new block cryptographically references the one before.
Every bit of information contained in a blockchain passes through a process known as cryptographic hashing. This process is secure and the algorithm is chosen such that it does not cause collisions (same hash code generated for different information). Hashing is also performed in a way that the resulting code cannot be used to recover the originally hashed data (that is, hashing is one-way).
Each block will then have a signature hash that is universally unique and impossible to reproduce except if you have the original data in the block, stored in the exact same order. For instance, if you took the exact same transactions and stored them in a different order within a block, the resulting hash would be different as well. Even though the block would contain the exact same data, the order with which they’re stored is different and this generates a different signature. This illustrates how blockchains do not allow for any aspect of the data to be modified, not even the order with which identical data was stored!
Blockchain is a special kind of database which does not allow any kind of tampering. Entries are recorded in chronological order and this order cannot be changed. Therefore, blockchains prove not only that data is valid, but also at which point in time that data was known. Therefore it can be used as “proof of knowledge” of information. Using a blockchain you can prove that you knew something at a certain point in time. This was used by the creator of Bitcoin itself, when he encoded the following newspaper headline into the very first Bitcoin block ever mined:
The Times 03/Jan/2009 Chancellor on brink of second bailout for banks
This message is proof of knowledge timestamped January 3 2009. It proves that Satoshi Nakamoto had access to that piece of information on that date, and this date cannot be modified, ever.
Blockchain in Finance
Financial transactions are naturally well suited to be stored in blockchains.
Money transfers happen chronologically and a secure, often permanent, record must be kept of each operation. If the order of operations were ever changed, the whole blockchain would be considered tampered with. The amounts involved, as well as other transaction details, are also impossible to tamper with.
This makes the blockchain perfect for digital cash transactions.
Bitcoin was the first successful application of blockchain as a storage engine.
Each Bitcoin block stores transactions in the order a miner used to assemble the block. These transactions are not necessarily in chronological order within the block, but blocks are arranged in chronological order, one after the other.
A block is committed onto the Bitcoin blockchain once per 10 minutes on average. This time period is fixed by the Bitcoin Core source code and cannot be altered.
Since the hash for every new block depends on the hash of the previously newest block, if any piece of data were modified in any earlier block, that change would immediately propagate to the front of the chain. The most recent block hash would suddenly change and the network of verifying nodes would immediately alert users that something unexpected had happened.
Although alternative cryptocurrencies are implemented in several different ways, most of them follow the same basic idea as Bitcoin.
Although second and third generation cryptocurrencies introduce more sophisticated features, such as smart contracts and built-in compliance mechanisms, the basis for the decentralized ledger is still a system of blocks where each block depends on the previous one.