docs: onchain randomness guide#62
Conversation
Review: RandomnessMust fix
Suggestions
Verified
|
|
regarding we don't want to reference |
|
Correction to my previous review I made an error in the review posted earlier — please disregard the following items:
The Rust tuple destructuring item in the review may still be valid — that one is independent of the Apologies for the incorrect feedback. |
|
Feedback addressed:
Note: |
Covers raw_rand API, Motoko and Rust implementations, range generation, winner selection, getrandom/rand PRNG seeding, security considerations, and the random_maze example.
5a97c2f to
635058e
Compare
… API (no Finite class)
|
Feedback addressed:
|
Summary
raw_randmanagement canister API: caller constraints (update-only), 32-byte return, cycles costmo:core/Random—Random.blob()+Blob.toArraywith direct array indexing for entropy consumptionic_cdk::management_canister::raw_rand()with slice-based multi-value extractionrand::StdRng(getrandom integration)awaitrandom_mazeMotoko example for a full walkthrough (notes it predatesmo:coreand usesmo:base)Sync recommendation
informed by
dfinity/portal—docs/building-apps/integrations/randomness.mdx; informed bydfinity/cdk-rsandcaffeinelabs/motoko-core; no dedicated icskill exists for randomness/VRF