From 9b29e4a3affb15d2160a659768488ee146108107 Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef <50252200+tarakby@users.noreply.github.com> Date: Mon, 12 May 2025 13:46:52 -0500 Subject: [PATCH 1/4] randomness doc --- docs/tools/kit/index.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/tools/kit/index.md b/docs/tools/kit/index.md index 70a5bc521c..ca7b20dcb5 100644 --- a/docs/tools/kit/index.md +++ b/docs/tools/kit/index.md @@ -377,11 +377,12 @@ function RandomValues() { #### Notes: -* Randomness is generated using Flow’s **on-chain `revertibleRandom`**, producing pseudorandom values tied to block and transaction execution. -* The value returned for identical calls within the same block will be identical. -* This hook is designed for simple use cases that **don’t require a [commit-reveal scheme]**, such as randomized UIs. -* For **more advanced use cases** that **do** require a [commit-reveal scheme], Flow provides built-in support for that pattern. -* Values are **deterministic**: if a transaction fails and retries, the same random value will be regenerated. +* Randomness is generated using Flow’s **on-chain `revertibleRandom`**, producing pseudorandom values tied to block and script execution. +* Values are **deterministic**: The values returned for identical calls within the same block will be identical. +* If `count ` is larger than one, the returned values are disctinct. +* This hook is designed for simple use cases that don't require unpredictability, such as randomized UIs. + Since the hook uses script executions on existing blocks, Flow's randon source is already public and the randoms are predictable. +* For **more advanced use cases** that **do** require on-chain randomness logic via transactions, Flow provides built-in support using Cadence's `revertibleRandom` and [commit-reveal scheme]. --- From 1c1577d0d57bb5be6ee5ab00c98bef37ce9720b0 Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 12 May 2025 16:00:31 -0400 Subject: [PATCH 2/4] Update docs/tools/kit/index.md --- docs/tools/kit/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/kit/index.md b/docs/tools/kit/index.md index ca7b20dcb5..ed6050d2e6 100644 --- a/docs/tools/kit/index.md +++ b/docs/tools/kit/index.md @@ -377,7 +377,7 @@ function RandomValues() { #### Notes: -* Randomness is generated using Flow’s **on-chain `revertibleRandom`**, producing pseudorandom values tied to block and script execution. +* Randomness is generated using the **on-chain `revertibleRandom`** function on Flow, producing pseudorandom values tied to block and script execution. * Values are **deterministic**: The values returned for identical calls within the same block will be identical. * If `count ` is larger than one, the returned values are disctinct. * This hook is designed for simple use cases that don't require unpredictability, such as randomized UIs. From 2726b236fbf68cc1f5e702a4f87df5ea2db1e94e Mon Sep 17 00:00:00 2001 From: Brian Doyle Date: Mon, 12 May 2025 16:00:37 -0400 Subject: [PATCH 3/4] Update docs/tools/kit/index.md --- docs/tools/kit/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/kit/index.md b/docs/tools/kit/index.md index ed6050d2e6..407107b619 100644 --- a/docs/tools/kit/index.md +++ b/docs/tools/kit/index.md @@ -381,7 +381,7 @@ function RandomValues() { * Values are **deterministic**: The values returned for identical calls within the same block will be identical. * If `count ` is larger than one, the returned values are disctinct. * This hook is designed for simple use cases that don't require unpredictability, such as randomized UIs. - Since the hook uses script executions on existing blocks, Flow's randon source is already public and the randoms are predictable. + Since the hook uses script executions on existing blocks, the random source is already public and the randoms are predictable. * For **more advanced use cases** that **do** require on-chain randomness logic via transactions, Flow provides built-in support using Cadence's `revertibleRandom` and [commit-reveal scheme]. --- From c7b66b6ea085eb56e54f47e6fcb030a5c7026b3a Mon Sep 17 00:00:00 2001 From: Tarak Ben Youssef <50252200+tarakby@users.noreply.github.com> Date: Mon, 12 May 2025 16:12:22 -0500 Subject: [PATCH 4/4] Update docs/tools/kit/index.md Co-authored-by: Chase Fleming --- docs/tools/kit/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/tools/kit/index.md b/docs/tools/kit/index.md index 407107b619..315ae01973 100644 --- a/docs/tools/kit/index.md +++ b/docs/tools/kit/index.md @@ -379,7 +379,7 @@ function RandomValues() { * Randomness is generated using the **on-chain `revertibleRandom`** function on Flow, producing pseudorandom values tied to block and script execution. * Values are **deterministic**: The values returned for identical calls within the same block will be identical. -* If `count ` is larger than one, the returned values are disctinct. +* If `count ` is larger than one, the returned values are distinct. * This hook is designed for simple use cases that don't require unpredictability, such as randomized UIs. Since the hook uses script executions on existing blocks, the random source is already public and the randoms are predictable. * For **more advanced use cases** that **do** require on-chain randomness logic via transactions, Flow provides built-in support using Cadence's `revertibleRandom` and [commit-reveal scheme].