🏠 Dark Questate Showcase
A real estate brokerage on Quai Network: title-verified properties as EIP-6065
deeds, listings through registered brokers, offers held in escrow on Cyprus-1, and closings that
move the deed and the money in one transaction. Source: b6/ · Route:
/darkquestate/
The contracts (QuestateDeed, QuestateBrokerage) are
not deployed on Orchard or mainnet, so the site runs as a
labelled showcase: invented sample listings, marked as such on every card and
page, with every transaction switched off. No independent audit.
How a sale works
- Title verified. The owner prepares a deed request on the Sell page. It validates the parcel boundary (RFC 7946), hashes the operating agreement (keccak256; the text never leaves the page) and builds the metadata document with its real IPFS CIDv0. The registrar checks the recorded deed and identity off chain, loads the file in the Registrar console and mints.
- Listed with a broker. The holder lists through a registered broker. The desk takes custody of the deed while it is listed, and the broker's commission (at most 10%) is fixed at listing time.
- Offers in escrow. Buyers pay the asking price or make an offer. An offer is a deposit the buyer can withdraw at any time until the seller accepts it — also while the desk is paused and after the listing ends.
- Closing in one transaction. Acceptance sends the deed to the buyer and credits the seller and broker, who withdraw their proceeds themselves. A buyer fixes the largest lien they accept: if the registrar records a larger one, or forecloses, before closing, the closing fails and the deposit stays withdrawable.
Who can do what
| Role | Can | Cannot |
|---|---|---|
Registrar (owner of QuestateDeed) | Mint deeds, record a lien or credit, foreclose | Move anyone's deed, touch any coin |
Operator (owner of QuestateBrokerage) | Register or deactivate brokers, pause new business, cancel a listing (deed returns to seller) | Reach offer deposits, credited proceeds or listed deeds |
| Deed holder | List, reprice, cancel, accept offers, appoint a property manager | Change the debt record |
| Buyer | Buy, offer, withdraw an unaccepted offer at any time | Be charged a lien above the one they accepted |
Build, test, run
cd b6
pnpm install
pnpm build # contracts, core, ui, web (turbo)
pnpm test # contract + core (incl. live-chain e2e) + web tests
pnpm integrity
pnpm dev # http://localhost:5290 (showcase unless deployments.ts has an entry)
Foundry. cd packages/contracts && pnpm test:forge runs the fuzz
suites and invariant campaigns against the exact bytecode the deploy script ships; the invariants
pin the money identity (desk.balance == totalProceedsOwed + totalOfferEscrow), deed
custody, parcel uniqueness, foreclosure monotonicity and the manager ledger under hostile call
sequences. scripts\security-check.cmd (or pnpm security) runs Slither
plus every other check in one command.
Against a real chain locally. pnpm local:market starts a Hardhat
node on port 8645, deploys both contracts, seeds six listings and writes
apps/web/.env.localchain.local; pnpm dev:local serves the site against
it with a dev wallet (registrar, broker, seller and buyer accounts). The dev wallet exists only
in that mode; pnpm integrity checks it is absent from production builds.
Deploying to Quai
cd packages/contracts
node scripts/deploy-quai.mjs --network orchard --from 0x00<your address> # simulate, costs nothing
node scripts/keystore-new.mjs keystores/deployer.keystore.json # fund the printed address
node scripts/deploy-quai.mjs --network orchard --keystore keystores/deployer.keystore.json --broadcast
The deploy script never takes a raw private key: it signs from an encrypted keystore, grinds
both contracts into Cyprus-1, simulates each creation, verifies code on chain against the build,
then records the addresses in packages/core/src/deployments.ts. A mainnet broadcast
requires explicit --registrar and --operator (use a multisig or cold
key) plus --i-understand-unaudited. After deploying, register at least one broker in
the Registrar console, then rebuild and redeploy the site.
Known limitations
- No independent audit (unit, adversarial, fuzz and invariant tests are not an audit).
- Metadata hosting: the site computes each deed's CID; publishing the document so the CID resolves is the registrar's step.
- Listing reads are unindexed (newest 60 by id); a larger desk will want an indexer.
- Native QUAI only; dollar figures are CoinGecko estimates for display, never used on chain.
- Legal effect: a deed token mirrors a title verified off chain; what it conveys depends on the owning entity's operating agreement and local law.