1

I write a smart contract and want to use oraclize for getting random number. Are there any differences between those methods:

Using WolframAlpha:

oraclize_query("WolframAlpha", "random number between 1 and 2^64");

Using Random.org:

oraclize_query(
     "URL",
     "json(https://api.random.org/json-rpc/1/invoke).result.random.data.0",
     '\n{"jsonrpc":"2.0","method":"generateIntegers","params":{"apiKey":"9844ab4d-52ef-4587-9cf3-20a6930a7f6e","n":1,"min":1,"max":1000,"replacement":true,"base":10},"id":1}');

Using oraclize random method:

bytes32 queryId = oraclize_newRandomDSQuery(delay, N, callbackGas); 

In term of price, I see that:

  • WolframAlpha: 0.03$/query. unlimited queries.
  • Random.org: 0.01$/query. only 1000 requests/day (limited by random.org)
  • oraclize_newRandomDSQuery: 0.05$/query.

Please tell me differences in functionality. Thanks

1 Answer 1

2

The random data source query is designed so that assuming the ledger hardware enclave isn't compromised, your contract can verify that Oraclize really gave you a random number.

Using Wolfram Alpha or random.org require you to trust those organisations, plus Oraclize and their CDNs, any of whom could cheat undetectably.

3
  • thanks. so in production we should use random data source query, right ?
    – hqt
    Commented Jun 9, 2018 at 11:55
  • Yes, if you can afford it for your use-case. Or better, if possible design your thing so you don't have to use a third-party service... Commented Jun 10, 2018 at 3:13
  • 1
    Thanks so much :D I have a problem when using "oraclize_newRandomDSQuery" function. Can you help me to figure out. I ask here: ethereum.stackexchange.com/questions/50857/… thanks
    – hqt
    Commented Jun 10, 2018 at 12:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.