diff --git a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md index c41f75a9315..32ebf5f98ae 100644 --- a/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md +++ b/docs/build/isc/v1.0.0-rc.6/docs/how-tos/get-randomness-on-l2.md @@ -15,11 +15,15 @@ tags: # Get Randomness on L2 -In the ISC protocol, each validator proposes a batch of smart contract requests they would like to process next. They commit to their proposals with a signature, after which a common subset of requests is found and a combined signature is produced. This combined signature is unpredictable, and not only serves as protection against MEV by pseudo-randomly ordering requests, but also provides a source of verifiable entropy for randomness on L2. +ISC introduces a feature not found on many other smart contract protocols: randomness. + +In the ISC protocol, for each state update each validator proposes a batch of smart contract requests they would like to process next. They commit to their proposals with a signature, after which a common subset of requests is found and a combined signature is produced. + +This combined signature is unpredictable, and not only serves as protection against MEV by pseudo-randomly ordering requests, but also provides a source of verifiable entropy for randomness on L2. This guide will show ways you can use this entropy to generate random values in your contracts. -:::info A note obout entropy +:::info A note about entropy While entropy is random for each smart contract request, entropy is constant within a request. This means multiple calls to get entropy within the same request will return the same value. @@ -103,7 +107,7 @@ And then cast the digest to an integer: uint256 value = uint256(digest); ``` -### Generating integers +### Generating bytes Similarly to generating a random integer, you can generate any sequence of random bytes by taking the entropy and a unique nonce and hash them together: