# Proof of Integrity

The integrity proof links a unique physical coin to a deterministic registry token ID. This is a **verifiable commitment**, not a zero-knowledge proof. See [ZK Roadmap](/numex-docs/zero-knowledge-proofs/zk-roadmap.md) for planned privacy features.

## Fingerprint

A fingerprint is a human-readable identity string for the physical asset:

```txt
Numex Coin | {grading_company} {cert_number_or_internal_uid} | {year} {mint_mark} {denomination} {series} | {grade} | {vault_item_uid}
```

## Proof Mapping

```mermaid
flowchart LR
  A["Human-readable fingerprint"] --> C["keccak256"]
  B["Salt"] --> C
  C --> D["Integrity proof: 0x...64 hex chars"]
  D --> E["Token ID: uint256(proof)"]
  E --> F["NumexRegistryV3 ERC-721 token"]
```

Current formula (on-chain, keccak256):

```solidity
bytes32 proof = keccak256(abi.encodePacked(fingerprint, salt));
uint256 tokenId = uint256(proof);
```

The TypeScript generation script uses `solidityPackedKeccak256` from ethers to produce contract-compatible hashes. See [Hash Conventions](/numex-docs/technology/hash-conventions.md) for why this differs from the SHA-256 used in reveal proofs.

## Ownership Assignment

```mermaid
flowchart TD
  A["Marketplace purchase"] --> C["Ownership assigned"]
  B["Pack reveal"] --> C
  C --> D["Integrity proof generated"]
  D --> E["Token ID derived"]
  E --> F["Chain anchor queued"]
```

A physical coin cannot be owned by two users simultaneously. Both marketplace purchase and pack reveal check that the coin is unowned before assigning custody.

## Relationship to ZK Proofs

The integrity proof is a **verifiable commitment**, not a zero-knowledge proof. It proves a specific physical coin maps to a specific token ID, but the fingerprint and salt are known to the verifier.

The [ZK Ownership Proof](/numex-docs/zero-knowledge-proofs/zk-ownership-proof.md) adds a privacy layer on top: it proves a user owns *some* asset in the registry without revealing *which* asset. The integrity proof links physical coins to on-chain tokens; the ZK proof enables private ownership claims over those tokens.

## Demo Caveat

The demo backfill uses deterministic salts so the proof mapping can be repeatedly verified. Production salts must be random, server-generated, protected, and revealed only when the product design intentionally discloses them.


---

# 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://numex-greenfield.gitbook.io/numex-docs/technology/proof-of-integrity.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.
