This blog post explains the Lisk block generation mechanism and more specifically, the voting process. In the Lisk blockchain, blocks are generated every 10 seconds by delegates. Every account on the blockchain can register to become a delegate, but only the ones with the highest delegate weight get to generate blocks. The delegate weight is computed according to the different votes cast for the delegate.
In order to support the Lisk network, a user can either be a delegate or decide to contribute by voting for already existing delegates. The Lisk voting system was described in detail in a previous blog post. In this blog post, we firstly focus on describing how the Lisk wallet can be used for voting, and then give a summary of the voting system and the relevant implications for voters.
Voting with the Lisk Wallet
Voting in the Lisk wallet is easy and straightforward, so let's start by describing how it's done. This process is also explained on Youtube in our videos and How to Vote in Lisk Desktop v2.0.0.
- Login into your account in the Lisk wallet.
- Navigate to the profile page of the delegate you want to vote for. This can be achieved by the following:
- Using the search bar to search for a delegate, by name or by address.
- From the delegate page, browse and click on the chosen delegate.
- Click the "Add to votes" button on the delegate profile page.
- Enter the amount of LSK you want to use to vote for this delegate
→ The vote is then added to your voting queue.
- You can repeat steps 2 to 4 to add other votes to your voting queue.
- Verify your voting queue and confirm it
→ The votes are sent to the network.
This process will submit your votes to the network and will then be visible in your wallet. It is then possible to view and access the information listed below:
- The "votes" page shows a summary of your current votes.
- By clicking on the pencil icon it is possible to edit any existing votes, such as adding or removing voted LSK.
- By clicking on the padlock icon, it is possible to view your locked LSK and the tokens that can be unlocked.
The LIP Introduce vote locking periods and new vote weight definition introduces the voting system used in the Lisk blockchain. This voting system enables users to choose exactly how much LSK they want to use for voting and which delegates those votes target. Once a vote is cast, it remains valid until the user sends another vote transaction to remove the votes. The votes are aggregated and used to compute the delegate weight, which in turn is used to assign blocks to delegates. In general, a delegate with more votes is more likely to generate blocks.
The tokens used for voting are locked, which means that they still belong to the user but they cannot be used for transactions. The funds are locked for as long as the user is voting using these tokens. In order to be able to unlock them, the user should first remove them from the votes, and wait for 6 hours. Only then, unlocking the tokens will move them back to the “available balance”.
Figure 1: The Lisk wallet displays both the available and locked tokens.
Figure 2: When clicking on the padlock icon, it is possible to view how the locked tokens are split up. Clicking the "Unlock" button will unlock the 350 LSK that are available to unlock, (as shown in the example illustrated above).
Unlocking Tokens and Waiting Periods
In general, 6 hours after removing votes from a delegate, the tokens are available for unlocking. This action is available in the Lisk wallet and can be executed at any time after the waiting period has elapsed. However, in some cases the waiting time is extended. For example, this is the case for delegates that vote for themselves, and the waiting time here is roughly 30 days. Furthermore, if the delegate misbehaves and is punished on chain, the locking time of all tokens voting for this delegate is extended. If the delegate that the user is voting for is punished, the user’s tokens will be locked for 30 days and the self-voting tokens of the delegate will be locked for 90 days.
The delegate weight is used in the selection mechanism to decide if a delegate can forge a block in the coming round or not. A delegate with a high weight is more likely to generate a block than a delegate with a low weight.
In each round, 101 blocks are generated by the 101 delegates with the highest delegate weight. This means that all delegates in the top 101 list will forge one block every round, regardless of their respective delegate weight. It could be that the delegate with the most weight has three times more weight than the delegate in the 100th position, nevertheless, they will forge the same number of blocks.
In each round, 2 blocks are also assigned to delegates outside the top 101 list, which are known as standby delegates. For those two blocks, the delegates selected to generate them are chosen randomly, proportional to their delegate weights. The details of this selection mechanism are available in LIP 22. For example, the total amount of weight for standby delegates is currently 652,000 LSK, and this implies that a delegate with a weight of 10,000 LSK would forge on average 76 blocks per month.
Punishments and misbehavior of proof
Generating blocks is an important responsibility. Lisk BFT, specified in LIP 14, defines a set of rules that must be followed by delegates in order to guarantee that the blockchain progresses correctly, and that all Lisk nodes eventually agree on the same blocks. To enforce those rules, the Lisk protocol contains a punishment mechanism for delegates that have created contradicting blocks. The definition of contradicting blocks is outside the scope of this blog post and can be found in LIP 14. However, it should be noted that the consequences of being punished apply to the delegate who generated the contradicting blocks, and to all the tokens currently voting for this delegate.
In essence, this means that if a delegate that a user votes for is punished, the user’s tokens will be locked for an extended period of approximately one month. To avoid having your LSK locked, it is recommended to vote for reputable delegates and consider voting for multiple delegates to lower the risks of all your LSK being locked at the same time.
Benefits of Voting
The first and most important reason is "securing the network". Indeed, if there are only a few votes, then this means that it is easier for an attacker to control multiple active delegates. Whereas if the total number of votes is high, then it will be difficult and costly for an attacker to gain a forging slot. This is similar to the total hash power of a network in proof-of-work chains. So voting for experienced and responsible delegates improves the overall security of the network.
Secondly, delegates receive block rewards when they generate a block. This block reward can then be used for multiple purposes. Some delegates share their rewards with their voters, and others use the rewards to incentivize the creation of tools and applications for the Lisk ecosystem. This is an additional reason which could help guide you as to which delegate to vote for. Keep in mind that Lisk does not implement automatic reward sharing, so delegates offering this are solely responsible for actually sending tokens to their voters.
As stated above, all tokens used for voting are locked, therefore making those tokens available again will take at least 6 hours. Furthermore, if the delegate you vote for is punished, the voters will face part of the punishment as well. This punishment represents a security feature of the network. As a consequence of the punishment, users who voted for the punished delegate will see their locking period for this vote increased to 30 days. It is important to know that if something goes wrong, your tokens could be locked for 30 days. The funds are not lost, they are still in the same account, however, they cannot be used for any transaction during this 30 day period.