Basics of Blockchain
Before we dive into the Ethereum blockchain and start writing smart contracts, let's explore what a blockchain actually is. This chapter will jump into some of the fundamentals and give you a practical understanding of what blockchains are. This section will walk you through a coding exercise that will enable you to write a blockchain from scratch.
Blockchain is a combination of databases, cryptography, and network dynamics. Back in the 1990s, the concept of blocks of data being chained together (like a linked list) was developed. Fast-forward to 2008, when a white paper proposed the idea of Bitcoin, a digital currency with the underlying technology being blockchain.
The whitepaper proposed that a peer-to-peer version of electronic cash would allow online payments to be sent from one party to another without going through a financial institution. This gave way to the concept of
Blockchain is a set of data (organized like a table of data) that is locked at each point of editing. Once data is added to the blockchain, the information is permanent.
What is a Blockchain? (Deeper Dive)#
Beyond the textbook definition of a blockchain, there are a number of properties that make the solution a viable platform for storing data and value.
These key properties make blockchain solutions a highly suitable option for sharing information and value across the internet:
Simply put, there is no central authority or party responsible for storing and managing blockchain data. Instead, the data is on a digital ledger which is owned by individuals or parties around the world on their hard drives and servers.
This ensures that no single party has absolute control over all the data and that malicious actors cannot control the data on the blockchain.
The implication of this is that there is no third-party person or organization needed to validate the information being sent to the blockchain. To incentivize people to do this, there is a network fee. The network fee is usually a lot lower than fees required to store and validate similar information using third parties like banks.
Information and value (transactions) on a blockchain can settle a lot quicker than in traditional infrastructures where data is typically managed in a centralized manner. Blockchains have the ability to remain online 24/7 and because of this, transactions are not constrained by the rigid working hours of institutions such as banks.
What is a Transaction?#
Blockchains capture the "state" of data. Whether is the state of cryptocurrency in all network participants, or some other kind of data, blockchains will always give the latest information.
To update or modify the state of a blockchain, a user or network participant must propose a change, with a network fee. This proposal is batched with a set of other proposals and processed by network participants. This is what we call a blockchain transaction.
How does Verification of a Transaction Occur?#
Verification of some of the biggest blockchains fall onto a group of "miners". Miners are people with computers configured to solve very complex math equations. Miners will scan the blockchain to see which transactions have the highest network fee and process these transactions first.
The equations are a product of encryption and designed to product transaction data on a blockchain.
The first miner to solve the equations (thus verifying incoming transactions) receives a reward, also referred to as a
block reward, and usually paid out in the blockchain's native coin or token. For example: a miner on the Ethereum blockchain gets a block reward in ether.