01 - Intro to Blockchain & Smart Contracts

What is “blockchain”?

“Blockchain technology” is the buzzword in the business. You probably have heard about everything but the kitchen sink being put “on the blockchain.” Let’s review what a blockchain actually is.

A good starting point for understanding the structure of a blockchain is comparing it to a linked list, specifically a singly-linked list, which is probably the type of linked list with which you are most familiar.

Linked lists are composed of nodes that contain pointers to the next node in the list. In the context of cryptocurrency, a blockchain structure contains blocks which contain references to the previous block in the chain. It’s like a linked list, except instead of adding new nodes onto the end (furthest node) of the list, you add new blocks to the beginning (closest node).

A block on a blockchain represents a certain span of time, making a cryptocurrency’s blockchain a living structure of sorts, in that it is always being updated with the next timespan’s block. Bitcoin’s blocks represent a timespan of about 10 minutes, and Ethereum’s about 14 seconds. This timespan is called block time, and the data included in each block represents the activity that occurred during that time. This activity takes the form of a list of transactions, like:

From To Amount
Alice Bob $10 Charlie Dana$15

Everyone1 connected to a cryptocurrency’s network maintains a complete copy of that cryptocurrency’s blockchain. However, this means that whenever a change to the blockchain occurs (e.g. someone makes a transaction and wants to add it to a block), everyone needs to agree on whether that change is allowed, and once agreement has been reached, that change can be distributed to everyone.

Mining

The idea of “mining” cryptocurrency lends itself to some imaginative mental imagery of steampunk hackers delving into the depths of cyberspace to extract mysterious cryptographic treasures. While it’s a fun thought, the reality of mining is a lot more like balancing hundreds of millions of checkbooks at once than it is like chopping rocks with a digital pickaxe.

Cryptocurrency miners help secure the blockchain. They establish trust with the network, and then the network accepts blocks that the miners say are legitimate.

The problem of consensus

Since anyone is allowed to connect and propose new blocks to a cryptocurrency network, there has to be some way to ensure that only legitimate blocks (i.e. those containing legitimate transactions) are added to the chain and that illegitimate blocks are rejected from the chain. However, the network is made up of a whole bunch of strangers whose only common link is that they want to use the same cryptocurrency, and thus, they have little to no reason to trust each other to make the correct decision (as opposed to the decision that most benefits themselves).