Leased Proof of Stake consensus algorithm and Waves-NG protocol

Authors: Guy Brandon, Waves Contributor.

The Waves network runs on the leased proof-of-stake (LPoS) consensus algorithm in combination with the Waves-NG protocol, which provides a high degree of scalability and transaction throughput.


Preface

The Waves network launched in 2016 after an ICO that raised 30,000 BTC, about $16 million at the time. The project is developing a comprehensive blockchain ecosystem for business solutions with a wide range of tools covering a variety of needs, including easy creation of custom tokens, smart contracts, peer-to-peer trading on a built-in decentralized exchange (DEX), as well as a secure and convenient means of interacting with dApps and web services using the Waves Keeper browser plugin.


Scalability

From the very beginning of Waves, the company recognized that for mass adoption of blockchain technology would need to improve scalability and prioritized technology development to address the limitations of existing blockchains. For example, Bitcoin is very secure, but it is relatively slow and can only support about 7 transactions per second (TPS). Thus, Bitcoin is not powerful enough to be used as an everyday currency. A layer 2 solution like the Lightning Network is necessary for Bitcoin to achieve this. Waves took a different approach, which initially focused on high chain scalability before considering layer 2 applications.


Lease balance

The original consensus algorithm in Waves was a simple implementation of Proof of Stake. All 100 million WAVES tokens were distributed after the ICO and their total supply is fixed, without inflation, as happens with PoW coins. Therefore, validators on Waves (forgers, although they are usually called “miners”) are rewarded with payment of block fees rather than rewards.

The Leased Proof of Stake (LPoS) system was fully launched in May 2017, allowing users of the Waves lite client, those who cannot run a full node, to lease their WAVES tokens for mining nodes. Rented tokens are locked in the user's account and cannot be transferred or exchanged. However, they remain under the full control of their owner and the rental can be canceled at any time. Given the technical overhead of running a mining node and the need to be online 24/7, only a relatively small portion of the Waves community runs them (a list of validators can be found at https://dev.pywaves.org/generators/).

Leased WAVES tokens are used to increase the miner's stake, which in turn increases the chances that he will find the next block. The Leased Proof of Stake system improves network security in at least two ways. First, the more WAVES are used on the network, the better, as it becomes more difficult for an attacker to accumulate the tokens needed for a 51% attack. Secondly, WAVES can be leased to a node from the user's cold wallet, but the node itself, which remains connected to the network, must only have a minimum balance. This significantly reduces the risk of WAVES tokens being hacked from computers connected to the network, since the leased funds are not transferred to the miner.


A New Approach to Consensus with Waves-NG

A further update to the network occurred in December 2017 with the launch of Waves-NG. This was a new protocol based on Bitcoin-NG created by Cornell IT professor Emin Gün Sirer.

The original Bitcoin protocol selects each miner retrospectively. Once a block has been added to the blockchain, miners compete with each other to find a valid hash for the next block based on the current state of the chain. In the meantime, newly created transactions go into the mempool, where they will remain pending while one of the miners collects and verifies them.

Although both Bitcoin and Bitcoin-NG are considered to be a Byzantine General Task (BFT) system, the latter was proposed in 2015 as an alternative to improve scalability based on a different working mechanism. In the Bitcoin-NG system, the next miner is chosen in advance and creates an empty key block - this is the block that will eventually be added to the blockchain. Small blocks called microblocks (consisting of multiple transactions) are added to this key block. In an everyday example, this would be like adding a few shopping bags (microblocks) to a cart (keyblock) before it fills up and eventually gets to the checkout (add to the blockchain). This means that transactions can be added to the blockchain in just a few seconds, with the only real latency associated with the network. Waves has updated its proof of stake by creating the Waves-NG protocol, the first interpretation of Bitcoin-NG for an open, public blockchain.

Another addition to the ecosystem was MassTransfers. This allows you to pack up to 100 transfers into one transaction with a reduced commission. The 100 TPS limit for MassTransfer was chosen as a compromise between significant capacity and convenience, and limiting the ability to send very large batches of low-cost transactions. If more transfers need to be made, multiple MassTransfers can be implemented sequentially.

In other words, users can simply select MassTransfer as another transaction sending type, allowing them to include up to 100 recipients in a single transfer. Additionally, recipient addresses can be provided in JSON or CSV files, making it simple and effective for making large airdrops or weekly payouts to those who rent out their WAVES to mining nodes. When combined with Waves-NG, MassTransfer provides very high network throughput.

A series of tests were conducted on the Waves network to evaluate the throughput of the new protocol. In October 2018, a stress test of the mainnet was carried out. This demonstrated that the public, open blockchain protocol could support more than 6.1 million transactions per day and an average of 4,200 TPS per minute or 71 TPS per second, with a maximum throughput reaching 100+ transactions per second.


Conclusion

The Leased Proof-of-Stake system allowed ordinary users to help secure the Waves network by transferring their WAVES tokens to nodes without losing control of them. At the same time, Waves-NG provides throughput up to 100 TPS, which is an order of magnitude greater than many blockchains. Transactions are also cheaper because there is no need to pay miners a block reward to offset their costs for electricity and expensive equipment.

Chain scalability is a priority for Waves, but there are certain limitations for other blockchain networks with the same approach due to the amount of memory and bandwidth required. The Waves developers believe that it can be optimized to support up to 1000 TPS before additional solutions are required. Waves is currently looking at various options for scaling the second layer, which includes a sidechain, which will allow it to process a large number of transactions on a parallel chain and eventually secure it with the main chain.