Skip to content

Commit

Permalink
wip: extra randomness context
Browse files Browse the repository at this point in the history
  • Loading branch information
okhaimie-dev committed Jul 23, 2024
1 parent 5a7f68a commit e7a1f31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Summary
- [Simple Storage with Starknet-js](./applications/simple_storage_starknetjs.md)
- [Crowdfunding Campaign](./applications/crowdfunding.md)
- [AdvancedFactory: Crowdfunding](./applications/advanced_factory.md)
- [Dice Game VRF](./ch01/dice_game_vrf.md)
- [Dice Game VRF](./applications/dice_game_vrf.md)

<!-- advanced-concepts -->

Expand Down
8 changes: 7 additions & 1 deletion src/applications/dice_game_vrf.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
# Dice Game using Pragma VRF
# Randomness: Dice Game using Pragma VRF

## Understanding Randomness on the Blockchain

Randomness in blockchain applications is a challenging problem due to the deterministic nature of blockchains. In a blockchain, the same input always produces the same output, which conflicts with the need for unpredictable, random numbers in many applications. This determinism is crucial for consensus and verification but presents obstacles for use cases requiring randomness, such as fair selection in consensus mechanisms, lottery systems, or gaming applications.

One approach to generate randomness on the blockchain is the use of Verifiable Random Functions (VRFs). A VRF is a cryptographic function that generates a random number along with a proof of its correct generation. This proof can be verified by anyone, ensuring transparency and fairness.

This code provides an implementation of a Dice Game contract that utilizes a [Pragma Verifiable Random Function (VRF)](https://docs.pragma.build/Resources/Cairo%201/randomness/randomness) to generate random numbers on-chain.

Expand Down

0 comments on commit e7a1f31

Please sign in to comment.