Tokenbrief #1: Blockchain 1-2-3 

To kick off our series in partnership with Tokenbridge, we present a general introduction to blockchain and how it works. 

By Editors

A blockchain is a distributed digital ledger that stores immutable transactions and allows the deployment of decentralised applications. The network is made up of nodes that can propose and validate transactions by the use of a consensus mechanism. Sending transactions usually requires a fee (referred to as gas) which is paid in the native coin for the blockchain network. 

Blockchain 1-2-3 

First, a blockchain is a distributed digital ledger, a store of information that is shared throughout a network, also referred to as “a single source of the truth.” 

Second, it is immutable: information once stored cannot be updated, reversed, or deleted as it is cryptographically secured. Only new transactions can be added.  

And third, decentralised applications can be deployed on the blockchain, through smart contracts. 

What is a blockchain, in a nutshell? 

A blockchain is a distributed digital ledger where transaction information is stored securely in sequential blocks that are cryptographically chained together. The transaction information is immutable but is readable to any entity that has access to the blockchain. 

How each blockchain generates these blocks depends on its architecture. In general terms though, this is how it is done: 

  • The blockchain network either choses or incentivises a computer, called a node, to validate transactions waiting to be included in the next block of the blockchain. 
  • This node selects a group of unconfirmed transactions and applies a set of validation rules to each transaction in turn, this is known as the consensus mechanism. While these rules can vary between blockchains, they all involve applying a cryptographic algorithm to confirm the authenticity of a transaction. All nodes know the consensus mechanism, ensuring that any node chosen to validate a transaction will always generate the same result or any incentivised node has the ability to solve the cryptographic problem. 
  • After the original node validates a number of transactions, it notifies the other nodes on the network. 
  • Each node then confirms the original node’s result using the consensus mechanism. 
  • Once the rest of the network agrees, the block is added to the blockchain. 
  • This validation process generates a unique cryptographic hash value which is then used to validate the transactions in the next block. 

This linking of blocks through the hash forms the chain hence the name blockchain. The network repeats this process for each new block. 

How does the blockchain work? 

Blockchain program 

At its most basic level, a blockchain is a software application: a computer program. The source code for the computer program is often made available to the proposed community of users (which could be everybody). 

Members of that community can participate by compiling and running the program on a connected computer (usually via the public internet), turning it into a node on the blockchain network. 

Nodes 

Each computer running the blockchain program is a blockchain node. To become a node the computer needs to install and run the blockchain application. The purpose of the application is broadly as follows: 

  • Discover and communicate with other nodes on the blockchain network. 
  • Send, receive and store blockchain data. 
  • Execute and validate transactions. 
  • Maintain the consensus of the blockchain. 
  • Verify blockchain information and receive rewards. 

Transactions 

A transaction represents an instruction to perform an action that will change values on the ledger. A transaction begins its life as unconfirmed. It is waiting to be selected by a node for validation and processing. In this state a transaction will include the following elements: 

  • The transaction hash that uniquely identifies the transaction. 
  • The sender’s wallet address. 
  • The recipient’s wallet address.  
  • What function the transaction is to invoke. 
  • Any input data to support the action. 
  • A number count of the total number of transactions sent by the sender’s wallet address. 
  • The balance of the blockchain coin involved with the transaction. 
  • The transaction fee payable in the blockchain coin that the sender is willing to pay for the transaction to be validated. 

When a node selects a transaction, the consensus mechanism uses the transaction hash of the previous transaction, the transaction hash, the sender’s public key and the transaction count number to validate the transaction. The transaction fee is deducted from the sender’s blockchain coin balance (see “gas” below) and the transaction instruction is actioned. 

At this point, the transaction will be confirmed and allocated to a block within the blockchain. Additional data is added as part of the confirmation as follows: 

  • The block number. 
  • The timestamp of the confirmed block. 
  • The position in the block the transaction was processed. 
  • Additional transaction fee information. 

Consensus mechanism 

Every node is tasked with validating transactions and supporting the security of the blockchain through a defined consensus mechanism. Through this consensus, a trustless environment is created, meaning that there is no need for the transacting parties to trust a third party (such as a bank) to intervene and to validate the transaction. This trustlessness allows transactions to occur directly, in a peer-to-peer mechanism. Removing this “trusted” counterparty can vary in importance depending on what the blockchain is tasked to do. As a result, a variety of consensus mechanisms exist. 

Proof of Work (PoW) 

The original consensus mechanism known as Proof of Work (PoW) is used on the Bitcoin blockchain and others such as Litecoin and until recently Ethereum.  

Proof of Work incentivises nodes on the network to race each other to solve a cryptographic problem. The first node to solve the problem creates the block and receives a reward. The difficulty of the cryptographic problem is controlled autonomously by the blockchain application. Periodically the application checks how long blocks are taking to be created: too quickly and it will implement a “difficulty bomb,” increasing the complexity of the cryptographic problem to lengthen the time taken to create each new block (and vice versa when block times are increasing too much). 

The amount of computing power (often referred to as hash power) used to solve the cryptographic problem is a demonstration of network strength and adoption as more work is being used to solve the cryptographic problem to obtain the reward. 

Proof of Stake (PoS) 

An alternative to PoW is Proof of Stake (PoS). PoS is popular with large public blockchains such as Cardano and Polkadot and more recently Ethereum as it moved away from PoW consensus. 

Proof of Stake requires nodes to obtain and stake a significant amount of the blockchain’s native coin for the opportunity to create new blocks and support the blockchain consensus. A node that creates a new block receives the blockchain’s coin as a reward. 

The number of nodes actively supporting the network consensus is a sign of network strength and adoption as more entities are aligning their self-interest to the blockchain’s success by staking more of the blockchain’s native coin. 

Other Consensus Mechanisms 

Here are several other consensus mechanisms that are used in public and enterprise level blockchains: 

  • Delegated Proof of Stake (DPoS) 
  • Proof of Authority (PoA) 
  • Proof of History (PoH) 
  • Proof of Elapsed Time (PoET). 

Coins 

The first blockchains (such as Bitcoin) were created purely for the transfer of cryptocurrencies, a type of digital coin that operated and was accepted only on that network.  

The coin for the Bitcoin network was Bitcoin (BTC). For the Ethereum network, it was Ether (ETH). 

These coins became known as cryptocurrencies, and, for a few years, the coin was more in the public eye than the network behind it. Starting with the Ethereum network, however, blockchain networks became capable of supporting other tokenised assets, through the use of smart contracts. 

The key takeaway, though, is that although coins are used by the networks in performing their activities, they are no longer the only purpose of transactions in many (or even most) cases. 

Gas 

For a transaction to be committed to the blockchain a transaction fee (often know as gas) must be paid to the node that validates the transaction. In the vast majority of blockchains this fee is paid using the blockchain’s own native coin. 

The size of the fee is determined by a number of factors, such as the computing power needed by the node to action the instruction. 

Mining 

Some blockchain networks also choose to incentivise nodes to participate in transaction validation and block creation by rewarding them for their effort and commitment to the orderly running of the blockchain. This is done through the blockchain issuing its native coin as a reward. 

When a node creates a block, the consensus mechanism rewards the node with coins. The value of these coins in part comes from speculation of the future growth of the blockchain but it is also a way of putting a value on the blockchain’s transaction activity. 

«