đŸ”ĸRandom Number

Generating true random numbers in a blockchain environment is challenging due to the transparent and deterministic nature of blockchain systems. Nodes must reach consensus on the state of the blockchain, making it difficult to generate numbers that are unpredictable and tamper-proof.

Random numbers are crucial in blockchain technology for various applications, including secure cryptographic functions, gaming, lottery systems, and random token distribution.

Implementation

Our Oracle supports the generation of random numbers by leveraging data from random.org, a renowned organization dedicated to providing true random numbers. These numbers are rigorously tested to meet the standards recommended by the US National Institute of Standards and Technology (NIST), ensuring high-quality and reliable randomness for your blockchain applications.

Usage

When calling the createRequest function from our Oracle, use the following arguments:

  • oracleType -> "randomNumber"

  • args -> [minValue, maxValue]

  • priv -> true or false

Here, minValue and maxValue define the range from which the random number will be generated.

Please refer to the Client Integration section for more information about the priv argument.

Demos

We offer two demo implementations of the Random Number Oracle to help you understand its functionality and explore its potential applications.

Random Number

This is the simplest implementation, utilizing our Oracle with minimal additional logic. The result is a true random number that can be seamlessly used within the blockchain.

Usage Steps

  1. Visit Our Site: Access our Random Number Oracle site to get started.

  2. Connect Your Wallet: Use Metamask or ThetaWallet to connect your wallet to the application.

  3. Set the Range: Specify the range from which the random number will be generated by entering the minimum and maximum values.

  4. Approve the Service Fee: Click the Approve button to authorize the use of 250 DOGZ as the service fee.

  5. Generate the Random Number: Click the Generate button and confirm the transaction fee in TFUEL.

  6. Wait for Transaction Completion: Wait for the transaction to be processed, which could take up to 1 minute depending on network congestion.

  7. Get Your Random Number: Once the transaction is complete, you will receive a true random number within the Theta Network.

  8. See on Explorer: Click on See on Explorer to view the transaction details and the data gathered from the Oracle.

Voila! You now have a true random number generated within the Theta Network.

Pick a Winner

This is a use case of our Oracle where a random number is used to select a winner from a list. In this simple example, we demonstrate a powerful application of our Oracle, showcasing its potential. The possibilities are limitless and left to your imagination.

Usage Steps

  1. Visit Our Site: Access our Random Number Oracle site to get started.

  2. Connect Your Wallet: Use Metamask or ThetaWallet to connect your wallet to the application.

  3. Add Items: Add the items (at least 2 participants) to the list from which the winner will be selected.

  4. Approve the Service Fee: Click the Approve button to authorize the use of 250 DOGZ as the service fee.

  5. Pick the Winner: Click the Pick the Winner button and confirm the transaction fee in TFUEL.

  6. Wait for Transaction Completion: Wait for the transaction to be processed, which could take up to 1 minute depending on network congestion.

  7. Get Your Random Number: Once the transaction is complete, the winner will be selected based on a true random number generated by our Oracle.

  8. See on Explorer: Click on See on Explorer to view the transaction details and the data gathered from the Oracle.

Voila! You have your winner, selected through a truly random process on the Theta Network.

Last updated