Zilliqa / scilla

Scilla - A Smart Contract Intermediate Level Language
https://scilla-lang.org
GNU General Public License v3.0
240 stars 79 forks source link

Implementing Randao for random number generation #68

Open AmritKumar opened 6 years ago

AmritKumar commented 6 years ago

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 commented 6 years ago

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

ilyasergey commented 6 years ago

@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).

snowsledge commented 5 years ago

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

vaivaswatha commented 5 years ago

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

@evesnow91 can you elaborate?

AmritKumar commented 5 years ago

@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.