> For the complete documentation index, see [llms.txt](https://doc.cryptostone.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.cryptostone.org/crypto-stone/crypto-stone-wp-kr/gem-attributes/30_-_-_-_.md).

# 30 속성 생성과 랜덤

보석의 속성은 운영자가 수동으로 입력하지 않는다. 채굴 시점에 마이닝 컨트랙트가 랜덤값을 기반으로 Weight, Color, Clarity, Cut을 결정한다.

중요한 점은 랜덤 생성 방식이 검증 가능해야 한다는 것이다. 만약 운영자가 임의로 높은 등급의 NFT를 생성할 수 있다면 CryptoStone의 탈중앙성과 희소성은 훼손된다.

따라서 CryptoStone의 랜덤 생성 방식은 다음 원칙을 따른다.

| 원칙              | 설명                                                |
| --------------- | ------------------------------------------------- |
| 사전 예측 불가        | 운영자와 사용자 모두 결과를 사전에 알 수 없어야 한다.                   |
| 결과 선택 불가        | 운영자가 유리한 결과만 선택하거나 불리한 결과를 거부할 수 없어야 한다.          |
| 재시도 방지          | 랜덤 요청 이후 결과 확정 전 사용자가 claim을 취소하거나 재시도할 수 없어야 한다. |
| Admin Reroll 금지 | 운영자는 특정 결과를 재추첨하거나 대체할 수 없어야 한다.                  |
| 공개 검증           | 결과 생성 과정은 온체인 또는 공개 검증 가능한 방식이어야 한다.              |
| 확률표 고정          | 속성 확률표는 배포 전 공개되고 finalize 이후 변경될 수 없어야 한다.       |
| 민팅 후 불변         | 민팅 이후 속성은 변경될 수 없어야 한다.                           |

CryptoStone의 GEMS 생성 로직은 사용자 제공 엔트로피, 최근 다중 블록 엔트로피, Ethereum `prevrandao`, Claim 상태값, 컨트랙트 고유값을 조합하여 난수 시드를 생성한다. 이를 통해 특정 단일 랜덤 요소에 대한 의존도를 낮추고, 결과 예측 가능성을 줄이는 구조를 지향한다.

| Entropy Source             | 역할                                                |
| -------------------------- | ------------------------------------------------- |
| User Entropy               | 사용자 트랜잭션에서 제공되는 외부 입력값                            |
| Recent Multi-Block Entropy | 최근 블록 구간에서 선택된 여러 블록해시                            |
| `prevrandao`               | Ethereum 실행 환경이 제공하는 블록 단위 난수성                    |
| Claim State                | positionId, claimNonce, 누적 claim 수, tokenId 등 상태값 |
| Contract Values            | 컨트랙트 주소, chainId, 풀 고유값                           |

구현 관점에서는 최근 블록 구간 중 일부 블록을 선택하고, 선택된 블록해시와 사용자 엔트로피, Claim 상태값, 컨트랙트 고유값을 함께 해시한다. 이 구조는 단일 직전 블록해시나 운영자 입력값 하나에 의존하지 않도록 설계된다.

$$
\begin{aligned}
S &= H(userEntropy, user, positionId, claimNonce, prevrandao, chainId, contract) \\
B\_i &= blockhash(blockNumber - 1 - (H(S,i) \bmod 30)) \quad for\ i \in {0,1,2,3,4} \\
R &= H(userEntropy, B\_0, B\_1, B\_2, B\_3, B\_4, prevrandao, claimState, contractState)
\end{aligned}
$$

최종 시드 `R`은 Weight, Color, Clarity, Cut 속성 추첨에 사용된다. 동일한 시드에서 각 속성별 하위 시드를 분리하여 사용함으로써 하나의 속성 결과가 다른 속성 결과를 직접 결정하지 않도록 한다.

랜덤 결과가 요청된 이후 사용자는 결과가 불리하다는 이유로 claim을 취소하거나 재시도할 수 없어야 한다. 운영자 또한 특정 사용자에게 유리한 결과를 배정하거나, 특정 속성 조합이 나오도록 seed를 선택할 수 없어야 한다. 이는 희귀 보석의 생성이 운영자의 재량이 아니라 검증 가능한 랜덤 구조에 의해 결정되도록 하기 위한 핵심 조건이다.

민팅 이후 Gem NFT의 핵심 속성은 freeze되어야 하며, Weight, Color, Clarity, Cut, stoneType, minedAt, minedFromPool과 같은 핵심 metadata는 운영자에 의해 변경될 수 없어야 한다.

장기적으로는 외부 검증 인프라 또는 CryptoStone 네트워크 자체의 검증 구조를 추가할 수 있다. 다만 백서의 기본 원칙은 특정 단일 랜덤 요소가 전체 결과를 좌우하지 않도록 여러 독립 입력값을 조합하는 데 있다.


---

# 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, and the optional `goal` query parameter:

```
GET https://doc.cryptostone.org/crypto-stone/crypto-stone-wp-kr/gem-attributes/30_-_-_-_.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
