This document outlines how a configurable, reoccurring lottery system can be used to drive participation on the Kusama network.
Participation in Kusama is relatively low.
Polkascan reports there are ~17,000 active accounts on Kusama.
The goal of Participation Lotteries is to stimulate participation on the Kusama network by giving an additional incentive for users to participate.
Imagine…
The Kusama network is going to have a very important decision to be made through a democracy proposal. (Maybe a re-denomination…?) The network wants to stimulate participation of this vote by the end users, so it creates a new lottery.
Council, or some other origin with access will start a new lottery using the "vote" extrinsic. This lottery will be initialized with some funds from treasury to start the pot. Let's say 50 KSM
Users who want to opt into this lottery can do so by calling the vote
extrinsic wrapped in a buy_ticket
extrinsic. (Think like how we wrap calls for sudo
).
By calling the buy_ticket
extrinsic and wrapping the underlying call, the user purchases a 1 KSM ticket into the lottery, and the lottery pot increases by 1 KSM.
Users who are not interested in the lottery can simply choose to call vote
directly. Nothing here is changed.
Users will continue to participate in the lottery until the lottery period is completed. (This lottery period will likely be tied to the event at hand, for example the time until the vote expires, the end of an Era/Epoch, etc…)
Once the lottery period is over, a random user among those participating will be selected and win the entirety of the pot.
Details below.
As with any game on the blockchain, there needs to be reasonable incentives and disincentives for users to behave the way we want.
The lottery is seeded by some funds from the treasury. As a result, any participant entering the lottery would have positive expected value (EV).
We can use the seed
amount to control participation. The higher the seed, the larger the EV for a larger number of participants.
In general, it would seem that humans love to participate in lotteries. The chance to win a lot of money at little cost triggers something that may not always make economically sound decisions.
It is possible that this lottery system incentivizes "mindless" participation by users not interested in the underlying call, but just interested in participating in the lottery. AFAIK, this is unavoidable in any participation incentive mechanism. However, I think that on average, the network will benefit from more participation as a whole.
One potential issue with lotteries on the blockchain is that it is somewhat vulnerable to Sybil attacks. i.e. given that participating is positive EV, a user could create many many entries into the lottery to have a high chance of winning.
However, this can also be limited and controlled through fees and the seed
amount. In order for a user to successfully complete such an attack, they would need to transfer at least the ticket price amount of tokens to N accounts. Then each of the N accounts need to submit a wrapped extrinsic for the underlying call to be made, which involves its own transaction fee on top of the ticket price.
That means that such an attack would cost N * (transfer_fee + account_creation_fee + call_fee)
tokens. If the treasury seed is below this amount, the user is no longer incentivized to participate. Furthermore, margins would be slim for such a user, and continue to worsen as more users join.
To complete a lottery, we need to be able to randomly select a winner. Substrate/Kusama provides on chain randomness that is used for other parts of the network. It may be at certain absurd lottery pots, that block producers may be incetivized to hold back blocks which they are not the winner of the lottery, or some other negative incentives… Would potentially need feedback from W3F research team who knows more about the limits of using this randomness.
It would of course not be controllable directly by a user.
A participation lottery can be used to drive forward the following behavioral changes to the network by attaching a lottery to a specific extrinsic:
vote
)nominate
)put_bid
)propose_bounty
)electionPhragmen
,vote
)This section describes how a Participation Lottery may be implemented. Some details of the implementation are "known" and some things are "flexible"/"unknown".
seed
amount will be allocated from a funding source (like treasury) to kick off lotteries.ticket_price
to participate in lottery, this will be placed in the pool.Initial estimates predict that this end to end development should take 5 full days (spread over 2 - 3 weekends). For that work, a suggested budget of 250 KSM should be allocated.
To deliver this feature the following tasks need to be completed (with suggested delivery cost):
It is possible that delivery may be delayed slightly based on unforeseen factors, but that should be made clear at milestone 2 where we need to refine the pallet based on feedback.
Feel free to add questions to this document below:
I would propose an initial budget of 250 KSM for approximately 5 days of work (~2 weekends), and any additional budget can come from donations if people are satisfied with my work and my timeliness.
I will answer like this.
Extra section by Jeff Burdges. Please move to where appropriate.
We wait enough BABE or Sassafras epochs so that the epochal randomness from BABE or Sassafras becomes fresh, which takes an extra epoch or so under Sassafras. As \(\textsf{vrf_output}\) iterate over the VRF output of the first \(n\) slots of this fresh epoch, or maybe primary slots in BABE's case, we award one share of the pot to each voter identenfied by
\[ H(\textsf{vrf_output} || \textsf{lottery_id}) \mod \textsf{num_voters} \]
These winnings would not be dust if \(n\) is small enough.
We have security arguments for BABE/Praos and soon Sassafras in which one proves that one honest (primary) block producers per epoch makes the epoch randomness unbiasable enough that the next epoch has (many) honest block producers. Yet, these results say little about the actual bias levels:
In short, you fix a bunch of future slots that determine the multiple winners, adding more or less slots so that each winners winnings are neither dust nor higher than the block reward, and then you let the BABE VRF for primary slots or non-ring VRF in Sassafras determine winners.
As you say, these lotteries are not on the scale that validators would do malicious things, but this guideline can actually be enforced with multiple winners.
of course maybe the game is less fun if the winnings are less than block rewards. :)
so:
yes
I have not figured out if one should only use primary slots in babe or not. I guess only primary, whic means a factor of like 4 in there
primary slots you mean that if the main block producer doesnt make a block, but the secondary block producer does, we should not pick a winner
yes