> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpectrum.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# xpress

> The Xpectrum launch engine: folder in, collection out

`xpress` is the engine behind the Launchpad, available as a standalone tool. It validates, generates, hashes, deploys, and verifies NFT collections on Octra per the [Metadata Standard](/standards/metadata). The same core powers the in-app Launch wizard and the CLI, so a collection that passes xpress renders on Xpectrum.

It exists so that people who do not trust Xpectrum can still check Xpectrum: every step is re-derivable from public on-chain data.

<Note>
  The package and its source are being prepared for public release. Install and repository links will be published here. Until then, the Launchpad runs the same engine end to end.
</Note>

## The flow

<Steps>
  <Step title="Generate (optional)">
    Build all token JSONs and `collection.json` from exact rarity quotas, pinned 1/1s, and pairing rules. Quotas are promises: "10 legendaries" means exactly 10, with computed rarity percentages. Infeasible configs fail at validation, never on-chain.
  </Step>

  <Step title="Check">
    Validate schema, token continuity (`0.json..(N-1).json`), trait coverage, slug collisions, and the size budget. Nothing goes on-chain until this is clean.
  </Step>

  <Step title="Hash">
    Compute the provenance hash from local bytes. The creator commits it on-chain with `set_provenance_hash(hash)` before mint opens. From that moment the assignment is locked.
  </Step>

  <Step title="Deploy">
    Provision the Circle and publish the collection. The rarity-revealing metadata is held back until reveal so nobody can read rarity during the mint.
  </Step>

  <Step title="Verify (anyone, forever)">
    Re-download the collection from chain, recompute the hash, and compare it to `get_provenance_hash()`. The result is cryptographic: VERIFIED or NOT VERIFIED.
  </Step>
</Steps>

## CLI shape

```bash theme={"system"}
xpress check  ./my-collection      # validate everything, touch nothing
xpress hash   ./my-collection      # provenance hash, computed locally
xpress deploy ./my-collection      # provision the circle + publish
xpress verify oct1coll...          # anyone, anywhere, no trust required
```

`verify` is the important one. It is proven end to end against live chain state: a collection generated, deployed, its provenance hash committed on an `Xcollection` contract, and `verify` returning VERIFIED off live chain state, while correctly returning NOT VERIFIED for a tampered collection.

## Library use

The core is pure TypeScript with no DOM, framework, or database dependency. Signers are pluggable.

```ts theme={"system"}
import {
  loadFolder, validateFolder, generateCollection,
  computeProvenanceHash, verifyCollection, OctraRpc,
} from '@xpectrum/xpress';

const snapshot = loadFolder('./my-collection');
const report = validateFolder(snapshot);
if (!report.ok) throw new Error('fix the folder first');
const hash = computeProvenanceHash({ snapshot, supply: report.supply });
```

## Generator config

A generative collection is described by trait quotas that sum to the supply, optional pinned 1/1s, and optional pairing/exclusion rules:

```json theme={"system"}
{
  "name": "Xpectrum Wraiths",
  "supply": 1024,
  "category": "pfp",
  "mutability": "frozen_by_provenance",
  "traits": [
    { "name": "Background", "layer_order": 10, "values": [
      { "name": "Gold", "quota": 10 },
      { "name": "Midnight Blue", "quota": 1014 } ] }
  ],
  "pinned": [
    { "name": "The Gilded One", "attributes": { "Background": "Gold" } }
  ]
}
```

Each trait's quotas must sum to the supply (model "no aura" as an explicit value). Full trait combinations are unique by default. The generator runs on your machine; commit-first proves the assignment did not change after mint, which is the property [provenance](/standards/provenance) verifies.
