The State Monad Math and programming stuff

Blockchain 101

The History of Blockchain and Bitcoin

The marvelous technology we know as Blockchain today was introduced with the invention of Bitcoin in 2008.

Electronic Cash

The concept of digital cash is nothing new (relatively speaking). The term has been around since the 80s, when David Chaum proposed his e-cash protocol models. One thing bitcoin accomplished where all others failes is solving the Byzantine Generals Problem. Only then was a form of electronic cash capable of solving the double spending problem.

You can learn more about the double spending and Byzantine Generals Problem here.

Blockchain

In 2008, a revolutionary paper entitled Bitcoin: A Peer-to-Peer Electronic Cash System was written on the topic of peer-to-peer electronic cash under the pseudonym Satoshi Nakamoto. In this paper, appeared for the first time, the term chain of blocks. This term later evolved over the years into the word blockchain.

Distributed Systems

The understanding of distributed systems is essential to the understanding of blockchain technology, as blockchain is a distributed system at its core. Blockchain is just a fancy word for distributed ledger, and distributed ledger is just a fancy word for information that lives in more than one place.

Yes, blockchain was originally intended to be and is usually used as a decentralized platform; despite that, it is not strictly necesary for a blockchain te posess such quality. However, in general blockchain can be thought of as a system that has properties of both decentralized and distributed paradigms.

We begin defining the quintessential components in a ditributed system: The node. In simple termns, a node can be defined as an individual player in a distributed system. All nodes should be capable of sending or receiving messages from any other node in the system, it doesn’t matter if these nodes are good honest nodes or naughty evil malicious blood sucking vampire nodes. Each node has memory and a procesor to prcoess information distributed accross the network. A node that exhibits dishonest behaviour is known as a Byzantine node after the Byzantine Generals Problem.

But what is a distributed system exactly? Well, nothing out of this world… A distributed system is a computing paradigm whereby two or more nodes work with each other in a coordinated fashion to achieve some common goal. A well thought-out distributed system should be one in which the end user sees a single local coherent platform, that is, the end shouldn’t be able to distiguish a distributed system from a plain old simple centralized system.

Check out What is the Byzantine Generals Problem? to learn more about the Byzantine Generals Problem.

A directed network with five nodes in which node 5 is Byzantine.

Some Definitions

Informally, a blockchain is a secure, shared record keeping system in which each user of the data holds a copy of the records, which can only be updated if all parties involved in a transaction agree to update. In blockchain lingo: A blockchain is a peer-to-peer, distributed ledger that is cryptographically-secure, immutable, and updateable only via consensus or agreement among peers.

Cryptographically-secure

Blockchains use cryptography to secure transactions and make sure data is not tampered with within the blockchain.

Distributed Ledger

A distributed ledger is a ledger that is spread across the network among all peers in the network, and each peer holds a copy of the complete ledger.

Peer-to-peer

Peer-to-peer is just another way of saying there’s no third-party involvement between two indiduals. There is no central controller in the network. Every participant of the newtork can talk to each other directly. A famous example of a service that is peer-to-peer is: thepiratebay.

Immutable

A blockchain is immutable and append only, (or at least it should be) which means that data can only be added to the blockchain in time-ordered sequential order. This is a property of supreme importance in all blockchain systems, since it asserts the validity of transactions and makes it so no user can spend the same token twice. A token is a currency or exchange medium that is used in a blockchain. On Bitcoin this token is Bitcoin and on Ethereum this token is Ether.

Updateable via consensus

But what really makes a blockchain a blockchain is consensus. This is also Satoshi’s brilliant solution to the Byzantine Generals Problem. A blockchain must be updateable only via consensus. This is what makes a blockchain decentralized. any update made to the blockchain is validated against strict criteria defined by the blockchain protocol and added to the blockchain only after a consensus has been reached among all participating nodes on the network.

Dissecting the Blockchain

A nonce is a random number that is used in many cryptographic operations to provide authentication, and encryption and more. In the case of Bitcoin, it’s used in PoW (Proof of Work) consensus algorithms and for transaction replay protection.

Generic Elements of a Blockchain

How Blockchain Works

How blockchain architecture works basic understanding of blockchain and it’s architecture.

  1. A node starts a transaction by first creating and then digitally signing it with its private key. A transaction is not limited to sending tokens to other users, it could represent an invocation of a smart contract or simply a message sent to another user on the nework.

  2. A transaction is propagated by using a flooding protocol, called Gossip protocol, to peers that validate the transaction based on preset criteria.

  3. Once the transaction is validated, it is included in a block, which is then propagated onto the network. At this point, the transaction is considered confirmed. The newly-created block now becomes part of the ledger, and the next block links itself cryptographically back to this block.

  4. Transactions are then reconfirmed every time a new block is created. With every confirmation it becomes increasingly difficult to modify the content of a block (this is due to the PoW mechanism).

This concludes a basic exploration of what blockchain is and should give you an idea of its potential applications. If you wish to learn more about blockchain and it’s specifics concerning cryptocurrencies I recommend you visit Blockchain: Everything You Need to Know for a deeper understanding.