How Blockchain Works? 

Blockchain is a complex concept, consisting of a blend of different technologies, each one a foundational pillar in making blockchain the revolutionary offering that it is. In this chapter of the Lisk Academy we will explore these technical aspects individually and detail why they are so important.

We will examine how blockchain works and explain in simple terms what each aspect of the technology contributes to the larger picture. The technical aspects we dissect will be:

Some of these technologies are already ingrained in our day to day life, if you use Whatsapp for example you are sending messages encrypted through cryptography on a daily basis. Some are less commonly used like P2P networks, whereas consensus protocol are specialised to blockchain.

Each aspect of the technology plays a pivotal role in not only allowing blockchain to carry out its functions, in a secure and dependable way, but also in supporting and sustaining the network.

This chapter of the Lisk Academy is designed to help develop a more technical understanding of the technologies that make up blockchain.

Peer to Peer Network

A Peer to Peer (abbreviated to P2P) network is a very important part of how blockchain technology works, and why it is so solid and secure. Here we will explore what is P2P and why it is such a vast improvement on the centralized systems we are familiar with today.

In a P2P network, the user utilizes and provides the foundation of the network at the same time, although providing the resources is entirely voluntary. Each peer (a “peer” being a computer system on the network) is considered equal and are commonly referred to as nodes. A peer makes a portion of computing resources such as disk storage, processing power or network bandwidth, directly available to other participants without the need for any central coordination by servers or stable hosts.

Despite all nodes being equal, they can take on different roles within the blockchain ecosystem, such as that of a miner or a “full node”. In the case of a full node, the whole blockchain is copied onto a single device, while the device is connected to the network. What this means is that the information stored on a blockchain cannot be lost or destroyed because to do so would mean having to destroy every single full node on the network. Therefore, as long as a single node with a copy of a blockchain exists, all the records will remain intact, providing the possibility to rebuild that network.

Peer to Peer networks completely differ from the traditional client-server models that are common today as there is no central point of storage, such as a server. Instead, information is being constantly recorded and interchanged between all of the participants on the network. This is also different to a centralized server model that slows down when more users join it, as a P2P network can actually improve its power with more devices or nodes joining the network.

This method of transferring information is a huge improvement because data is not held in one centralized point, making it far less vulnerable to being hacked, exploited or lost.

No central point of storage means there is no need for a dominant authority and therefore no single party can control and use the network to push its own agenda. Instead, the user becomes the true owner of their personal data, as long as they secure it properly. This is a bold step away from the centralized systems of today, wherein a social network becomes the owner of all the data that the user uploads or a company that provides payment systems deciding when you can access your own funds, reserving the right to freeze your money whenever they see fit.

The emergence of the P2P network and the central role it plays within blockchain technology could be seen as welcoming a new system of communication. With blockchain trust in all powerful third parties is no longer need as users can rather deal directly with one another across a secure and distributed and decentralized network.

Despite the participation of each peer on the network being open to viewing, all information and identities of participants are entirely concealed on a blockchain through highly complex, state of the art crytography.

Cryptography

A lot of people use cryptography on a daily basis without realizing it as many popular messaging apps use encryption. It is also one of the core aspects of blockchain technology. In this segment of the Lisk Academy we will provide a simple yet detailed explanation of cryptography, both symmetric and asymmetric key cryptography. 

Cryptography is the method of disguising and revealing, otherwise known as encrypting and decrypting, information through complex mathematics. This means that the information can only be viewed by the intended recipients and nobody else. The method involves taking unencrypted data, such as a piece of text, and encrypting it using a mathematical algorithm, known as a cipher. This produces a ciphertext, a piece of information that is completely useless and nonsensical until it is decrypted. This method of encryption is known as symmetric-key cryptography.

An early example of cryptography was the Caesar cipher, used by Julius Caesar to protect Roman military secrets. Each letter in a messages was substituted with the letter 3 spaces to the left in the alphabet, this knowledge was essentially the key that encrypted the message. Caesar’s generals knew that to decode the letters they only had to shift each to the right by three, whilst the information remained safe if intercepted by Caesar’s enemies. Modern cryptography works on the same level, albeit with far greater levels of complexity.

The code base for most ciphers are open source projects, meaning their code can be examined by anyone. The most widely used cipher in the world called is AES, is free for anyone to use and its code is open to viewing by the public. As a result, it has been studied in considerable detail and to date no vulnerabilities have been discovered. This cipher is also used by the NSA, the United States intelligence agency, as the tool of choice for encrypting information. Therefore, the security of information recorded on a blockchain can be regarded to be as secure as some of the most sensitive secrets in the world.

Blockchain technology utilizes crytography as a means of protecting the identities of users, ensuring transactions are done safely and securing all information and storages of value. Therefore, anyone using blockchain can have complete confidence that once something is recorded on a blockchain, it is done so legitimately and in a manner that preserves security.

Despite being founded upon a similar framework, the type of cryptography used in blockchain, namely public-key cryptography, is considerably better suited to the functions associated with the technology than symmetric-key cryptography.

What is Public-Key Cryptography?

Public-key cryptography, also known as asymmetric cryptography, represents an improvement on standard symmetric-key cryptography as it allows information to be transferred through a public key that can be shared with anyone.

Rather than using a single key for encryption and decryption, as is the case with symmetric key cryptography, separate keys (a public key and a private key) are used. 

A combination of a users public key and private encrypt the information, whereas the recipients private key and sender’s public key decrypt it. It is impossible to work out what the private key is based on the public key. Therefore, a user can send their public key to anyone without worrying that someone will gain access to their private key. The sender can encrypt files that they can be sure will only be decrypted by the intended party.

Furthermore, through public-key cryptography a digital signature is produced, securing the integrity of the data that is being shown. This is done by combining a user’s’ private key with the data that they wish to sign, through a mathematical algorithm.

Since the actual data itself is part of the digital signature, the network will not recognize it as valid if any part of it is tampered with. Editing even the slightest aspect of the data reshapes the whole signature, making it false and obsolete. Through this, blockchain technology is capable of guaranteeing that any data being recorded onto it is true, accurate and untampered with. Digital signatures are what give the data recorded on a blockchain its immutability.

Digital Signatures

In some ways, digital signatures do what their names suggest: they provide validation and authentication in the same way signatures do, in digital form. In this segment we will discuss how they work as well as how multisignatures (multisigs) can be used to add an extra layer of security.

Digital signatures are one of the main aspects of ensuring the security and integrity of the data that is recorded onto a blockchain. They are a standard part of most blockchain protocols, mainly used for securing transactions and blocks of transactions, transfers of sensitive information, software distribution, contract management and any other cases where detecting and preventing any external tampering is important. Digital signatures utilize asymmetric crytography, meaning that information can be shared with anyone, through the use of a public key.

Digital signatures provide three key advantages of storing and transferring information on a blockchain. First of all, they guarantee integrity. Theoretically, encrypted data that is being sent can be altered without being seen by a hacker. However, if this does happen the signature would change too, thus becoming invalid. Therefore digitally signed data is not only safe from being seen but will also reveal if it has been tampered with, cementing its incorruptibility.

Digital signatures not only secure data but also the identity of the individual sending it. Ownership of a digital signature is always bound to a certain user and as such, one can be sure that they are communicating with whom they intend to.

For example, even the most proficient hacker could not fake another’s digital signature as a means of convincing someone else to send money, it is simply mathematically not within the realms of possibility. Therefore digital signatures not only guarantee the data that is being communicated, but also the identity of the individual communicating it.

Finally, the fact that private keys are linked to individual users gives digital signatures a quality of non-repudiation. This means that if something is digitally signed by a user, it can be legally binding and entirely associated with that individual. As indicated earlier, this is heavily dependent on there being no doubt that the private key that signed the data was not compromised, used or seen by anyone other than its owner.

Digital signatures are unique to the signer and are created by utilising three algorithms:

  • A key generation algorithm, providing a private and public key.
  • A signing algorithm that combines data and private key to make a signature.
  • An algorithm that verifies signatures and determines whether the message is authentic or not based on the message, the public key and signature.

The key features of these algorithms are:

  • Making it absolutely impossible to work out the private key based on the public key or data that it has encrypted.
  • Ensuring the authenticity of a signature based on the message and the private key, verified through the public key.

Multisignature

Multisignature, sometimes shortened to multisig, is a digital signature scheme with the requirement of more than one signee to approve a transaction. A joint signature is always more compact than a collection of individual digital signatures.

Multisigs are used by many cryptocurrencies, including Bitcoin and Lisk, as a means of improving security as well as dividing the ability to make decisions between more than one party. This aspect of sending LSK transactions makes the system considerably safer, both from hackers or anybody who might have somehow gained  access to a Lisk users passphrase

The number of potential signees and required number of signatures is agreed at the beginning, when the address is created. Although this is not the case with Lisk, where you can create a multisig account from your account at any time. 

For example, with multisignature you can create a 2-of-3 escrow service, meaning that in order to approve a transaction two out of three parties are required to be in agreement to do so. A perfect example of where this could be useful is a savings account for a child, wherein both the child and at least one of the parents need to agree how the money is spent. This also leaves the option of any major decision being solely made by the parents, as long as they are both in agreement.

Multisignature can be created in countless combinations (3-of-3 escrow service, 2-of-5 escrow service, etc) and are just as suited to smaller transactions as they are to uses by large companies. An example of this would be a 5-of-9 escrow system created by the board of a large company. In order to validate any large transaction, a majority of the board would have to agree to it.

Digital signatures are a key component in securing data on a blockchain, whereas nodes are the very foundations upon which the network itself is built.

Nodes

A node is a device on a blockchain network, that is in essence the foundation of the technology, allowing it to function and survive.  Nodes are distributed across a widespread network and carry out a variety of tasks. In this segment of the Academy we will examine the qualities of a node on a blockchain network. 

A node can be any active electronic device, including a computer, phone or even a printer, as long as it is connected to the internet and as such has an IP address. The role of a node is to support the network by maintaining a copy of a blockchain and, in some cases, to process transactions. Nodes are often arranged in the structure of trees, known as binary trees. Each crytocurrency has its own nodes, maintaining the transaction records of that particular token.

Nodes are the individual parts of the larger data structure that is a blockchain. As the owners of nodes willingly contribute their computing resources to store and validate transactions they have the chance to collect the transaction fees and earn a reward in the underlying crytocurrency for doing so. This is known as mining or forging.

Processing these transactions can require large amounts of computing and processing power, meaning that the average computer’s capabilities are inadequate. Generally, professional miners tend to invest in extremely powerful computing devices known as CPUs (central processing units) or GPUs (graphics processing units) in order to keep up with the demand for processing power that is required for them to validate transactions and as such earn the rewards that comes with doing so.

Types of Nodes:

Root node – The highest node in a binary tree.
Parent node – A node that has other nodes extending from it.
Child node – A node that extends from a different node.
Leaf node – A node with no children.
Sibling nodes – Nodes connected to the same parent node.
Tree – A data structure of nodes starting with a root node.
Forest – A set of trees of nodes.
Degree – The number of children of the node.
Edge – The connection between nodes.

Running a Lisk Blockchain Node

The requirements to own a node vary between cryptocurrencies and their consensus protocols. For example, Lisk uses a Delegated Proof od Stake consensus protocol which requires stakeholder approval. Therefore, in order to become an owner of a node that is forging, a user must first become a delegate which requires a certain number of LSK tokens supporting them. In the Lisk ecosystem this is done by gaining votes, each LSK token being worth a vote.

In practice, this means either buying Lisk tokens or receiving votes from other users of the network who are holding tokens. Regardless, the delegate must have enough LSK supporting them to break into the top 101 and become a node that can validate transactions and earning Lisk token as a reward.

Hashing

The reliability and integrity of blockchain is rooted in there being no chance of any fraudulent data or transactions, such as a double spend, being accepted or recorded. A cornerstone of the technology as a whole and the key components in maintaining this reliability is hashing.

Hashing is the process of taking an input of any length and turning it into a cryptographic fixed output through a mathematical algorithm (Bitcoin uses SHA-256, for example). Examples of such inputs can include a short piece of information such as a message or a huge cache of varying pieces of information such as a block of transactions or even all of the information contained on the internet.

Hashing drastically increases the security of the data. Anyone who may be trying to decrypt the data by looking at the hash will not be able to work out the length of the encrypted information based on the hash. A cryptographic hash function needs to have several crucial qualities to be considered useful, these include:

Impossible to produce the same hash value for differing inputs: 
This is important because if it were not the case it would be impossible to keep track of the authenticity of inputs.

The same message will always produce the same hash value: 
The importance of this is similar to the prior point.

Quick to produce a hash for any given message:
The system would not be efficient or provide value otherwise.

Impossible to determine input based on hash value: 
This is one of the foremost aspects and qualities of hashing and securing data.

Even the slightest change to an input completely alters the hash: 
This is also a matter of a security. If a slight change only made a slight difference it would be considerably easier to work out what the input was. The better and more complex the hashing algorithm, the larger the impact of changing an input will be on what the output is.

Hashing secures data by providing certainty that it hasn’t been tampered with before being seen by the intended recipient. So, as an example, if you downloaded a file containing sensitive information, you could run it through a hashing algorithm, calculate the hash of that data and compare it to the one shown by whoever sent you the data. If the hashes don’t match, you can be certain that the file was altered before you received it.

Blockchain Hashing

In blockchain, hashes are used to represent the current state of the world, or to be more precise, the state of a blockchain. As such, the input represents everything that has happened on a blockchain, so every single transaction up to that point, combined with the new data that is being added. What this means is that the output is based on, and therefore shaped by, all previous transactions that have occurred on a blockchain.

As mentioned, the slightest change to any part of the input results in a huge change to the output; in this lies the irrefutable security of blockchain technology. Changing any record that has previously happened on a blockchain would change all the hashes, making them false and obsolete. This becomes impossible when the transparent nature of blockchain is taken into account, as these changes would need to be done in plain sight of the whole network.

The first block of a blockchain, known as a genesis block, contains its transactions that, when combined and validated, produce a unique hash. This hash and all the new transactions that are being processed are then used as input to create a brand new hash that is used in the next block in the chain. This means that each block links back to its previous block through its hash, forming a chain back to the genesis block, hence the name blockchain. In this way, transactions can be added securely as long as the nodes on the network are in consensus on what the hash should be.

An Explanation of Data Structures

Data structures are a specialized way of storing data. The two foremost hashing objects carrying out this function are pointers and linked lists. Pointers store addresses as variables and as such point to the locations of other variables. Linked lists are a sequence of blocks connected to one another through pointers. As such, the variable in each pointer is the address of the next node, with the last node having no pointer and the pointer in the first block, the genesis block, actually lying outside of the block itself. At its simplest, a blockchain is simply a linked list of recorded transactions pointing back to one another through hash pointers.

Hash pointers are where blockchain sets itself apart in terms of certainty as pointers not only contain the address of the previous block, but also the hash data of that block too. As described earlier, this is the foundation of the secure nature of blockchain. For example, if a hacker wanted to attack the ninth block in a chain and change its data, he would have to alter the data in all following blocks, as their hash would also change. In essence, this makes it impossible to alter any data that is recorded on a blockchain.

What are Merkle Trees?

A merkle tree, otherwise called a hash tree, is a data structure of hashes used to record data onto a blockchain in a secure and efficient manner. The concept was patented by Ralph Merkle in 1979.

The system works by running a block of transactions through an algorithm to generate a hash as a means of verifying the validity of that data based on the original transactions. An entire block of transactions is not run through a hash function at once, but rather each transaction is hashed, with those transactions being linked and hashed together. Eventually, this creates one hash for the entire block.

When visualized, the structure resembles that of a tree, albeit in a simplified manner as each block will normally contain hundreds, if not thousands, of transactions. Hashes on the bottom row are known as ‘leaves’, while middle hashes are referred to as ‘branches’ with the hash at the top being the ‘root’.

Merkle trees are especially useful as they allow anyone to confirm the validity of an individual transaction without having to download a whole blockchain. For instance, as long as you have the root hash (12345678), you can easily confirm transaction (8) by accounting for the hashes (7), (56) and (1234). As long as they are all there on a blockchain, transaction (8) is surely there and as such accounted for and as a result true, and meant to be there.

The Hash of the merkle root is normally contained in a block header along with:

  • Hash of the previous block
  • Timestamp
  • Nonce
  • The block version number
  • The current difficulty target

Merkle trees and hashes are a key component in allowing blockchain technology to function whilst providing security, integrity and irrefutability and, alongside consensus protocols, are arguably the most important aspects of blockchain technology.

Consensus Protocols

These protocols create an irrefutable system of agreement between various devices across a distributed network, whilst preventing exploitation of the system. Here we will explore how these systems work and how various protocols differ from one another.

Blockchain consensus protocols are what keep all the nodes on a network synchronized with each other, while providing an answer to the question: how do we all make sure that we agree on what the truth is?

After all, anyone can submit information to be stored onto a blockchain and therefore it is important that there is review and confirmation, in the form of a consensus about whether to add that information.

As a term, ‘consensus’ means that the nodes on the network agree on the same state of a blockchain, in a sense making it a self-auditing ecosystem. This is an absolutely crucial aspect of the technology, carrying out two key functions. Firstly, consensus protocols allow a blockchain to be updated, while ensuring that every block in the chain is true as well as keeping participants incentivized. Secondly, it prevents any single entity from controlling or derailing the whole blockchain system. The aim of consensus rules is to guarantee a single chain is used and followed.

Consensus Protocol Rules

Consensus rules are a specific set of rules that nodes on the network will ensure a block follows when validating that block and the transactions within it. The key requirement to achieve a consensus is a unanimous acceptance between nodes on the network for a single data value, even in the event of some of the nodes failing or being unreliable in any way.

Every crytocurrency must have a way of securing its blockchain against attacks. For example, an attacker may attempt to spend some money and then reverse the transaction by broadcasting their own version of that blockchain, not including the transaction. This is known as a double spend. As blockchain technology does not rely on a central authority for security, users have no prior knowledge which version of the record is valid.

Consensus protocols also provide participants on the network who are maintaining a blockchain with rewards and incentives to continue doing so.  These rewards come in the form of cryptocurrencies or tokens, which can be extremely lucrative, so much so that competition to confirm the next block in a chain is extremely fierce.

Consensus protocols are designed to be difficult to imitate or replicate by being extremely costly to carry out, in terms of time, the computing resources required or the holdings of a particular cryptocurrency. The methods of consensus vary depending on the blockchain within which they are validating the blocks and there exist a variety of forms of consensus, with a consistent ongoing debate as to what is the most effective and efficient method.

Consensus protocols are a key aspect in allowing a blockchain to function and exist. After all, as at its core a blockchain is a ledger of information it is paramount that there is absolute certainty that the information that is being stored is honest and accurate.

Byzantine Fault Tolerance

Achieving Byzantine Fault Tolerance is one of the most difficult challenges addressed by blockchain technology. Byzantine Fault Tolerance means that two nodes can communicate safely across a network, knowing that they are displaying the same data. In this part of the Lisk Academy we will examine why this is so challenging, yet important, and how it is achieved.

The “Byzantine Generals’ Problem” states that no two computers on a decentralized network can entirely and irrefutably guarantee that they are displaying the same data. Assuming the network is unreliable, they can never be sure that the data that they communicated has arrived. At its core, the Byzantine Generals’ Problem is achieving a consensus across a distributed network of devices, some of which could be potentially faulty, while also being weary of any attackers attempting to undermine the network.

In a P2P network, a consensus is achieved if the loyal, or non-faulty nodes, achieve a unanimous agreement on their decision. Byzantine Fault Tolerance means an incoming message is repeated to other recipients of that incoming message. All of the nodes make the assumption that the act of repeating a message rules out the issue of Byzantine nodes.

A Byzantine node can lie, and intentionally mislead other nodes involved in the consesus protocol. As such, the protocol has to be able to operate correctly and reach consensus despite any illicit intervention from Byzantine nodes. This is perfectly plausible as long as the number of Byzantine nodes within a distributed system is limited.

The Byzantine Generals’ Problem is rarely the first problem people imagine that blockchain technology faced. However, safe and reliable communication between nodes is a considerable problem and an incredible achievement that it has been resolved, allowing for consensus to be reached effectively between the nodes on the network.

The idea stems from a story about a group of Byzantine generals surrounding a city which they intended to conquer. However, in order to successfully do so they had to attack all at once and in synchrony. As a means of coordinating their attack they could only communicate through messengers, delivering orders on foot.

There are several problems faced in this scenario. Any of the messengers could be captured and a message would not be delivered and because of that a synchronized attack would be impossible. Furthermore, the generals couldn’t be sure if any of the other generals were traitors intending to send false messages as a means of purposely sabotaging the attack.

For example, a dishonest general could tell half of the generals that the plan is to retreat, ensuring that they do so, whilst telling the other half to attack, dooming them to failure. Byzantine Fault Tolerance is a way of overcoming this challenging situation.

This story transfers and applies to nodes attempting to agree on the information that they are displaying across a peer to peer network. It was mainly this issue that proved the greatest stumbling block in creating a digital currency in the past and as such is arguably crowning achievement of Bitcoin founder and forefather of blockchain technology, Satoshi Nakamoto.

There are different approaches taken by different consensus protocols in order to arrive at a secure and efficient consensus, whilst negating the Byzantine General’s Problem, an example being the Proof of Stake protocol.

Proof of Stake

Proof of Stake is one of the commonly used consensus protocols within blockchain technology. In this part of the Academy we will examine exactly what a stake is and how the algorithm successfully achieves consensus between nodes.

Proof of stake is the consensus algorithm used by cryptocurrencies to validate blocks. The system was initially suggested in 2011 and the first cryptocurrency to implement it was Peercoin in 2012. The main advantages of proof of stake are energy efficiency and security.

In a proof of stake system, the creator of the next block is determined by a randomized system that is, in part, dictated by how much of that crytocurrency a user is holding or, in some cases, how long they have been holding that particular currency. Instead of computational power, as is the case in proof of work, the probability of creating a block and receiving the associated rewards is proportional to a user’s holding of the underlining token or cryptocurrency on the network.

The randomization in a proof of stake system prevents centralization, otherwise the richest individual in the system would always be creating the next block and consistently increasing their wealth and as a result their control of the system. The main advantage of proof of stake, over a system such as proof of work, is that it uses considerably less energy and as a result is more cost effective. It is well documented that each Bitcoin transaction, which uses a proof of work system, can require as much electricity as an average Dutch household does in two weeks. This is both ineffective and unsustainable.

In that regard proof of stake can be regarded as a superior consensus protocol as it requires far less electricity to run. Furthermore, as the proof of stake system is so much more cost effective there is less of a need to release too many new coins as a means of incentivizing miners to maintain the network. This helps to keep the price of a particular coin more stable.

Proof of stake protocol is effective in not only encouraging individuals to partake in the system but also preventing any individual from controlling the network. In order to carry out a 51% attack an individual or group would need to own the majority of coins on the  network.

Firstly, it would be extremely expensive to acquire enough coins to get anywhere near doing so since many individuals would likely exit the currency if a single party began buying everything, while others would ramp up the price to discourage a hostile takeover. Furthermore, it would be completely counterproductive to attack the network as it would vastly decrease the value of the coins that the attacker is holding. Essentially, the users with the highest stake in a crytocurrency have the most interest maintaining and securing the network because any attacks would diminish the reputation and price of the cryptocurrency that they hold.

However, proof of stake does have its downsides, one of them being a “nothing at stake” problem. The issue occurs in the event of a consensus failure when block-generators have nothing to lose by supporting varying blockchain histories, preventing the conflict from resolving.

Overall, the proof of stake consensus protocol is a robust system that effectively and efficiently fulfills its intended purpose. However, this has not stopped companies from modifying and improving the protocol, an example of this being Delegated Proof of Stake, otherwise known as DPoS.

Delegated Proof of Stake

Delegated Proof of Stake (otherwise known as DPoS) is a consensus algorithm maintaining irrefutable agreement on the truth across the network, validating transactions and acting as a form of digital democracy. It is the protocol of choice at Lisk and with very good reason.

Delegated proof of stake uses real-time voting combined with a social system of reputation to achieve consensus It can be seen to be the least centralized consensus protocol compared to all others as it is the most inclusive. Every token holder can exercise a degree of influence about what happens on the network.

Active delegates are voted into their roles by token holders. The voting power that the token holder has, otherwise known as voting weight, is determined by how many of the base token the account is holding. It is important that the delegates are chosen with the best interest of the network at heart as they keep the network running smoothly and safely. In some DPoS versions, a delegate needs to show commitment by depositing his funds into a time-locked security account (which is confiscated in case of malicious behavior). This version of DPoS is often referred to as deposit-based proof of stake.

Delegates do not have the power to change any transaction details. However, as they are validators they could theoretically exclude certain transactions in a block. Nevertheless, this has very little effect as the next created block will include these transactions, giving the next delegate the fees associated with validating them. As such, the transactions will only be slightly delayed. Furthermore, this would inevitably lead to the dishonest delegate getting voted out by the rest of the network. In essence, a DPoS network is self-governed and policed by all of its participants ensuring the best interests of the network remain the priority.

Advantages of DPoS

Not only is DPoS a more democratic system, it is also more efficient and effective. The selection of block producers allows for the transactions to be validated in a matter of seconds, rather than the 10 minutes it takes the proof of work system employed by Bitcoin. For example, in the case of Lisk it currently only takes 10 seconds to validate a block of transactions.

Delegates are incentivized to run the nodes that process and validate the transactions going through the network with transaction fees, as well as monthly rewards for maintaining the network that, with time, are gradually reduced. There can only be a certain number of delegates at any one time (101 for Lisk) and those are determined by a competitive election system, wherein each and every Lisk holder can cast a vote for their preference to fill that role.

Whereas in a proof of work system, such as the one employed by Bitcoin, validating blocks is known as “mining”, in the case of delegated proof of stake this process is referred to as “forging”.

Proof of Work

Creating the proof of work protocol for achieving consensus between devices on a distributed network is arguably the crowning achievement of Bitcoin founder Satoshi Nakamoto. In doing so, he laid the groundwork for the revolutionary technology that is blockchain.

Proof of work (abbreviated to PoW) is a consensus protocol introduced by Bitcoin and used widely by many other cryptocurrencies. This process is known as mining and as such the nodes on the network are known as “miners”. The “proof of work” comes in the form of an answer to a mathematical problem, one that requires considerable work to arrive at, but is easily verified to be correct once the answer has been reached.

The only way to solve these mathematical riddles is through nodes on the network, running a long and random process of presenting answers on a trial and error basis. Technically, this means that the problem could be solved on first attempt, although this is extremely unlikely, to the point where it is practically impossible. The answer needs to be a lower number than the hash of the block for it to be accepted, known as the ‘target hash’.

A target hash is a number that the header of a hashed block must be equal to or less than for a new block, along with the reward, to be awarded to a miner. The lower a target is, the more difficult it is to generate a block. A miner continues testing different unique values (known as nonces) until a suitable one is produced. The miner who manages to solve the riddle mines the next block, adding it to the chain and validating the transactions within it, and receiving the reward associated with the block.

The process involves ensuring every confirmed block in the chain rewards the miner in the cryptocurrency that they are mining through the transaction fees collected for sending currency across the network, as well as any predetermined reward. It ensures that miners are incentivized to continue maintaining a blockchain, as they are being rewarded for doing so.

These rewards are especially important due to the complexity of the riddles that are being solved since the process is extremely costly, both in the terms of time taken and the computing power required to do so. Keeping these miners incentivized is a key function of a protocol as they are in a sense the foundation that keep the system running. Systems such as proof of work are employed so transactions cannot be counterfeited, as the data required to do so is extremely difficult to produce, yet easily verified.

Different forms of mining explained

CPU Mining – Using a normal computer’s CPU to validate transactions in a proof of work consensus protocol.
GPU Mining – This is not dissimilar to CPU mining, however in this case a graphics card is used. Graphics cards are more powerful whilst relatively using less electricity.
FPGA Mining – Otherwise known as “Field-Programmable Gate Array mining”. An FPGA is a circuit tailored for a specific computing task, making them several times faster at mining than normal processors.
ASIC Mining – Is an “Application-specific integrated circuit”, a circuit customised for a particular use. ASICs easily outperform CPUs, GPUs and FPGAs in both speed and efficiency, they are generally only really used for Bitcoin mining.
Mining Pools – To increase the likelihood of successfully mining a block miners pool together their resources, sharing any potential rewards dependent on how much each miner contributed.
Cloud Mining – Some miners rent out their processing power to other miners for a allotted period of time.

The proof of work system is specifically designed to be difficult and require considerable computing power to ensure that too many Bitcoins are not mined too quickly, preserving a consistent supply and incentive for miners to maintain the network. Essentially, the security of the network is enforced physically by specialized hardware. As such, proof of work can be seen as not being an infinitely scalable protocol since the hardware and the electricity spent to power that hardware are limited in resources.

In regards to the issue of Byzantine Fault Tolerance, the proof of work protocol deals with the problem of Byzantine nodes through nonces and combining messages into blocks. Each block has its own distinct nonce. They are only used once in order to add another element of difficulty in generating valid hashes, specifically to prevent precomputation and ensure fairness. Despite having some merits, proof of work is regarded as a flawed consensus protocol, especially when considering how much energy is consumed in running the protocol. For instance, it has been reported that a single Bitcoin transaction, using proof of work, can consume as much electricity as an average Dutch household does in two weeks.

As a result, there has been a shift to more progressive consensus protocols such as the Delegated Proof of Stake consensus protocol that is currently used by Lisk.