MILLIONSY
Search…
The MILLIONSY VRF
Transparency and security are the two most important factors to the winner selection process. They make sure that no single party could unfairly affect the final results.
The fact that it's not easy to access a random manipulation-resistant source on-chain in a verifiable manner. For example, while Onchain RNG (Random Number Generator) solutions can easily be subject to miner manipulation, off-chain RNG solutions, on the other hand, are opaque and hard to integrate.
In The MILLIONSY Lottery, we use our own VRF (Verifiable Random Function) which is familiar to Chain Link to generate a random winning number on Solana blockchain. Basically the random winning number is obtained from the Seed Numbers Library (SNL).

This SNL is generated Onchain using the following 2 steps:

  1. 1.
    The MILLIONSY Lottery system will generate a pre-seed library and push it on the Onchain. This pre-seed library is a predefined PseudoRandom Number Generator (PRNG).
  2. 2.
    Pre-seed will be combined with Solana's Blockhash at the time the winning number is generated (Blockhash data that is still unknown when the request is made):
1
/// Creates a new PRNG. The two inputs, seed and increment,
2
/// determine what you get; increment basically selects which
3
/// sequence of all those possible the PRNG will produce, and the
4
/// seed selects where in that sequence you start.
5
///
6
/// Both are arbitrary; increment must be an odd number but this
7
/// handles that for you
8
pub fn new_inc(seed: u64, increment: u64) -> Self {
9
let mut rng = Self {
10
state: 0,
11
inc: increment.wrapping_shl(1) | 1,
12
};
13
// This initialization song-and-dance is a little odd,
14
// but seems to be just how things go.
15
let _ = rng.rand_u32();
16
rng.state = rng.state.wrapping_add(seed);
17
let _ = rng.rand_u32();
18
rng
19
}
Copied!
To see the full algorithm, check this link.
This combination creates a final library of seed numbers, called Seed Numbers Library (SNL). The SNL will change continuously because the nature of Blockhash data is time-continuous.
When a winning number is selected from SNL, this number is basically verified by validator node. This allows neither the offchain nor the Validator or anyone else to know the final result (the winning number). The whole combine process is done and got the final result on the Onchain. So this combination is used to generate both a random number and a cryptographic proof. The MILLIONSY Lottery smart contract will only accept the random number input if it has a valid cryptographic proof, and the cryptographic proof can only be generated if the VRF process is tamper-proof.
By letting any user having the ability to independently audit the integrity of the RNG to verify that it's unbiased, unpredictable, and manipulation, MILLIONSY wants to send a strong statement that the important role of fairness and transparency to our random number draws is undeniable.
In conclusion, in this phase, we only have been using MILLIONSY's VRF to bring transparency and security to The MILLIONSY Lottery but in the near future its potential of becoming a standalone orac on the Solana blockchain is very promising. If you have a project running on Solana and have problems with VRF, feel free to contact us for help.