# mimarketplace — spoke context

The user wants to browse, post, or buy items in mimarketplace — the C2C (consumer-to-consumer) marketplace inside Whoois.

If you haven't already, fetch `https://poc.whoois.app/whoois-context.md` for the root primer.

---

## What's mimarketplace.app?

A user-to-user marketplace surface in Whoois — like Etsy/eBay but inside any AI chat. Unlike mishopping.app (which has registered merchants with brand layers and structured catalogs), mimarketplace has **no merchant registry**: every participant is a Miuser. Sellers post listings; buyers browse and buy directly; transactions settle via the P2P infrastructure (the same passkey-gated money movement that powers `whoois_p2p_send` and `whoois_p2p_claim_accept`).

POC v0.1 is intentionally minimal:
- **Browse + post + Buy Now** — no auctions, no bidding
- **No photos** in v0.1 (text-only listings with a category-color accent)
- **Auto-settle** on purchase (no escrow, no seller-claim flow)
- **No reputation/feedback** system yet
- **No "my listings" view** yet
- Seed catalog: 8-10 listings from synthetic sellers, mixed across 10 categories

Post-MVP plan: mimarketplace.app carves out as its own MCP alongside mishopping.app (also carving out) and the new misports.app. POC v0.1 establishes the surface so audiences understand the C2C/P2P-powered marketplace shape before the carve-out happens.

---

## Trigger phrases

- "Browse mimarketplace"
- "Find {item} on Whoois marketplace"
- "Show me {category} for sale"
- "Sell my {item} on Whoois"
- "Post a marketplace listing"
- "What's for sale on mimarketplace?"
- "Buy {item} on Whoois"
- "I want to list my old guitar"

If the user mentions selling/buying/listing items peer-to-peer (vs from a registered merchant), this is mimarketplace intent. For shopping FROM merchants (Demo Coffee Co, Pretend Books, etc.), use `https://poc.whoois.app/context/mishopping.md`.

---

## Tools to call

**`mimarketplace_open`** — LLM-visible. Opens the marketplace iframe in browse state.

Arguments (all optional):
- `q` — substring search across title + description
- `category` — one of `vintage / electronics / art / books / music / home / fashion / sports / toys / other`

Returns active listings + the current user's seller profile (so the iframe knows which listings are their own).

**`mimarketplace_post_listing`** — visibility:app (iframe-only). Called from the create-listing form. Args: `title`, `description`, `price_cents`, `category`, `condition` (`new`/`like-new`/`good`/`fair`). Persists a new listing under the current user as seller.

**`mimarketplace_buy_now`** — visibility:app (iframe-only). Called when user taps "Buy now with passkey". Args: `listing_id`. Atomic markSold (race-safe); creates Mitrail receipt via shared helper. `payment:authorize` freshness consumed per call — each purchase requires a fresh WebAuthn ceremony.

---

## Iframe state machine

The iframe handles 7 states inside one resource:

1. **`loading`** — initial render
2. **`browse`** — listings grid + search + category filter + "Post a listing" CTA
3. **`listing-detail`** — single listing view; "Buy Now" CTA (or "Sold" badge, or "Your listing" badge if seller is current user)
4. **`create-listing`** — form (title / description / price / category / condition); "Post listing with passkey" CTA
5. **`buying`** — passkey ceremony in progress
6. **`purchased`** — success; "View receipt" CTA → Mitrail
7. **`posted`** — success; "Back to browse" CTA

---

## The 10 categories

Vintage, Electronics, Art, Books, Music, Home, Fashion, Sports, Toys, Other.

Each gets its own accent color in the iframe (category-color-bar on cards).

---

## Typical flows

### Browse + buy
1. User: *"Find vintage guitars on Whoois marketplace"*
2. Call `mimarketplace_open({ q: 'guitar', category: 'music' })` (or just `category: 'music'` if guitar is the q)
3. Iframe shows filtered listings
4. User taps a listing card → iframe transitions to listing-detail
5. User taps "Buy now with passkey" → `mimarketplace_buy_now({ listing_id })` fires internally
6. Passkey ceremony → atomic markSold → receipt in Mitrail
7. Tell the user: *"Purchased. Receipt in your Mitrail."*

### Post a listing
1. User: *"List my old record player on Whoois marketplace for $40"*
2. Call `mimarketplace_open()` → browse state
3. User taps "+ Post a listing" → iframe transitions to create-listing
4. User fills form (title/desc/price/category/condition) → taps "Post listing with passkey"
5. `mimarketplace_post_listing` fires internally → DDB write
6. Iframe shows posted state
7. Tell the user: *"Your listing is live. Other Whoois users can browse and buy it now."*

---

## Comparison vs mishopping

| Aspect | mishopping | mimarketplace |
|---|---|---|
| Sellers | 5 registered merchants with brand layers | Any Miuser, no registry |
| Catalog | Static (~100 SKUs) | Dynamic (Miuser-posted) |
| Cart | Multi-merchant, complex orchestration | Single-item per transaction |
| Money flow | Multi-merchant parallel auth fan-out | Inherits P2P infrastructure |
| Trust signal | ACO scoring on merchants | Seller's Miclock |
| Lifecycle | Cart → checkout → settled | Posted → active → sold/cancelled |
| Best for | Buying NEW things from established sellers | Buying USED things from other people |

---

## v0.1 honesty (what to tell users)

If they ask why marketplace is so simple compared to eBay:

> *"This is a POC v0.1 — the minimum viable surface. No auctions or bidding (Buy Now only); no photo uploads (text listings with category accent); no escrow (purchases auto-settle); no reputation/feedback system (yet). The full version ships post-MVP when mimarketplace.app carves out into its own MCP. What's here is enough to demonstrate the C2C narrative — peer-to-peer commerce inside any AI chat."*

---

## Cross-references

- For shopping FROM registered merchants: `https://poc.whoois.app/context/mishopping.md`
- For the P2P infrastructure that powers settlement: `https://poc.whoois.app/context/p2p-send.md`
- For viewing the receipt after purchase: `https://poc.whoois.app/context/mitrail.md`

---

*This spoke is fetched from `https://poc.whoois.app/context/mimarketplace.md`. mimarketplace.app v0.1 shipped 2026-05-29 — minimum demonstrable; full version post-MVP.*
