LOCAL-TRUE · not on-chain

Dual-state · sealed marketplace

Night Market Studio

World-class educational marketplace for Midnight’s dual-state model: publish a sealed listing (public title + commitment hash), collect private bids whose amounts stay in the vault, then prove a bid meets the reserve without revealing either number — or award & selectively disclose when the stall closes. By @kshot9000 · nightdream.xyz.

Honest scope: local HTML/JS simulation only. Does not run Compact, a proof server, Lace, or real ADA / DUST transfers. Does not claim GitHub Pages is live until Actions are enabled. SHA-256 commitments here are a teaching stand-in — verify against official Compact / Zswap crypto before shipping.

Market journey

Labeled phases from sealed stall → private bids → award / disclose. Reject is first-class.

  1. 1
    Idle No open stalls
  2. 2
    Listed Public title + commitment
  3. 3
    Bidding Sealed bids on the stall
  4. 4
    Awarded Winner + selective disclose

Phase: idle — seal a listing to open the night market.

The dual-state stall in one screen

Observers see titles and commitment hashes. Reserves and bid amounts stay in the private vault until you choose to disclose.

Public ledger

Marketplace board

Simulated public state holds listing metadata + H(reserve ‖ details ‖ salt ‖ domain) and bid commitments — never clear amounts.

  • Listing title / category (clear)
  • Listing commitment hash
  • Bid commitment hashes + bidder tags
  • Award flag / disclose tags
Private vault

Local witnesses

Reserve, details, bid amounts, and salts live in localStorage — a stand-in for Compact witnesses that never leave the client.

  • reserveAda (seller)
  • details (private listing body)
  • bidAda (each bidder)
  • salt (32-byte hex)

Sealed rail

Stalls with veiled reserves and sealed bids. Observers see commitments only.

100% veiled (no stalls yet)

Disclose rail

Awards and selective reveals — range (met reserve) or full amount disclose.

0% disclosed

Seal a listing

Title stays public. Reserve + private details seal into a commitment before the stall opens.

Listing draft

Visible on the board. Keep it tasteful — no secrets here.
Stays in the vault. Used by bid-threshold theater.

0/280

Vault preview SIMULATED

Salt
—
Reserve
—
Details
—
Commitment
—

Opening publishes title + commitment only. Reserve stays sealed.

Place a private bid

Pick an open stall. Your bid amount seals into a commitment; only the hash hits the public board.

Bid form

What the board learns

  • Sees: bidder tag + bid commitment hash + timestamp
  • Does not see: bid amount, whether it clears reserve
  • Prove later: use Bid theater to show bid ≥ reserve without numbers

Educational only — no wallet, no settlement, no Compact proof.

Bid theater SIMULATED

Prove a sealed bid meets the listing reserve — or reject. Exact amounts stay veiled unless you disclose.

Prove reserve clearance

Last proof
No proof yet
LOCAL-TRUE

Theater log

Awaiting proofs…

Night stalls

Public marketplace board — commitments first, amounts only after selective disclose. Schema v2 localStorage · BroadcastChannel sync · JSON export/import. LOCAL-TRUE ≠ on-chain.

Stalls: 0 Bids: 0 Awarded: 0

Anti-pattern vs safe pattern

Teaching sketches — not deployable Compact. Always verify against official docs.

✗ Anti-pattern — clear reserve on-chain
// BAD: public ledger sees the floor
ledger {
  reserve: Uint<64>;  // observers learn the floor
  title: Bytes<64>;
}
✓ Safer sketch — commit + witness
// BETTER (sketch): public commitment only
ledger {
  listingCommit: Bytes<32>;
  title: Bytes<64>;
}
witness reserveAda: Uint<64>;
// prove bid ≥ reserve without publishing either

These snippets are educational illustrations. Official Compact syntax, circuits, and Zswap commitments may differ — check Midnight docs before shipping.