> For the complete documentation index, see [llms.txt](https://zokyo-auditing-tutorials.gitbook.io/zokyo-tutorials/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zokyo-auditing-tutorials.gitbook.io/zokyo-tutorials/tutorial-43-on-chain-randomness.md).

# Tutorial 43: On-Chain Randomness

{% hint style="info" %}
[**Book an audit with Zokyo**](https://www.zokyo.io/)
{% endhint %}

In decentralized applications (dApps), randomness plays a crucial role in a variety of use cases, from  decentralized protocols requiring unpredictable outcomes. However, **on-chain randomness** introduces significant challenges in ensuring that the random values generated are not predictable or exploitable by malicious actors. When randomness is generated directly on-chain, it can be subject to manipulation, making it a prime target for attackers looking to gain an unfair advantage.

In this section, we will explore how on-chain randomness is typically implemented, the potential vulnerabilities it introduces, and how these weaknesses can be exploited. By understanding the risks associated with on-chain randomness, we can discuss best practices and strategies to create more secure and tamper-resistant systems.
