# Verifying Results

Crypta will immediately reveal to the public each hash after it is used.

Anyone can independently:

### 1) **Verify that the Hash is Part of the Original Committed Chain:**

$$
SHA512(H\_{n}) = H\_{n+1}
$$

### 2) **Verify the Randomness Hash:**

$$
SHA512(H\_n + Salt) = pmHASH\_n
$$

You can use any independent third party SHA-512 hash generator for step 1 and 2 or run the Python code below.&#x20;

If verifying only the chain hash, leave `salt_hash = ""`.

```python
import hashlib

# === Step 1: Input the revealed hash and optional salt ===
chain_hash = "e1f4c3b2a8d1234567890abcdeffedcba9876543210ffeeddccbbaa9988776655"
salt_hash  = ""  # Leave empty to verify the chain only

# === Step 2: Concatenate and hash ===
combined_text = chain_hash + salt_hash
pmHASH = hashlib.sha512(combined_text.encode()).hexdigest()

print("pmHASH:", pmHASH)

```

* If `salt_hash` is left empty, the result is the **next hash in the chain** (`Hₙ₊₁`).
* If `salt_hash` is filled in, the result is the **randomness hash** (`pmHASH`) used to generate price movements.

### 3) **Verify the Price Movements from the pmHASH:**

Use the python code below to derive the price movements generated from any `pmHASH`:

```python
import math

# === User Inputs ===
pmHASH = "af939b318736bb7dc7eb6014770097572eeb28d82a329cdefa70b6e79ba4c46ddadbf9a1a34d2c25be1771ad6c16be127a51b4ef43c9f03db3e44fd4ed836743"
standard_deviation = 5.0  # You can change this if needed

# === Price Movement Derivation ===
def derive_price_movements_from_pmhash(pm_hash: str, sigma: float = 5.0):
    movements = []
    for i in range(8):
        start = i * 13
        end = start + 13
        hex_block = pm_hash[start:end]
        u_int = int(hex_block, 16)
        u_prime = u_int / 2**52

        if i % 2 == 1:
            u1 = movements[-1]["u_prime"]
            u2 = u_prime
            if u1 == 0:
                u1 = 1e-10
            z0 = math.sqrt(-2.0 * math.log(u1)) * math.cos(2 * math.pi * u2)
            z1 = math.sqrt(-2.0 * math.log(u1)) * math.sin(2 * math.pi * u2)
            movements[-1]["m"] = z0 * sigma
            movements.append({"u_prime": u2, "m": z1 * sigma})
        else:
            movements.append({"u_prime": u_prime})

    return [round(m["m"], 6) for m in movements]

# === Run the Derivation ===
price_movements = derive_price_movements_from_pmhash(pmHASH, standard_deviation)
print("Price Movements:", price_movements)

```

### Summary

* **Hash Chain Integrity**: Confirm that `SHA512(Hₙ) == Hₙ₊₁` to verify the hash is part of the committed chain.
* **Randomness Integrity**: Confirm that `SHA512(Hₙ + salt)` equals the published `pmHASH`.
* **Movement Verification**: Use the `pmHASH` to generate 8 reproducible price movements via the documented Box-Muller transformation.


---

# Agent Instructions: 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://crypta.gitbook.io/crypta/crypta-exchange/verifyingresults.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.
