Larzscript Flagship Projects

LarzMarket — A Trustless P2P Auction, Built in Larzscript

A bid isn't a status flag in a database — it's a real pay into the listing's own escrow wallet. Outbid someone, and their money comes back in full before the new bid is ever held — never two bidders' funds locked up at once.

What LarzMarket actually does

Each listing owns one holding escrow wallet. Every bid() refunds the previous highest bidder from that wallet before taking the new bidder's funds — so exactly one bid's worth of money is ever held at a time. A bid that doesn't beat the current highest throws a catchable RequireError; a bid the bidder genuinely can't afford throws a real MoneyError. close() settles the final highest bid to the seller for real.

Every line below is the real output of a fresh run against the actual interpreter — re-run fresh for this page, not copied from documentation. Three bidders compete for one listing.

market.bid(listing, alice, $20.00)
market.bid(listing, bob, $25.00)
market.bid(listing, carol, $30.00)
Output
alice refunded in full: $100.00 (back to her starting balance)
bob refunded in full: $80.00 (back to his starting balance)
carol's bid now held: $20.00

Each new bid genuinely moves money: alice's $20 comes straight back the instant bob outbids her, and bob's $25 comes straight back the instant carol outbids him — real wallet reads after real calls, not narrated bookkeeping.

market.bid(listing, bob, $32.00)   # must exceed $35.00
market.close(listing)
Output
RequireError: bid must exceed the current highest bid
seller: $35.00 (was $0.00)
alice (winner): $65.00 (paid $35.00 of her $100.00)

bob's $32 doesn't beat alice's $35 and require refuses it — the same mechanism the course's error-handling lesson covers. When the auction closes, the seller and winning bidder settle for real; the losing bidders (bob, carol) end the whole auction at the exact balance they started with.

Why it matters

wallet, pay, and escrow are the same money-native core the course's Money-Native Basics lesson teaches — here composed into a real auction where "genuinely held" isn't a design doc claim, it's a wallet balance you can read after every single call.

View source on GitHubFlagship ProjectsLarzscript Course