Kusama participation lotteries - what happened with the pallet?

With this pallet, you can configure a lottery, which is a pot of money that users contribute to, and that is reallocated to a single user at the end of the lottery period. Just like a normal lottery system, to participate, you need to “buy a ticket”, which is used to fund the pot.

The unique feature of this lottery system is that tickets can only be purchased by making a “valid call” dispatched through this pallet.

By configuring certain calls to be valid for the lottery, you can encourages users to make those calls on your network.

What happened?

Can anyone involved in this outline why it never made it to Kusama’s runtime?

Did development stop due to concerns around sybil resistance or something else?

Further info

An example of how this could be used is to set validator nominations as a valid lottery call.

If the lottery is set to repeat every month, then users would be encouraged to re-nominate validators every month. A user can only purchase one ticket per valid call per lottery.

This pallet can be configured to use dynamically set calls or statically set calls. Call validation happens through the ValidateCall implementation.

This pallet provides one implementation of this using the CallIndicesstorage item. You can also make your own implementation at the runtime level which can contain much more complex logic, such as validation of the parameters, which this pallet alone cannot do.

This pallet uses the modulus operator to pick a random winner. It is known that this might introduce a bias if the random number chosen in a range that is not perfectly divisible by the total number of participants. TheMaxGenerateRandom configuration can help mitigate this by generating new numbers until we hit the limit or we find a “fair” number. This is best effort only.

I dont think the development of this has ever started. Yes there is a lottery pallet - but it is quite generic. Also its not secure, since Kusama does not have secure randomness out of the box.

Anyone can start working on this if it has priority to them.

(PS: cc @shawntabrizi maybe you see this thread)

1 Like

Thanks - given it reached a “final discussion” and various experienced parity / W3F folks were involved I kind of presumed it was further developed.

Here’s the polkassembly post and linked Google doc for anyone interested.