In the Ethereum ecosystem, smart contracts are king. Unfortunately, their possibilities are limited and in many cases, the use of an off-chain resource is necessary. This is particularly the case when generating a random number, a problem that Chainlink wishes to solve with Chainlink VRF.
The hell of the random
Those who are familiar with computers know this: generating a random number in a computer way is a real headache.
Indeed, random numbers fall into two categories:
- Pure random numbers , derived from the observation of a physical event ( throw from right away, throw from coin, etc. )
- The so-called pseudo-random numbers , from a computer operation.
Unfortunately for developers, the use of pseudorandom numbers can have serious consequences for the security of the application . This is all the more important in the context of blockchains, where dapps must manage funds.
Until now, developers of decentralized applications had two possibilities to generate random numbers:
- Use on-chain information like the hash of the last block;
- Use an off-chain random generator and communicate its on-chain value.
However, neither of these two solutions is optimal. On the one hand, the first opens a potential attack vector in which malicious actors could modulate on-chain information in order to force the generation of a particular number. On the other hand, the second solution does not make it possible to verify the validity of the data recovered off-chain , thus joining the problem of Oracles .
The solution: ChainLink VRF
After having studied these problems at length, ChainLink has just unveiled ChainLink VRF ( On-chain Verifiable Randomness ) a solution allowing to generate pure random numbers which can be verified on-chain .
"Thanks to Chainlink VRF, you can establish reliable smart contracts for all applications that require unpredictable results " rules the announcement publication.
To use the system, a smart contract must send a request to Chainlink, accompanied by a seed . This is used by the Oracle to generate a random number, which will be returned on-chain once generated, along with cryptographic evidence to verify the reliability of the random number.
Integration with PoolTogether
Proof that the solution has a real interest, ChainLink presents the example of the implementation of VRF on PoolTogether .
As a reminder, PoolTogether is a lossless lottery . Each participant deposits funds on a smart contract, these are pledged to generate interest on decentralized lending platforms . At the end of a defined time, a winner among the participants is drawn and wins the interest managed. Once the draw has been completed, each participant recovers his basic stake, hence the lossless nature of the lottery.
In this case, the winner's draw requires the use of a pure random number . PoolTogether has chosen to integrate ChainLink VRF, in order to be able to prove to its users the veracity of the draws.
Once again, ChainLink offers an extremely useful product for decentralizing Ethereum and its decentralized applications. It now remains to wait for the finalization of the test phases on the testnet before publication on the mainnet.
Commentaires
Enregistrer un commentaire