arrng.io
  • Introduction
  • Supported Chains
  • How it works
  • RNG Source
  • Getting a cost estimate
  • Implementing in your contract
  • Verifiying RNG
  • Controller contract addresses
  • Fee
  • Refunds
  • arrscan.io
Powered by GitBook
On this page

How it works

PreviousSupported ChainsNextRNG Source

Last updated 1 year ago

Unlike other verifiable RNG options, you don't need to buy an ERC-20 that you custody in a smart contract, figure out channel hashes and limits, or make additional HTTP calls to serve your RNG.

With arrng the process is simple.

  • You call the controller contract to request randomness.

  • With that call you pass sufficient native token (e.g. ETH) for the reply from the controller.

  • The controller will then reply with your verifiable off-chain RNG, together with a refund of any native token not used by the request.

  • And that's it!

To break the process down into more detail:

  1. You need to determine how much native token (e.g. ETH) to send with the call. Dapps can easily retrieve this information from the arrng api. Please see for details.

  2. This native token is then sent on the call to your contract when you are requesting RNG. Your contract then passes it to the arrng controller contract.

  3. Once a request is received the arrng protocol will wait for a set number of confirmations before taking action. It will then request RNG directly from random.org.

  4. Once the reply from random.org is received the controller contract will send a reply transaction to your contract with the RNG and any native token not used by a) the gas required for the reply and b) the arrng fee.

getting a cost estimate