# Architecture Overview

Numex uses a web-first architecture with on-chain infrastructure on Base.

```mermaid
flowchart TB
  subgraph Buyer["Collector Experience"]
    A["Marketplace"]
    B["thirdweb Payments"]
    C["Reveal UI"]
    D["Portfolio"]
    E["Redemption"]
  end

  subgraph Backend["Numex Backend"]
    F["Postgres Database"]
    G["Pack Inventory + Odds"]
    H["Integrity Proofs"]
    I["Chain Transaction Queue"]
  end

  subgraph Chain["Base (On-Chain)"]
    J["NumexRegistryV3"]
    K["NumexMarketplaceSettlement"]
  end

  A --> B --> C --> D --> E
  C --> G
  D --> H
  H --> I
  I --> J
  B --> K
  K --> J
  F --> G
  F --> H
```

## Principles

* The collector experience is about coins, vaulting, redemption, and proof — not crypto complexity
* On-chain infrastructure provides auditability, atomic settlement, and verifiable integrity
* Database state, contract state, and custody state reconcile before production claims are made
* A physical coin cannot be owned by two users simultaneously
* Payments are settled in USDC on-chain; buyers pay with card or crypto via thirdweb Payments

## Proof Architecture

| Component               | Technique                                         | Status      |
| ----------------------- | ------------------------------------------------- | ----------- |
| Custody integrity proof | `keccak256(fingerprint, salt)` on-chain NFT       | Live        |
| Pack pool commitment    | keccak256 Merkle root with on-chain verification  | Deployed    |
| Reveal fairness         | Deterministic commit-reveal with Merkle inclusion | Live        |
| Marketplace settlement  | Atomic USDC split with idempotent saleRef         | Deployed    |
| ZK ownership proof      | Noir circuit for private verification             | Implemented |

Current proofs are **verifiable commitments**. See [ZK Roadmap](/numex-docs/zero-knowledge-proofs/zk-roadmap.md) for the planned transition to zero-knowledge proofs.

## Marketplace and Ownership

* Coins are freely transferable ERC-721 tokens on Base
* Marketplace purchases settle atomically on-chain (USDC → token transfer + residual split)
* Pack reveals assign single-owner custody via verified payment
* Curator residuals accrue on each resale and are claimable on-chain
* Both marketplace purchase and pack reveal require completed payment before ownership transfers


---

# 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/overview.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.
