Immortal Lottery: Entropy


This article describes a component of the Immortal Lottery — a decentralized autonomous application designed to work continuously at various blockchains after deployment without any maintenance requirements.

Lottery basics

The lottery is played in rounds. At the beginning of each round, users make deposits to the contract and at the end of each round users receive a chance proportional to their share of the deposit pool to win the total reward pool (with a certain % fee being withheld from each round reward pool).

Source of entropy for EthereumVM blockchains

A source of entropy is a critical part of any system that involved randomness. The selection of a winner in Immortal Lottery is random.

  • Verifiability. Even though the output of a randomness function is indeed unpredictable — it should still be provable that truly random or it was truly random at the moment of its creation.
  • Fault tolerance. As there is no built-in source of entropy it is necessary to rely on external trustless sources. The system must be designed to resist any faults or manipulation attempts from a potential entropy source side.

User input as a source of entropy

The contract will rely on user-designed input as a source of entropy.

The Rule of Entropy

Since the lottery is designed to work autonomously, and entropy is supplied in an unreliable way through users and it is far from guaranteed that users will provide sufficient entropy, certain conditions must be met for the lottery to maintain a fair distribution of winner selections.

Entropy disruption protection

Since users will use well-known cryptography techniques to submit etropy to the contract, they may unknowingly disrupt the gameplay. sha256(a, b) — the output of this function is a seemingly chaotic “hash” but if you use the same (a, b) pair multiple times then the output of a function is also the same. This makes (a, b) pair predictable and potentially allows users to manipulate the randomness function.


Can I earn money in this lottery without having to play?

Yes, you can become the entropy provider and earn % of the reward pool from players.

Is it safe to deposit my funds as a collateral to become the entropy provider?

You need to reveal your entropy deposit no later than 24 hours after the lottery round ends. If you are capable of doing so then your funds are safe and you will receive it all back.

Can I use staked CLO as a collateral?


How long does the entropy provider have to wait for the collateral to be released?

Collateral is deposited during the entropy collecting phase. Collateral and reward are released during the entropy disclosure phase which follows the entropy collecting phase. It is possible to deposit a collateral and withdraw it in the next block in theory.

Is there an upper bound on the number of entropy providers?

There is technically no need to have a coded upper bound for entropy providers. The entropy reward decreases as the number of entropy providers increases so it’s up to incentivization system.