Developers Forum for XinFin XDC Network

DeRand
DeRand

Posted on

[Informative] DeRand VRF Protocol is Live on XDC

The DeRand VRF protocol is now live on XDC. You can find the Coordinator address here:
Coordinator Address on XDC Scan.

DeRand leverages the Muon decentralized TSS network to provide verifiable random numbers on any EVM and non-EVM blockchain.

DeRand in a Nutshell

DeRand is a decentralized, chain-agnostic and verifiable random number generator (RNG). It leverages Pion’s (by Muon) decentralized Threshold Signature Scheme to generate verifiable random numbers for smart contracts on any blockchain. Pion/Muon is a stateless and chain-independent oracle network that “enables dApps to decentralize the off-chain components”.

What is Muon/Pion?

Pion is the Muon ecosystem’s Canary and first mainnet. It is a chain-independent and stateless DON (Decentralized Oracle Network) that enables dApps to make their off-chain components decentralized. By incorporating Pion (by Muon), the manner in which decentralized applications store, process, and access data will be fundamentally transformed.

How to Use It

DeRand contracts are fully compatible with Chainlink's VRF. Developers can utilize Chainlink VRF contracts and simply replace the Coordinator address with DeRand's Coordinator address.

Here is an Example

import "@chainlink/contracts/src/v0.8/interfaces/VRFCoordinatorV2Interface.sol";
import "@chainlink/contracts/src/v0.8/vrf/VRFConsumerBaseV2.sol";

contract DeRandConsumerExample is VRFConsumerBaseV2 {
    // state vars
    /**
     * DeRand protocol is compatible with Chainlink VRF
     * Consumer contracts.
     * The only difference is the Coordinator address,
     * which is specific to each network.
     *
     * DeRand's Coordinator XDC Contract Adress:
     * xdc24092A71ae67b6773F6ecdc56a9E153e5C57D2E7
     */
    constructor() VRFConsumerBaseV2(xdc24092A71ae67b6773F6ecdc56a9E153e5C57D2E7) {
        COORDINATOR = VRFCoordinatorV2Interface(
            0x24092A71ae67b6773F6ecdc56a9E153e5C57D2E7
        );
    }

    // rest of the code ...
}
Enter fullscreen mode Exit fullscreen mode

Full example on GitHub

More details

DeRand Website, PION Website, Muon Website, DeRand Github, DeRand Discord

Discussion (1)

Collapse
0xbeny profile image
Beny

Amazing work, would love to know if there is any benchmark on XDC related to latency available.