How to use Randomizer
- Set a pool of participants
- Choose the number of winners
- Click ‘Determine winners’
How the blockchain randomizer works
The random number is generated by the blockchain in several phases. The generation process involves the user and the server — an oracle controlled by a smart contract on the Waves blockchain. The process is essentially an exchange of transactions between the user and the smart contract.
- The user requests a random number. The request is a blockchain transaction that is automatically generated and published as soon as a user approves the action via Waves Keeper. Each transaction has an ID — a unique number that cannot be repeated in another transaction.
- The server receives this transaction and its ID. This is the first part of our random number.
- The server signs the ID with its private key. This is the second part.
- The server sends an answer, the signed transaction ID. This is our random number.
- The user receives the random number and reveals the result of the game to players.
Why are blockchain randomizer games fair?
Neither the user nor the server can know the result in advance
- The user receives the random number after it is published on the blockchain.
- No one can know the private key of the server, except the server itself. However, the server cannot know in advance what the ID of the transaction with the request will be.
The result can always be verified
The random number and time of its request are recorded on the Waves blockchain forever. The smart contract code with the server’s public key is visible for anyone to check. Any result can be mathematically verified via the specific transaction ID and the server’s public key. This is possible due to the RSA encryption algorithm.