Basics of Blockchain-With the rise of Bitcoin, corporate interest in the underlying blockchain technology has risen dramatically. Confusion arises, however, because much of the discussion centers on cryptocurrency, which is only one approach to using blockchain. To determine an approach that makes sense for the IoT, developers must first strip blockchain to its basics and build from there.
Blockchain technology, essentially, provides a mechanism for a network of nodes to securely exchange information (called transactions) and mutually create a shared ledger documenting those transactions in a record that resists alteration. The basic process is simple, as shown in Figure 1 below. A node securely informs all the others of a transaction, which they validate and add to their list of pending transactions. At some point a “publishing node” creates a data block containing none, some, or all the pending transactions, which it presents to the network. When the nodes reach a consensus that the proposed block is valid they add it to their copy of the shared ledger and remove the corresponding transactions from their pending list.
Each new block contains cryptographic links to the prior block added to the ledger, which in turn has links to its predecessor, continuing in an unbroken chain back to the first (genesis) block. The cryptographic links ensure that no block in the chain can be altered without detection, and the ledger’s many copies ensure there is no single point of failure that can destroy the ledger. Other mechanisms in blockchain’s technology ensure that all transactions get recorded, and that blocks linked to an incorrect copy of the ledger get rejected so that all functional copies of the ledger are identical.
Figure 1 The essential operation of a blockchain is simple, but with many options available at each stage.
While the overall operation of a blockchain implementation seems straightforward, there are many operational questions that must be resolved. How does a node join the network? What is the content of a transaction? How is it validated? Which nodes can publish a block? How often? What is its content? How do nodes reach a consensus on a block’s validity? What happens if there are several different blocks simultaneously awaiting validation? The blockchain developer’s answers to these questions will dictate their implementation’s operational effectiveness in its intended application. There are many options available for answering these questions; Bitcoin is simply one configuration of options developed for a cryptocurrency application and not even the only cryptocurrency blockchain.
One place to start in defining a blockchain implementation for a specific application is to answer the question of how a node joins the network. There are essentially two types of blockchain network: permissionless and permissioned. A permissionless blockchain, also called a public blockchain, places no restrictions on what nodes can join the network and all nodes can participate in validation and consensus efforts. This results in a highly decentralized and redundant configuration. Bitcoin is a permissionless blockchain network.