⛓️Chainlink
Content source - docs.chain.link
Last updated
Content source - docs.chain.link
Last updated
Within DCB World’s draw system, Chainlink Keepers are used to jumpstart the smart contract to commence the random drawing of a ticket, which is underpinned by Chainlink VRF. Here’s how it works.
Chainlink Keepers is a smart contract automation service in which the same professional DevOps teams that operate Chainlink Price Feeds take job requests to automate certain smart contract functions. In practice, this means that Chainlink Keepers trigger a specific function in DCBW Alarm that confirms draw times. By using Chainlink Keepers, the draws only commence when the pre-set conditions—in this case, a particular day and time—are met. If the draw conditions are met, the DCBW Alarm smart contract calls a function in the DCBW ERC-721 smart contract to begin the draw, which asynchronously calls Chainlink VRF to request a random number. Once the request is received, the DCBW RNG smart contract is triggered by Chainlink VRF, producing the resulting numbers. The DCBW ERC-721 smart contract then processes the random numbers, verifying if any purchased ticket number matches. If the verification process confirms a ‘yes’, the wallet holding this ticket number receives the prize directly. If the verification process confirms a ‘no’, the process automatically repeats as soon as the draw pre-conditions are met again.
The Benefits of Integrating Chainlink Services The integration of both Chainlink VRF and Chainlink Keepers were necessary for a provably fair, decentralized, and automated NFT raffle system. In order to build out a robust system, we needed access to a provably fair source of on-chain randomness and a secure smart contract automation service—a service that requires a high standard of security, reliability, and transparency.
For example, on-chain RNG solutions like block hashes introduce vulnerabilities where miners can choose to publish a block only when this would generate more favorable results for themselves. On the other hand, off-chain RNG solutions are opaque, requiring users to trust that the centralized data provider won’t manipulate the results to their benefit. Both solutions become increasingly concerning as the amount of value being secured by the RNG solution goes up.
Chainlink VRF solves this problem by combining block data that is still unknown when the request is made with the oracle node's pre-committed private key to generate both a random number and a cryptographic proof. The DCB World 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. This helps provide users with automated and publicly verifiable proof directly on-chain that the random number behind winning tickets is provably fair and cannot be tampered with or predicted by the oracle, outside entities, or the DCB World team.
Another intrinsic limitation for smart contracts is the ability to jumpstart functions. In order to perform a function based on a particular condition, smart contracts need to be woken up by an external entity, known as a keeper. Chainlink Keepers solve security issues common in other keepers services, such as poor incentive systems or the potential for extended down periods due to unreliable operators.
Overall, each of these Chainlink services was a perfect match for building out a sophisticated NFT raffle game for holders, and we expect to provide users with a reliable, secure, and user-friendly service.
“Provably fair on-chain randomness and secure smart contract automation are critical when it comes to user confidence, and thus the success of DCB World. This combination of technologies with NFTs and prize games, as well as Chainlink VRF and Chainlink Keepers, has been established to deliver fully automated and transparent results. We expect our users will be very happy with the high level of service in these automated lucky raffle games.” — Ramzi Mneimneh, co-founder of DCB World