The Double-Spend That Never Was

On Thursday, January 21, 2021, news outlets began circulating reports of a Bitcoin double spend flaw which led to an 11% drop in the price of the digital asset. This would have been a major exposure of a flaw in the blockchain … except it never was. In fact, what happened or reportedly occurred would be a part of how Bitcoin is supposed to work. It is hard to explain the full details unless you get technical, but let us try to explain it in simpler terms.

First, what is a “double spend“? This was the problem Bitcoin’s creator Satoshi Nakamoto was able to solve for digital currency. Prior to that, it was a problem in computerized electronic payment systems that other developers had proposed solutions for. Since computers are digital, when currency is created it can be easily copied just like a file made in Excel or Word. If you have a file that represents your money in a computer, without any means of control a user can create infinite copies and spend it all they want. It is possible to use the same digital money to purchase two different items, so long as there is no system checking for it.

Nakamoto solves the problem by implementing a blockchain to support provenance and verification. That means that the amount of currency like Bitcoin (BTC) that a user holds, is determined by a mechanism that is verified through a consensus or agreement. In this case it is called Proof-of-Work (PoW) on the Bitcoin blockchain. You have nodes (computers) called miners that run software which run algorithms to try and solve a complex puzzle to discover a block for validation. The block contains transactions that are verified based on cryptographic hashes that can be traced back to what is called a genesis block. If it can be verified, then it is added to the blockchain.

Before a block is added, there is a competition among the miners to try and discover a number called the nonce. This is what is needed in order to validate a block. The miner who discovers it first will become the block validator and will receive a reward in return for their effort. The miners also collect fees for helping to validate transactions on the network. No transaction is ever allowed to pass unless it goes through a consensus among the miners on the network. Double-spends are prevented by the miners through this verification and validation process which also includes confirmations.

Bitmex Research first reported the incident in a tweet of a potential double-spend that occurred in the wild. They were the ones who also pointed out that it was a double-spend, but here is the problem. It was unconfirmed and the researcher who discovered it should have probably waited for what is called a chain reorganization, which is a part of the blockchain’s protocol. It is true that a BTC could appear to be spent two times on different transactions. It must undergo a series of confirmations, usually 6 but it could be more (depends on network activity). This was mentioned by Satoshi Nakamoto in the Bitcoin White Paper.

It is possible for two blocks to be mined simultaneously on the blockchain. This creates a temporary anomaly that can be observed by anyone who has access to the mempool of a Bitcoin node. There is a built-in feature in the code that corrects this problem. It is part of a chain reorganization in which the nodes must add the valid block to the longest chain, or the main network. You can see two transactions that appear to have spent the same BTC, but after the chain reorganization and block confirmation it is resolved. Only one of those blocks that contain the transaction will be valid and added to the blockchain. The other block will be orphaned and not validated.

Many cryptocurrency and blockchain experts like Andreas Antonopoulos, Bitfinex CTO Paolo Ardoino, Coin Metrics Bitcoin Network Data Analyst Lucas Nuzzi and later, even Bitmex Research all agree that it was not a double-spend that occurred. There are counter points though, especially from among the Bitcoin SV (BSV) camp who do have some thoughts of their own. What we know for sure is that only one of the transactions has been verified and validated on a block. The user tried to use a feature called Replace-By-Fee (RBF) in which you can speed up a transaction by paying a higher transaction fee which invalidates a previous transaction that was sent out. What happened here was the lower fee somehow made it to valid block first, perhaps because of the timing. The user had waited too long and by the time the higher paying transaction fee was sent the previous one had already been added to a block on the longer chain which validates it first.

Should we be worried that an actual double-spend can occur? It is always good to be alert and aware of what is happening. While the code does what it is supposed to do, there will be bad actors who may try to exploit these types of attacks to see if they can get past the logic. What will be proof or testament to Bitcoin’s legitimacy as a cryptocurrency is how these measures will stand against the test of time. As long as it is working, it will help the network to remain secure and operational. Until the next news, HODL.

Why Coin Burn Is Important In Tokenomics

The coin burn in cryptoeconomics, is a mechanism that reduces the total supply of tokens or coins. It forms a part of the tokenomic policies of a cryptocurrency. This is for preventing inflation in the ecosystem as a reasonable means to prevent the over supply of the tokens in circulation. It is much more common among coins or tokens that have a high circulating supply or no fixed supply. The amount of tokens in circulation is generally speaking, the total amount that is available to the public. The supply increases as a result of consensus activity that mints or mines more coins or generates new tokens.

There are 3 main reasons for a coin burn.

  1. Minimizing inflation

The traditional non crypto-economic model allows centralized monetary authorities to regulate and control the supply of money. They can increase the money supply during times of low liquidity in order to boost the market. However, more money leads to inflation and that can affect the cost of goods and services as prices increase. More supply leads to more spending power, and thus that increases demand for public consumption. As a result, prices go up.

We have what is called the inflation rate that determines the price or value of any commodity or asset in the market. The problem with inflation is that it leads to ever increasing prices as simplified in this formula:

V = Inflated Value Of Asset
a = Current Value of Asset

r = Annual Rate of Inflation

t = Time period

V = a(1 + r) t

Thus an asset’s value increases over time as a result of a positive (+) inflation rate, which means its value was not determined by market forces but by a central authority. Interest rates tend to rise with inflation. It is a way the central bank encourages people to  increase savings. Now this is a truly centralized approach that becomes a balancing act for the economy. Cryptocurreny will try not to have an inflationary model which is the primary purpose of the coin burn. With this model it gives more value for the holder and prices never drastically increase due to a central authority. Instead it follows a decentralized and market driven approach to keep the supply in check.
 

  1. Fair token distribution

The fairness in token distribution is that the platform does not keep more supply than what should be sustainable for the ecosystem. The community is given the right to vote for a coin burn when it is announced on network during the process of digital governance. This allows token holders to decide whether it is in their community’s best interest. This uses a form of governance token that allow holders to cast their vote. Majority consensus will always win in the ecosystem.

The system can be effective in maintaining the price and rewarding loyal token holders. Thus the distribution of tokens is not manipulated by a single authority that decides over the rest of the token holders. When the decision goes to a vote, it benefits the greater community.

  1. Incentive to holders

The coin burn incentivizes token holders by increasing its value. Let’s say we have the following scenario of a digital asset Y:

Total Supply = 100,000,000
Circulating Supply = 100,000,000

Market Cap = 1,000,000
Price of Y = 0.01

Assuming a user has 10,000 coins, they are valued at 10,000(0.010) = 100.

A coin burn takes place to reduce the circulating supply by 40,000,000.

Total Supply = 100,000,000
Circulating Supply = 60,000,000

Market Cap = 1,000,000
Price of Y = 0.0167

It cuts the circulating supply by 40%. This then changes the price of Y. Assuming a user has 10,000 coins, they are now valued at 10,000(0.0167) = 166.67. This is what creates what is called digital scarcity so that the value increases over time. The value this creates rewards the community for holding the tokens and encourages their participation.

Some networks have to do a balancing act on their token supply if they consider a coin burn. Tron (TRX) has issued their coin burn on what they call Independence Day. The project burned 1 billion TRX after switching over from the Ethereum mainnet to their own mainnet. This also burned the ERC20 tokens that were issued during Tron’s ICO. This was meant to control inflation of the TRX token itself, but increases its value in terms of fiat. Other projects that mint tokens back into circulating supply will have to coordinate coin burns to check their inflation (i.e. anti-inflationary measures). Overall, it should be consensus driven by the community and cannot be decided by the developers or majority token holders alone.

The DAG Network Model Architecture In Distributed Ledgers

Not all cryptocurrency or digital currency are based on Bitcoin. In fact, some of them don’t even use a blockchain. They are graph-based networks (e.g. DAG, Hashgraph) which arrive at consensus much differently. The notion of a blockchain has become the most synonymous with cryptocurrency, but that is not applicable to all. IoTA, Hedera, Nano and Byteball are examples of graph-based networks. The most common type used is a DAG (Directed Acyclic Graph), which is more scalable network solution than blockchain based distributed systems. A DAG is not a blockchain but both use decentralized cryptographic databases in a sense that a Ferrari is not a lamborghini but are both cars.

A blockchain connects blocks by hashes which can be traced back to a primordial block or “Genesis Block” which is the root of all hashes. It uses a tree topology of nodes called a Merkle Tree, which has leaf nodes that contain the cryptographic hash from child nodes. When these hashes are concatenated, they can be traced back to the Genesis Block in the network. Blockchains use a consensus mechanism to validate the blocks, with PoW (Proof-of-Work) being one example that is used on the Bitcoin network. Consensus is what secures the network by way of validating a block and adding it to the blockchain where it becomes immutable so it is no longer subject to change. This prevents tampering and data manipulation. The consensus requires nodes called miners who must compete with one another by solving a cryptographic puzzle using a probabilistic zero-sum game approach. The miner who solves the puzzle first becomes the block validator and is rewarded with Bitcoin (BTC) for their contribution.

A DAG is a finite graph which is directed forward in one direction with a topological ordering. It consists of vertices that lead to other vertices, which are paths called edges. The vertices are like points in a network. The system uses an “Efficient Teacher Grading” method instead of miners doing PoW. A DAG uses peers to help validate transactions in the network. When a new transaction is made, a new vertice representing the transaction is created and must be validated by other peers on the network. It doesn’t require solving a puzzle, but relies on confirmations as the consensus using a gossip protocol mechanism. When other peers on the network can confirm the transaction as correct, it will be validated.

A DAG network is much faster than PoW since it doesn’t rely on compute intensive puzzles. This allows it to run on lighter devices in contrast to PoW systems that rely on power hungry ASIC devices that perform large numbers of calculations to solve the puzzle. This is rather inefficient, so it requires more energy to produce coins or tokens. A DAG is much faster and scalable since it doesn’t require the same overhead as a blockchain network when it comes to consensus. Costs are lower too because there is no need to purchase expensive equipment that use plenty of electricity. A DAG can utilize mobile devices like smartphones to help confirm transactions on their network. This also makes DAG more suitable for micro-transactions which require instant validation of transactions. DAG offer less barriers to entry because practically anyone can become a peer using their low-energy consuming smartphones while PoW requires more investment in hardware that require a consistent supply of electricity to operate.

Scalability has been the main reason for DAG over blockchains. A blockchain like Bitcoin has scaling issues because of the consensus mechanism it implements and the protocols used on the network. It was not developed for high throughput transactions like the VISA or Mastercard network. VISA claims it can process 1,700 TPS (Transactions Per Second) or 150 million transactions in single business day. Bitcoin’s blockchain can only process between 3 to 7 TPS only. Security has been a consistent strength of the Bitcoin blockchain, as it has never been successfully attacked (e.g. 51% attack) as of this posting since it started in January 3, 2009. DAG have not been in production for that long and have mostly been used on experimental and concept networks. A DAG is mainly used for DLT (Distributed Ledger Technology) implementations while blockchains are used on trustless permissionless public networks.

Nodes, Masternodes and Supernodes

I am going to explain the purpose of nodes in the context of the blockchain and digital governance. Nodes are basically an instance of a device that participates in the consensus on a blockchain. Nodes behave according to protocols that determine the exchange of data and functions that contribute to the operations of the network. The nodes also form the digital governance within a blockchain ecosystem to enable policies and rules that serve the interest of the majority. There are three types of nodes to describe, the basic node, masternode and supernode. These are concepts that feature in Third Generation blockchains which aim to bring more efficiency to maintain its operations.

A blockchain can have its own system of government or governance. This is the concept behind digital governance, in which nodes participate in voting to elect delegates who can then become masternodes or supernodes, which we shall explain. In order for a fair system to exist, it must revolve around a token and protocol which can be built in code for a network. The token is used to count as a vote. When voting for a masternode or supernode, voters (which can be any type of node) who have more tokens that are frozen or held, have more votes that are counted. Therefore those nodes that get the most votes become masternodes or supernodes. Each blockchain has its own type of governance with consensus (e.g. EOS, Tron, NEO, Cardano).

A basic node can be any device that performs a function to help verify transactions and validate blocks. This activity is the consensus feedback mechanism algorithms that secures and validates a blockchain. Nodes can either mine (Proof-of-Work) by contributing raw computing power as their resource or they can stake (Proof-of-Stake) by holding funds which is used to provide a proof of how much validating power they own. When a node mines, they must compete with other nodes to solve a cryptographic puzzle and discover its value called the nonce. This is a compute intensive process that requires massive computations that require hash power measured in hash rate (measured in hashes per second). It expends a lot of energy since the nodes’ compute intensive task consume plenty of electricity. A more efficient method is for nodes to stake. In staking, the node will validate their power on the network by the amount of funds they hold. A node that holds the most funds has the greatest amount of validation power on the network.

Above the node, is the masternode. These are more resource intensive devices that can perform more functions than a typical node. The masternode can be assigned specific tasks that not only participates in consensus, but also involved in network operations. This can be anything from routing to simple payment verification (SPV). Although nodes can perform the same task, it will depend on the network’s protocols and policies. For example, in some networks a node only performs simple tasks like payment processing. The masternodes are then responsible for handling the verification of transactions that are then packaged into blocks for validation.

There is an even more resource intensive device above the masternode, the supernode. The supernode performs the validation of blocks. This requires more computing resources in the network since blocks can contain many transactions, and in volume this will require the most processing power on the network. Supernodes are the like the most powerful servers in the data center. You give them the most work to do and they will be able to handle it. However, in the context of a public blockchain which is trustless and permissionless, there has to be an incentive to do work. Therefore, the supernodes are incentivized by payment in the network’s native token. These are also called rewards, and they are given on many blockchains for their contribution to providing compute resources to the network. Masternodes and nodes are also incentivized for their work, so the ecosystem runs on incentives to process transactions and add them to cryptographically secured blocks.

A hierarchy exists on the network in which supernodes are at the top, followed by masternodes and nodes. While blockchains were designed to be decentralized, there are critics who point to how masternodes and supernodes make the system more centralized. The reason being the issue of scalability. When you concentrate validation of blocks only to a few nodes, it centralizes power. That is actually the purpose for Third Generation blockchains like EOS (which uses dPOS or delegated Proof-of-Stake). A blockchain by design is not inherently scalable, but secure. In order to meet scaling, it must be centralized to a certain extent in order to allow more transactions to be processed (the blockchain trilemma). When you have too many nodes trying to validate a block at the same time, it becomes inefficient when applied to an enterprise type of solution for business. By dedicating certain nodes for validating blocks, it becomes more efficient and faster when processing transactions. This does require supernodes to have a tremendous amount of resources. Becoming a supernode is thus a motivating factor in a blockchain because they collect the most rewards. In blockchains like EOS which call their supernodes as block producers, you need nodes that run in data centers that will be able to process transactions by volume. A simple PC or smartphone will obviously not be allowed to do this because it lacks the computing resources.

Supernodes must still follow the consensus mechanism. In this case, they must stake plenty of funds to prove they have the resources to become a validator. They actually first become a candidate by proving their staked funds. They are the largest holders of the blockchain’s native tokens, so there is a lot they have at stake to become a validator. They can also lose it all if they try to become a bad actor. The protocol could have a consequence which can ban the node and take their staked funds. Once voted as a supernode, that is the only time they can produce blocks on the network to add to the blockchain.

Once there are supernodes on the blockchain, they can begin producing blocks. However, supernodes do not need to compete with each other like in mining to validate a block. They are given a round each for validating blocks. On EOS, there are 21 supernodes or block producers only. Each block producer is given a round for producing 6 blocks with a time of 0.5 sec per block. If we do the math, that is 6.3 minutes per round and a total of 126 blocks produced. The consensus among all producers takes place after a block is produced. They try to maintain a 2/3 rule for validation. It means all it takes is 14 block producers to validate a block following byzantine conditions.

Supernodes have the most at stake, followed by masternodes and then basic nodes. The basic nodes do not have to stake anything if they are just accessing wallets or querying the blockchain. Nodes which do participate, may do so for incentives. Since Supernodes have the most at stake, they also have the most to lose. That is why the protocols encourage incentives so that attacks and spam on the network can be minimized. In a sense, if Supernodes collude they can control the network through a 51% attack. However, if the protocol has built in checks and balances to prevent this, the Supernodes could all be replaced and lose all their staked funds.

Separation of tasks among nodes allows a network to operate more efficiently. Less resource intensive nodes can perform the simplest tasks on the network. More resource intensive tasks require processing power. For a fair system to exist, a token is also used for incentives and digital governance. That provides rewards to nodes for their contribution and participation on the network. It also brings digital democracy to an ecosystem, allowing them to elect the nodes they want to become verifiers and validators on the network. While it is more centralized in nature, it still remains decentralized since there is a digital governance process that is open to all nodes. This limits the power of any node that attempts to control the network. Depending on the protocols and policies of a blockchain, there can be consequences to bad actors who attempt to attack or cheat the network. With this system in place, it encourages honest participation in securing and operating a blockchain.

The Cardano Principles For Scalability, Interoperability and Sustainability

Cardano is a unique cryptocurrency project that is based on sound principles rooted in science and engineering. Its application goes beyond financial systems, but implements a blockchain that covers a wider variety of applications. While it is available as a coin on digital exchanges, it does not yet have an actual use case (as of this posting). It is a development in progress that aims to nail the foundations for a well designed blockchain.

We can consider Cardano a Third Generation Blockchain. The First Generation uses Bitcoin’s Proof-of-Work (PoW) consensus mechanism and the UTXO model. Ethereum forms the basis for the Second Generation, which implements Turing complete Smart Contracts or EDCC (Executable Distributed Code Contracts). The Third Generation, which include other cryptocurrency like EOS and Tron, were based on Ethereum but innovate on consensus mechanisms. Like other Third Gen blockchains, it was also issued using an ICO that raised $62 Million.

Cardano, like Ethereum, uses a smart contract based system. The token or digital asset used on the network is called Ada. Ada provides balances to users with the Daedalus digital wallet. Cardano is also a platform for technological innovation and development. It will provide an operating system layer for DApp (Decentralized Applications) that run on the Cardano network. These DApp provide an interface to smart contracts that execute code to transfer value (e.g. payments, transfers, change of ownership, etc.). Cardano will facilitate these transactions and record it on its own blockchain for immutability and transparency purposes.

Cardano has 3 main features in its blockchain.

  1. Scalability – The network must be able to scale to meet the demands for high volume transaction processing. The developers address the issue of scaling by adopting a different consensus protocol mechanism that is based on Proof-of-Stake (PoS). Scalable systems are faster and more efficient, which is what a blockchain needs in order to handle production level processing of transactions. The network architecture for Cardano proposes using RINA (Recursive Internetwork Architecture).
  2. Interoperability – Many blockchains cannot directly interoperate with one another. There are solutions now that allow for “atomic swaps”, which essentially provides a way for two blockchains to transfer value between each other. Prior to that, digital exchanges were the only way to go. That creates an intermediary which is something a blockchain using direct P2P transfers can remove. With a third party, the cost of transactions increases and it can be tampered, censored or rejected.
  3. Sustainability – Many critics have called Bitcoin inefficient and unsustainable in the long run due to the way it consumes resources. A sustainable system is always more ideal in terms of efficiency and reliability. Sustainable systems have a way to last thus ensuring some degree of surviving into the future. Many blockchain projects lack this feature and have to end for a variety of reasons.

PHILOSOPHY

The following are Cardano’s philosophical principles taken from their website.

  • Separation of accounting and computation into different layers
  • Implementation of core components in highly modular functional code
  • Small groups of academics and developers competing with peer-reviewed research
  • Heavy use of interdisciplinary teams including early use of InfoSec experts
  • Fast iteration between white papers, implementation and new research required to correct issues discovered during review
  • Building in the ability to upgrade post-deployed systems without destroying the network
  • Development of a decentralized funding mechanism for future work
  • A long-term view on improving the design of cryptocurrencies so they can work on mobile devices with a reasonable and secure user experience
  • Bringing stakeholders closer to the operations and maintenance of their cryptocurrency
  • Acknowledging the need to account for multiple assets in the same ledger
  • Abstracting transactions to include optional metadata in order to better conform to the needs of legacy systems
  • Learning from the nearly 1,000 altcoins by embracing features that make sense
  • Adopt a standards-driven process inspired by the Internet Engineering Task Force using a dedicated foundation to lock down the final protocol design
  • Explore the social elements of commerce
  • Find a healthy middle ground for regulators to interact with commerce without compromising some core principles inherited from Bitcoin

OUROBOROS

Cardano’s consensus algorithm uses PoS and is called Ouroboros. This determines how participating computers called nodes come to a consensus on the network. Instead of miners like in PoW consensus algorithms (used by Bitcoin), PoS requires staking funds to qualify or participate as a validator node. These “stakeholders” must contribute to secure and process blocks of transactions on the network and in return they will be incentivized in Ada. If a “stakeholder” is dishonest or attempts to attack the network, they can lose the funds they staked so there is a consequence. This aims to make “stakeholders” good faith actors rather than become bad actors. Once “stakeholders” validate a block it is added to the main network’s blockchain.

What makes Cardano different from other PoS-based networks is according to their own website:

“For a blockchain to be secure, the means of selecting a stakeholder to make a block must be truly random. An innovation of Ouroboros to produce the randomness for the leader election process is to do this by way of a secure, multiparty implementation of a coin-flipping protocol.”

DEVELOPMENT COMMUNITY

Cardano also fosters a development community since it is an open source project. There are no barriers to entry for those who want to contribute, but is mostly on a voluntary basis. Developers are rewarded in Ada for their efforts. Cardano’s code is available for others to use in order to develop applications for the platform.

At the moment, Cardano is being managed by the IOHK (Input Output Hong Kong). They will be a part of the project until 2020 according to their contract.

FUNCTIONAL PROGRAMMING

The main programming language used in Cardano is Haskell which is functional, strong and static typed. One of the reasons it was used is due to its reliability in mission critical systems. They provide a solid and secure foundation for back end systems that handle massive workloads. This means the code and logic is stable enough to be able to scale and provide reliability with little room for failures.

In functional programming if there is a function f(x) that we want to use to calculate a function g(x) to get the results of yet another function h(x). Rather than solving in sequence, it can be simplified to a single function:

h(g(f(x)))

This provides a mathematically simpler way of computing. These form the foundations for Cardano Smart Contracts. It aids in Formal Verification to prove how a program acts and what its results will be. This gives Cardano a “High Assurance Code” property.

THE PROJECT ROAD MAP

Cardano follows a road map for its development. It is divided into 5 phases called eras: Byron, Shelley, Goguen, Basho and Voltaire. It is now in the Voltaire era in 2020, which will decide the digital governance used on the network.

For more on the road map, click here.

THOUGHTS

Like any cryptocurrency project, I don’t suggest buying their token just because the project looks good on paper. This is how Cardano is like. While it is based on a sound foundation, it has not yet been applied to solving real world problems. It offers a theoretical solution that is yet to be proven. If it does deliver on its goals, Cardano’s prices may not really go up either, since it depends on the asset’s liquidity and volume. The project looks promising and that can spur certain expectations.

Note: This is not financial advice. DYOR always to verify facts.

Proof-of-Stake Consensus Mechanism

The power of cryptocurrency is not just security and decentralization. It is also due to what is called the consensus mechanism, which allows participants called nodes in a decentralized system to come to an agreement to validate the truth on a blockchain. The most popular is the consensus used in Bitcoin, called PoW (Proof-of-Work) which requires mining to create coins on the network. Although it has been tried, tested and proven true, it has issues with scalability and sustainability. Although mining is reliable, it can be energy intensive to participant nodes because it requires plenty of computing resources (hash rate) to solve cryptographic puzzles to add a block to the blockchain. That translates to larger electric bills and thus will not be ideal for payment systems that require mass volume transactions that need to be processed daily 24/7/365. It is also slow because in a blockchain, the data is sent to all nodes rather than just one server processing the transactions. It had its limitations called out by developers, thus leading to other consensus mechanisms that used more efficient algorithms that also increase the transaction velocity on the network.

This is why a new type of consensus mechanism was developed called PoS (Proof-of-Stake).

What is PoS?

This is not the same as Point-of-Sale, that is a totally different system for payments. Proof-of-Stake is a consensus mechanism algorithm that requires no mining to validate transactions and create blocks. Instead it requires to stake a certain amount of funds to become validators on the network. These funds are a % of the total coins that exist on the network.

Let f = fund staked as %, Ts = total supply of coins, Ta = total amount staked

f = (Ta / Ts) x 100

PoS and variations of it are being used in cryptocurrency like EOS, Tron, Tezos and soon it will be implemented on the Ethereum network.

When you are mining for blocks using PoW, like in Bitcoin, you must compete with other nodes called miners in order to validate blocks. This is done by trying to solve what is called the nonce which is a value (based on a difficulty target) that contains a hash of numbers. The value is either less than or equal to the nonce, and must be discovered by miners within an average time of 10 minutes. The miner who is able to compute the nonce first becomes the block validator who creates the blocks and in return receives Bitcoins as a reward.

On PoS, there is no need to compete with other nodes to solve a cryptographic puzzle. Instead, there are a set number of nodes called stakers who will help validate transactions. In some systems, like in a delegated PoS network, token holders can vote for block validators (called producers in EOS) who have staked a large investment into capital resources (e.g. data center, servers, etc.). The code than provides a time when block validators will create blocks and in return they will receive their reward in the cryptocurrency’s tokens.

If we have two staking nodes called f1 and f2:

If f1 = (Ta / Ts) x 100 > f2 = (Ta / Ts) x 100

This means f1 will be the block validator based on what was staked or weight of their % of coins.

Here is one example of PoS. According to Ethereum founder Vitalik Buterin from his blog:

The simplest formula for this (PoS) is:

SHA256(prevhash + address + timestamp) <= 2^256 * balance / diff

prevhash is the hash of the previous block
address is the address of the stake-miner
timestamp is the current Unix time in seconds
balance is the account balance of the stack-miner 
diff is an adjustable global difficulty parameter

“If a given account satisfies this equation at any particular second, it may produce a valid block, giving that account some block reward.”

The idea behind PoS is to encourage honest participation among trustless participants using game theory. You cannot know for sure who is acting on good faith or who is the bad actor. Thus, the idea of putting your own funds as a stake to being a validator is what shows your willingness to help in the network. Otherwise, that participant will lose their staked funds if they become dishonest or try to attack the network. The consensus among all nodes can deny the participant’s block if they attempt to cheat. They either lose their stake or get rejected from the network and even blacklisted. It all comes down to the protocols of the digital governance on the network, something that is a feature of PoS systems.

Another thing to note is that PoS is also based on the weight or amount a node has put at stake. Therefore, the more funds you stake the better your chances are for becoming a block validator. The validators can be chosen by random selection or voted by the token holders as mentioned earlier. This process is much faster to resolve than the 10 minute block propagation time in Bitcoin’s PoW because it requires no mining to solve for the nonce. It can actually be more instantaneous since the selected block validator can process the transactions and create the block which then updates all nodes on the blockchain. Much faster than having all nodes try to validate the block at the same time by discovering a nonce. This allows for faster transactions speeds that are more suitable for micropayments and retail transactions i.e. buying a cup of coffee with cryptocurrency.

This consensus mechanism is also more energy efficient. Producing a block on the network doesn’t require expending a lot of electricity like in Bitcoin. This saves not just costs, but also time. This has been the main argument for PoS among its proponents.

Despite its more refined algorithm, there are also issues with PoS. The following will discuss some of the well known issues.

Stake Inequality

If you are to look at the algorithm, it favors wealth. Critics argue that in a PoS system, those with more at stake or resources available will surely always come out as the validators. This is not exactly fair, and can lead to a sort of network oligarchy which can control the blockchain. If this is the case, what have PoS developers done about such issue?

To make sure that things are fair, code was written to randomize block validator selection that is still based on the amount at stake. This means that anyone who is staking is likely to get selected based on how much they have staked. When the load of transactions is even greater to process, a node that has staked more will likely become the validator because their stake can prove that they have the resources available to create the block. Now the argument against this is that it still shows that it will be favorable only to those with higher incomes. They can even collude to become block validators based on their stakes and collect all the fees from transactions. This creates a barrier to entry that limits decentralization. This then can lead to centralization, which is what blockchains are not supposed to be.

Centralized Validators

Centralization is indeed counter to the ideology of a blockchain. In order to prevent only a few validators from ever gaining control of the network, different methods have been developed.

Here are some of those methods:

  • Randomized Selection – This will ensure that validators who have validated before will not be the only validators. Instead the algorithm will randomly select a new validator each time. A validator who has validated before will get their chance again in the future. Some networks will actually allow for x number of validators only, while others can allow for unlimited numbers of potential validators.
  • Elections – Other cryptocurrency use digital elections or delegated PoS (e.g. EOS and Tron) to determine who the block validators will be. In EOS they are called Block Producers, while in Tron they are Super Representatives. The network allows all token holders with voting rights to ‘freeze’ funds for candidates to become validators. In EOS 21 are elected while in Tron it is 27. This appears to be a smaller number of nodes, but the logic behind this is that although it is less decentralized, it helps to scale up processing for faster transaction processing. The network can then call for a new round of elections to select new validators to make sure that it is not too centralized.
  • Time Allotment – In this scheme, anyone who has staked joins a queue to become a block validator. It will be a fixed amount, and so the system is not based on who has staked the most. The node will then wait for their turn to become a block validator. The problem with this type of scheme is if anyone can validate, how can we be sure they have the resources to do so? What if they are using only a low end PC or just their smartphone? Will that be enough compute power to create blocks? In this case, such a system can work for nanopayments or even non-compute intensive micropayments that use smaller block sizes. All the node needs to do is add the block after the consensus has determined it is valid. In return the node receives their fees.
  • Validation By Delegation – In Tezos this is the PoS scheme, called Liquid PoS. In this system, a validator can delegate their validation rights to other validators on the network. This is done using a process called baking. The node called a baker has block producing rights based on their stake. This model is more or less a way of sharing the rewards. This is because by process of validation by delegation, the baker can delegate production to another baker without transferring their ownership of stake. Instead they keep the stake and get rewards which they then share with the delegated baker. This works well if the baker has a good reputation and integrity on the network.

Network Attacks

The problem with centralization is that a rogue node can accumulate a majority of the cryptocurrency’s tokens. If they were to gain 51% of the coins and stake them on the network, that can lead to attacks. Now the question is, does that even make sense? It definitely requires a lot of investing into the cryptocurrency to have a majority hold on its coins. This is also called the 51% Attack and it can also be possible of PoW systems.

f = (Ta / Ts) x 100 = 51

In a post made on the Qtum blog:

“In PoS, after a rollback, the attacker address can be blacklisted and those coins simply ‘deleted’. This would make the remaining coins in the system go up in value and the attacker would have to repurchase the coins in an effort to relaunch the attack. This is especially risky for them if they were shorting the coins, as they no longer have access to them and have to pay back the lender.”

In this case it would make things more expensive to attack the network so it discourages bad actors. As of this writing (September 2019), there has never been a successful attack on a PoS blockchain that demonstrates this example.

Nothing At Stake

The Nothing At Stake theory is a problem that arises on the blockchain due to its distributed nature. This type of attack can delay and complicate transactions on the network. Staking is a process that adds value to the network. What is being staked is actually the % of coins that a user has of the total supply. It is thus in their best interest to make sure that the network is secured, otherwise they will lose their value. This incentivizes the node that stakes to behave honestly or else risk devaluing their network.

This problem can occur when there is a fork or series of forks on the network. A fork is another chain that forms from the main network during a contentious moment in which the network becomes split. One network supports one block while the other half refuses to go along with it. This also occurs when there are simultaneously two block validators trying to produce a block for the network. During a fork, a node can put their stake on both chains because they have nothing to lose from it. This type of behavior is not exactly approved by consensus.

The node can get away with it though. This is because the node will get their reward no matter which chain wins. This can lead to what is called a double spend. The node that has put a stake on both chains loses nothing because they will get their reward from the chain that wins. Now imagine if all nodes followed this lead. It makes two chains exist at once, which means there is really no main network. The node has nothing at stake because they don’t incur any costs to doing this.

This makes the network less secure and prone to more discrepancies. One of the chains can overtake the other, and any bad transaction on one chain is considered good on the other chain. Thus, a node has nothing to lose since the eventual chain that wins will reverse any bad transactions they had on the failed chain. The node collects fees no matter which chain they are on, and this can lead to many inconsistencies on the blockchain.

To address this issue, developers have come up with mechanisms that prevent or discourage this. To explain in simple terms, when the network detects a node attempting a nothing at stake attack, they will be reprimanded. The consequence is that the node will lose their stake, which is something to lose. This encourages honesty among the nodes because of the penalty of malicious intent to the network.

Critical Factors

A great feature of PoS is to allow more participation among token holders and involve the community when it comes to consensus. However a cryptocurrency chooses to implement their PoS protocols, the thing to remember is that this is an alternative option to PoW. The benefits are clear, but there are also issues that need to be addressed. Some have tried to implement a hybrid PoS and PoW system to reap the benefits of both consensus mechanisms. Overall, these systems will eventually mature and develop over time, so there is plenty to observe once they have been in production.