> 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/jp/kaihatsu/joukyu/onchain-rng.md).

# オンチェーンで乱数を生成する

真の乱数性はコンピュータサイエンスにおける難題であり、自力で実現するのは困難です。乱数性がプロジェクトの要となる場合は、評判の高い乱数生成器（RNG）の利用をおすすめします。

## RNG とは？

予測できない数列を生成することで、RNG はブロックチェーンプロジェクトにおける公平性と一意性を保証します。これにより、操作を防ぎ、公正な結果を保証することで、完全性と信頼性が高まります。

## Chiliz Chain 開発者にとっての意味

RNG を取り入れることで、スポーツ＆エンターテインメント分野のプロジェクトは、提供するものの信頼性、興奮、公平性を大きく高めることができます。

## Pyth を使った実装方法は？

Chiliz Chain は Pyth の Entropy をサポートしています。

Entropy を使うと、開発者は NFT ミントやゲームなどのアプリケーション向けに、ブロックチェーン上で乱数をすばやく簡単に生成できます。\
Solidity SDK を通じて、開発者は自分の EVM アプリケーションに RNG を簡単に統合できます。

{% hint style="info" %}
Chiliz で Entropy を使用するには、以下のアドレスを使用してください。

#### Chiliz Mainnet 上

* Chain ID:\
  `chiliz`
* Entropy Contract Address:\
  `0x0708325268dF9F66270F1401206434524814508b`
* Provider:\
  `0x52DeaA1c84233F7bb8C8A45baeDE41091c616506`<br>

#### Spicy Testnet 上

* Chain ID:\
  `chiliz-spicy`
* Entropy Contract Address:\
  `0xD458261E832415CFd3BAE5E416FdF3230ce6F134`
* Provider:\
  `0x6CC14824Ea2918f5De5C2f75A9Da968ad4BD6344`
  {% endhint %}

Pyth は、以下を含む [Entropy に関する充実したドキュメント](https://docs.pyth.network/entropy)を提供しています。

* [EVM で最初の Entropy アプリを作成する](https://docs.pyth.network/entropy/create-your-first-entropy-app)
* [Pyth Entropy を使って EVM コントラクトで乱数を生成する方法](https://docs.pyth.network/entropy/generate-random-numbers/evm)
* [Pyth Entropy を使って公平なコイントスを行う方法を示すサンプルアプリケーション](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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.chiliz.com/jp/kaihatsu/joukyu/onchain-rng.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
