scilla icon indicating copy to clipboard operation
scilla copied to clipboard

Implementing Randao for random number generation

Open AmritKumar opened this issue 7 years ago • 5 comments

https://github.com/randao/randao/blob/master/contracts/Randao.sol. There is a more secure version called Randao++. But this will require zero-knowledge proofs. For now, we can go with Randao. It will only require hashing.

AmritKumar avatar Jun 09 '18 08:06 AmritKumar

@ilyasergey This may require support for user defined data structure, e.g., struct.

AmritKumar avatar Jun 13 '18 06:06 AmritKumar

@AmritKumar Not sure. Records can be always modelled via pairs and appropriately implemented getters/setters (something we could think of for a higher-lever language).

ilyasergey avatar Jun 13 '18 09:06 ilyasergey

This will require support of hash for blockchain.json in the intepreter interface.

snowsledge avatar Sep 21 '18 06:09 snowsledge

This will require support of hash for blockchain.json in the intepreter interface.

@evesnow91 can you elaborate?

vaivaswatha avatar Sep 26 '18 15:09 vaivaswatha

@vaivaswatha What he meant was we need to add extra fields in blockchain.json to incorporate previous block's hash. So, instead of the following blockchain.json:

[
  { 
    "vname": "BLOCKNUMBER", 
    "type": "BNum", 
    "value": "100" 
  } 
]

we may want to have the following:

[
  { 
    "vname": "BLOCKNUMBER", 
    "type": "BNum", 
    "value": "100" 
  },
 { 
    "vname": "PREVBLOCKHASH", 
    "type": "ByStr32", 
    "value": "0x123456789012345678901234567890123456789012345678901234567890abff" 
  }
]

Maybe it's time we added TIMESTAMP too.

AmritKumar avatar Sep 26 '18 17:09 AmritKumar