Leased Proof of Stake (LPOS) consensus algorithm and Waves-NG protocol
Author: Guy Brandon, Waves contributor.
The Waves Network uses the Leased Proof of Stake (LPOS) consensus algorithm, which, combined with the Waves-NG protocol, enables high scalability and transaction throughput of the network.
introduce
The Waves Network was launched in 2016, raising 30,000 bitcoins, worth about $16 million, through an ICO. The project aims to develop a comprehensive blockchain ecosystem that can be used for business transaction processes, including a toolkit that covers a wide range of functional needs, including easy creation of custom digital currency tokens, direct writing of smart contracts, a built-in decentralized exchange (DEX) for peer-to-peer transactions, a secure and convenient way to interact with dApps, and web services provided by the Waves Keeper browser plug-in.
Scalability
From the beginning, Waves recognized that scalability is a requirement for most blockchain projects to be promoted and used, and realized that relevant technologies need to be developed to address the limitations of existing blockchains. For example, Bitcoin has high security but relatively slow transaction speeds and can only support about 7 transactions per second (TPS). Therefore, Bitcoin is not efficient enough to make it a global currency. Second-layer solutions such as Bitcoin's Lightning Network were implemented to achieve this goal. Waves takes a different approach on this layer, focusing on on-chain scalability before considering second-layer applications.
Lease Balance
Waves' original consensus algorithm is based on a simple proof-of-stake protocol. A total of 100 million WAVES tokens were distributed after the ICO, and the supply is fixed: because WAVE is a "PoW" token, there is no inflation. Therefore, Waves block validators (forgers, who are often called "miners" in the Waves ecosystem) receive transaction fees from the blocks they process, but no additional block rewards.
The Leased Proof of Stake (LPoS) system was fully launched in May 2017. The protocol allows users using the Waves lite client (those who do not run a full node) to lease their WAVES tokens to mining nodes. The leased WAVES are locked in the user's account and cannot be transferred or traded. In addition, the tokens remain fully controlled by the account holder and can be cancelled at any time after the lease expires. Given the technical overhead associated with running a mining node and the 24/7 online operation, only a relatively small number of the Waves community runs mining nodes (a list of block generators can be viewed at https://dev.pywaves.org/generators/).
WAVES tokens leased to mining nodes can be used to increase the weight of a miner, which in turn increases the chances of a miner discovering the next block. The leased proof-of-stake system improves the security of the network in at least two ways. First, the more WAVES tokens used to secure the network, the better, as this makes it more difficult for an attacker to accumulate the amount of tokens needed to perform a 51% attack. Second, WAVES tokens are leased to mining nodes from the user's cold wallet, but the nodes themselves (those that remain online) may only have a small balance. Since the leased funds are not transferred to the miners, this can greatly reduce the risk of WAVES tokens stored online being attacked.
A new consensus method: Waves-NG
In December 2017, WAVES further upgraded the network and launched the Waves-NG consensus protocol. This is a new protocol based on the Bitcoin NG scheme, invented by Cornell IT professor Emin Gün Sirer.
The miners selected by the initial Bitcoin protocol are traceable. After a block is added to the blockchain, miners compete with each other to find a valid hash value for the next block based on the current state of the blockchain. At the same time, newly generated transactions are placed into the mempool, where they will remain pending until a miner collects and verifies them.
While both Bitcoin and Bitcoin-NG are considered Byzantine Fault Tolerant (BFT) systems, the latter was proposed in 2015 as a scalable alternative that works differently. In the Bitcoin-NG system, the next miner is pre-selected, and that miner creates an empty "keyblock" - this block is eventually added to the blockchain. Small blocks called "microblocks" (consisting of several transactions) are added to the keyblock in near real time. Using an everyday analogy, this is like adding a few shopping bags (microblocks) to a shopping cart (keyblock) before pushing the full cart to the checkout counter (added to the blockchain network). This means that transactions can be added to the blockchain in seconds, and the only delay that may occur is the latency on the network. Waves upgraded the proof-of-stake mechanism to create the Waves-NG protocol, which is also the first time that the Bitcoin-NG protocol has been deployed on an open, public blockchain.
Further improvement to the ecosystem is achieved through "MassTransfers". It allows up to 100 transfers to be executed in a single transaction and reduces the handling fee. On the one hand, MassTransfer limits each MassTransfers to 100 txs in order to balance capacity expansion and convenience, and on the other hand, it also limits the ability to send a large number of low-cost transactions at the same time. If a larger number of transfers are required, multiple MassTransfers transfer transactions can be submitted in sequence.
In other words, users can simply select MassTransfer as another way to "send a transaction" that allows them to add up to 100 payees in a single transaction. In addition, the addresses of the payees can be provided via JSON or uploaded using a CSV file, making it straightforward and efficient to make large airdrops or weekly payments to users who rent WAVES tokens to mining nodes. Combined with Waves-NG, the MassTransfer feature allows for extremely high throughput rates on the network.
In order to evaluate the potential throughput of the new protocol, many stress tests have been carried out on the Waves network. In October 2018, a large-scale stress test was conducted on the MainNet. The test showed that the public blockchain protocol (not just the limited and controlled TestNet) can support more than 6.1 million transactions in 24 hours, an average of 4,200 txs per minute or 71 txs per second, and a peak throughput of hundreds of transactions per second.
Summarize
Leased Proof of Stake (LPOS) allows ordinary users without technical expertise to help protect the Waves network by leasing WAVES to full nodes while controlling WAVES tokens. At the same time, Waves-NG achieves a throughput of up to 100 TPS, which is an order of magnitude higher than many blockchains. Since there is no need to pay financial rewards to miners, the latter do not need to bear high electricity costs and expensive hardware, so the transaction fees are very low.
For Waves, on-chain scalability has always been a priority, but any blockchain can be scaled in this way due to the storage space and bandwidth required. Waves developers believe that the current solution can be optimized before further scalable solutions can be implemented, and the transaction capacity of up to 1,000 TPS can be supported. Waves is currently exploring a second-layer scaling solution involving sidechains, which can support large numbers of transactions on parallel chains and eventually be secured on the Waves mainnet.


