DIA Nexus Documentation
  • Nexus Overview
  • Intro to Nexus
    • How it works
    • Nexus vs. Lumina
    • Integrated Chains
  • Data products
    • Token Price Feeds
    • RWA Price Feeds
    • Randomness
    • Fair-value Feeds
  • How-to Guides
    • Fetch Price Data
      • Solidity
      • Vyper
      • Demo Oracles
      • Chain-specific Guide
        • Aleph Zero
        • Alephium
        • Edu Chain
        • Hydration
        • Kadena
        • LUKSO
        • Somnia
        • Stacks
        • Superseed
        • XRP Ledger (XRPL)
    • Generate Randomness
      • Solidity
      • WASM
      • Demo Oracles
      • Chain-specific Guide
        • Alephium
    • Migrate to DIA
    • Fund the Oracle
    • Build a Scraper
      • Development Cluster Stack
      • DIA Test‐Space with Docker Compose
      • DIA Test‐Space with Minikube
      • Add a new exchange scraper
      • Add a new foreign scraper
      • Add a new liquidity scraper
      • Additional notes
  • Request a Custom Oracle
  • Reference
    • Architecture
      • Data sourcing
      • Data computation
      • Data delivery
    • APIs
      • Token prices
        • RestAPI
          • Request Samples
        • GraphQL
          • Request Samples
      • RWA prices
    • Pricing Methodologies
      • IR: Interquartile Range Filter
      • MAIR: Moving Average with Interquartile Range Filter
      • VWAP: Volume Weighted Average Price
      • VWAPIR: Volume Weighted Average Price with Interquartile Range Filter
      • LST fair price
    • Data Sources
      • CEXes Data
      • DEXes Data
    • Smart Contracts
      • DIAOracleV2.sol
      • DIARandomOracle.sol
    • Randomness Protocol
  • Resources
    • Audits
    • Community & Support
    • Security Bounty Program
    • Research
      • Return Rates in Crypto Farming
      • Crypto Volatility Index
      • Compounded Rates
      • Polkadot Medianizer
    • T&C
      • Licence Agreement
      • Contributor Covenant Code of Conduct
      • Disclaimer
Powered by GitBook
On this page
  • What is randomness?
  • Who needs randomness?
  • On-chain publishing process
  • Risk Mitigation
Export as PDF
  1. Reference

Randomness Protocol

Distributed key generation (DKG)

PreviousDIARandomOracle.solNextAudits

Last updated 2 months ago

To offer distributed and verifiable randomness on-chain, DIA leverages ’s distributed randomness beacon. The beacon is run by a group of independent actors called the League of Entropy.

The is a collaborative project to provide a verifiable, decentralized randomness beacon. A decentralized randomness beacon combines randomness from multiple independent high entropy sources to generate a truly unbiased random number for anyone that may need a public source of randomness.

Please visit the project site at for the most up-to-date information on current operations. To learn how the how distributed randomness beacon is built please .

What is randomness?

Randomness is the property of lacking any sensible predictability. It is very difficult to create random events on-chain due to the deterministic nature of any EVM or EVM-like environment.

Centralized randomness is susceptible for attacks by the randomness source, as a single non-random outcome cannot be distinguished from a random one. Thus, having a single RNG provide randomness via an oracle is not enough.

Who needs randomness?

Random numbers can be very relevant for on-chain applications such as games, lotteries, prediction markets, or NFT launches.

Relying on pseudo-random values like the last blockhash can be manipulated by miners and is not advisable.

Drand run distributed nodes to produce their randomness beacon. They use to create collective private/public key. Participants in their League of Entropy then generate randomness in rounds and broadcast it together with its signature.

On-chain publishing process

From random number generation to on-chain distribution, DIA xRandom operates as follows:

  1. Drand randomness generation: in every drand epoch (currently set at 30s for the existing LoE beacons, but on future “unchained” beacons) each of the nodes that form the drand network generates a partial signature, which it broadcasts to the rest of the nodes. Once any node has enough, i.e., a threshold number of signatures, it computes the new randomness beacon, which is the hash of the signature aggregate.

  2. Drand randomness propagation and consumption: the new beacon is propagated through the network to all other nodes. Any node can verify and accept or reject the hash of the signature (i.e., beacon) that it received. Any client or application can consume randomness out of band (i.e., without needing to be part of the drand network) either through or through , Gossipsub. Clients can also verify that the randomness they received is indeed the one produced by the drand network.

  3. DIA on-chain distribution: the final randomness signature is shipped on-chain as an oracle smart contract. In order to effectively and securely execute these on-chain transactions, DIA has built a robust, decentralised node infrastructure — dubbed DIA xNode. DIA xNode is a network of third-party, decentralized node providers that grant DIA the blockchain infrastructure to push data on-chain ensuring high rate limits.

Risk Mitigation

It is important to understand the risks of the randomness oracle before using it and to be able to mitigate them.

Additionally, there are new risks introduced by using the oracle.

Risk
Possible Mitigation

Oracle stops serving data

Check that the oracle has recent updates in its history.

Specific Round is missed by the oracle

Have your dApp use the next round if a certain round is unavailable (but later ones exist).

Oracle serves compromised data

Check the associated BLS signature provided by drand (Note: Currently not availabe on most EVMs).

An extensive risk evaluation of the underlying protocol can be found . All risks listed there also affect the randomness guest oracle, as it serves as an underlying data provider.

drand
League of Entropy
drand.love
visit this link
Pedersen's DKG (Distributed Key Generation) protocol
planned to be decreased
the public HTTP APIs
libp2p’s pubsub protocol
drand.love
in their documentation