Generating Randomness
Many applicative use cases are dealing with generating randomness. On klave, randomness generation can be used in the context of query
via a true random number generator, and transaction
via a pseudo random number generator in order to derive the same randomness on each nodes of the cluster.
In both case, this is transparently done in a safe, secure and trustless way (within enclaves, nobody can access, guess or tamper with the random seed).
Generating randomness within Application
To generate randomness within application Klave expose a simple API as part of the SDK.
Class | Operation | Parameters | Returns | Behavior |
---|---|---|---|---|
Crypto | getRandomValues | size: i32 | Uint8Array or null | Return an Uint8Array of size size or null if error |