> For the complete documentation index, see [llms.txt](https://docs.chiliz.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.chiliz.com/fr/developper/notions-avancees/generer-des-nombres-aleatoires.md).

# Générer des nombres aléatoires on-chain

Générez des nombres aléatoires cryptographiquement sécurisés sur Chiliz Chain en utilisant Pyth Entropy : idéal pour les mints de NFTs, les mécaniques de jeu et les marchés de prédiction.

La vraie aléatoire est un sujet difficile en informatique, et il est difficile de l'obtenir par vous-même. Lorsque l'aléatoire est essentiel à votre projet, nous vous conseillons d'utiliser un Générateur de Nombres Aléatoires (RNG) réputé.

## Qu'est-ce qu'un RNG ?

En produisant des séquences de nombres qui ne peuvent pas être prédites, les RNGs garantissent l'équité et l'unicité dans les projets blockchain. Cela renforce l'intégrité et la fiabilité en empêchant la manipulation et en garantissant des résultats équitables.

## Que cela signifie-t-il pour les développeurs Chiliz Chain ?

En incorporant des RNGs, les projets sportifs et de divertissement peuvent considérablement renforcer la confiance, l'excitation et l'équité de ce qu'ils proposent.

## Comment procéder avec Pyth ?

Chiliz Chain supporte l'Entropy de Pyth.

Entropy permet aux développeurs de générer rapidement et facilement des nombres aléatoires sur la blockchain pour des applications telles que les mints de NFTs, le gaming, et plus encore.\
Via le SDK Solidity, cela permet aux développeurs d'intégrer facilement le RNG dans leurs applications EVM.

{% hint style="info" %}
Utilisez les adresses suivantes pour utiliser Entropy avec Chiliz.

#### Sur Chiliz Mainnet

* Chain ID :\
  `chiliz`
* Adresse du contrat Entropy :\
  `0x0708325268dF9F66270F1401206434524814508b`
* Provider :\
  `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`

#### Sur Spicy Testnet

* Chain ID :\
  `chiliz-spicy`
* Adresse du contrat Entropy :\
  `0xD458261E832415CFd3BAE5E416FdF3230ce6F134`
* Provider :\
  `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`
  {% endhint %}

Pyth propose un ensemble complet de [documentation sur Entropy](https://docs.pyth.network/entropy), incluant :

* [Créez votre première application Entropy sur EVM](https://docs.pyth.network/entropy/create-your-first-entropy-app)
* [Comment générer des nombres aléatoires dans des contrats EVM en utilisant Pyth Entropy](https://docs.pyth.network/entropy/generate-random-numbers/evm)
* [Une application exemple démontrant comment utiliser Pyth Entropy pour lancer une pièce équitable](https://github.com/pyth-network/pyth-crosschain/blob/main/target_chains/ethereum/examples/coin_flip/contract/src/CoinFlip.sol).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.chiliz.com/fr/developper/notions-avancees/generer-des-nombres-aleatoires.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
