What is Blockchain?
A Blockchain is a chain of data records that are distributed across a decentralized network of computers (peers), meaning that there is no central authority or single point of failure.
Each computer keeps its own copy of the ledger (blocks), and any update requires the approval of a majority of machines in the network, which makes it impossible to manipulate.
Each record is called a block; each block holds a section of data and a "Hash" generated from the data contained in each block using cryptography. Blocks are linked together by referring to the hash of the previous block.
Prev: 0000
Prev: 1Z8F
Prev: 6BQ1
Hashing
An encryption function that converts any input (text, image, etc.) into a fixed-length code. The same input will always result in the same code. However, even the most minor change will entirely change the code.
hash function
hash function
hash function
How Does a Blockchain Work: A Step-by-Step View
A user requests for a transaction (Someone sends Bitcoin to a friend).
A block representing the transaction is created (The transactions are packaged into a block).
The block is broadcasted to all the nodes of the network.
All the nodes validate the block and the transaction.
The block is added to the chain (chained onto previous blocks).
The transaction gets verified and executed (The Bitcoin is recieved).
Validating Transactions
Ok, so everyone can have a copy of the ledger and see all of the transactions. But how can they be sure these transactions are valid?
- To submit a transaction, a user must digitally sign it using a “cryptographic key”.
- When a user submits a transaction, it propagates throughout the network in seconds or minutes. Every node checks to ensure the transaction is feasible and was properly signed. If yes, they continue to propagate, if not, they discard the transaction.
- If more than 50% agree that is it valid, it is considered a valid transaction.
- But… these are not part of the blockchain yet.
Old decryption technology. All users have a “public key” and a linked “private key”. The public key is widely known. The private key must never be shared. A user signs their transactions with the private key, and then all users can verify that it was truly the right person by checking it against their public key.
Mining Transactions
After transactions are validated, they wait in a queue until they are “mined” by a “mining node”.
- A mining node will validate a set of transactions from the queue and group them into a “block”.
- The mining node then publishes the block to the chain and begins to broadcast the new block across the network.
- The mining node discards any invalid transactions.
Although this is complex, it is all done automatically with blockchain software.
In addition to they key principles of:
Distributed: everyone holding a copy of the ledger and these copies are automatically synchronized.
Shared: all transactions being transparent to everyone.
There is a key third principle: Immutability
Once data has been written to a Blockchain, no one, not even a system administrator, can change it. This helps to ensure trustworthiness.
Immutability is a result of how Blockchain technology is designed.