oasis-sdk icon indicating copy to clipboard operation
oasis-sdk copied to clipboard

Add CSPRNG to SDK

Open nhynes opened this issue 4 years ago • 3 comments

ChaCha20 seeded with the Header::encoded_hash should about do the trick, but with a BatchContextRng::reseed for people who have better entropy.

nhynes avatar Jun 09 '21 19:06 nhynes

How often do you need entropy? If once per epoch is enough it would be better to use the consensus layer's random beacon for the epoch. Or a mix of the two.

kostko avatar Jun 09 '21 19:06 kostko

Me personally? I'm not using randomness. I don't know if other people need more entropy, but reseeding using the random beacon every epoch would get closer to not needing oracular entropy.

nhynes avatar Jun 10 '21 04:06 nhynes

Yeah I'm just saying that if the SDK provides such an API it should by default mix in the entropy from the random beacon for the current epoch.

kostko avatar Jun 10 '21 07:06 kostko