ZooBC wiki
Apps and building on ZooBC

Project ideas

ZooBC has no virtual machine, so nobody deploys contracts to it. Instead it offers a large set of ready-made transaction types, and a good project combines them: the chain is the referee and the ledger, and the app is the face, often a single web page (building an app as one HTML page). Every idea below uses only transaction types that the node already executes, and each comes with the catch a builder should know.

River pay with LiquidPayment and LiquidPaymentStop, and other ideas built the same way.
River pay with LiquidPayment and LiquidPaymentStop, and other ideas built the same way.

Payments

River pay

LiquidPayment (type 6) locks an amount, in ZBC or a token, that vests to the recipient evenly over the chosen complete_minutes; at the end the whole amount is paid automatically. LiquidPaymentStop (type 262), sent by either party, pays the share vested so far and returns the rest. The page only has to draw the water level. Good to know: the split follows the time between the two transactions' timestamps, and the recipient's share is rounded up: 10,000,000 units over 3 minutes, stopped after 66 seconds, give 3,666,667 units to the recipient and 6,333,333 back (liquid payments (streams)).

Damage deposit

A tenant sends the deposit as an escrowed SendZBC that names an approver, a commission and a deadline (escrow). The approver can approve, and the amount goes to the landlord, or reject, and it goes back to the tenant; the approver takes the commission either way. If nobody acts, the first block past the deadline returns the amount and the commission to the tenant. Catch: the escrow rent is paid at creation and never refunded, and a deadline beyond the reach of pruning is refused unless the transaction's survival deposit pays to keep it that long.

Family account

LinkAccount (55), SetMemberPermissions (57), UnlinkAccount (56) and TransferGroupControl (58) give a family one balance behind up to 100 addresses (account groups). Catch: joining needs the joining address's consent and moves everything it owns into the group; a new member can only receive until the controller grants permissions; and a member who leaves takes nothing.

Games

Dice arcade

CreateApp with types 16 to 19 (two dice, coin flip, roulette and slots) plays against the apps pool. The page shows the result about 30 seconds later and can read /api/v1/apps/pool to show the largest stake each game allows. Catch: a bet whose largest payout exceeds 5 % of the pool is refused, and a very large win may be paid over several blocks (solo bets).

Tic-tac-toe kiosk

Type 1, with CreateApp, JoinApp, AppMove and ClaimAppTimeout (multiplayer apps). Catch: every move is a transaction, with its fee and its wait for a block; a player who walks away holds the game for 240 blocks before the other can claim it; and accounts with Ethereum- or Bitcoin-style keys cannot take a seat.

Lightning duel

A two-player channel game settled with SettleApp (channel apps): the moves fly between the players as signed vouchers, and the chain sees only the stakes and the settlement. Catch: your app must carry the moves between the players (the official wallet uses a relay), keep every signed move it receives, and watch the 240-block challenge window.

Tokens and trade

Coffee stamps

IssueToken (type 10) creates a stamp token with 0 decimals, so it moves in whole units; TransferToken (11) hands a stamp to a customer; BurnToken (13) spends stamps at the counter (issuing a token). Catch: BurnToken works only on a token issued as redeemable, and only the holder of a unit can burn it; and a token lives only while its upkeep is paid (token upkeep (persistence)).

Swap kiosk

CreateSwapOffer (18), AcceptSwapOffer (19) and CancelSwapOffer (20) make a board of atomic swaps between any two assets (swap offers). Catch: one taker pays the whole wanted side, with no partial fills, and an offer's expiry only blocks acceptance, so an expired offer stays locked until its maker cancels it.

Records and messages

Hash stamp

A transaction whose message carries a file's SHA-256 shows that the file existed when that block was made, and a FundLongevity (52), or the survival field, keeps it past pruning (paying to keep data (longevity)). A gateway's /verify page computes the hash in the browser and searches the chain for it (checking a downloaded file). Catch: without a longevity deposit, ordinary nodes prune the stamp after 30 to 60 days, and a first FundLongevity must come within one snapshot interval, about 30 days.

Sealed postcards

An encrypted message, marked "ZBE1" and sealed to the recipient's key, can carry up to 268 bytes of text (signed and encrypted messages). Catch: only the text is sealed; the transaction itself, with its sender, recipient and time, is as public as any other.

Sign in with ZooBC

A site shows a one-time challenge, the user signs it as a ZBC-MSG-v2 message with the public tools, an Ed25519 signature over SHA3-256("ZBC-MSG-v2" ‖ genesis hash ‖ message), and the site checks the signature against the account's key. Catch: message signing is not part of consensus and nodes have no route for it, so the site verifies it itself; and the official web wallet does not sign messages.

What needs a change to the node

  • An automated market maker. ZooBC has no AMM pools, by decision; its exchange is an order book plus swap offers (markets and orders).
  • Solidity or any EVM contract. There is no virtual machine.
  • A new game, such as poker. Game rules cannot be uploaded as scripts; a new game needs new rules in the node.
  • A crash game with a cash-out button. Crash is a solo bet whose target is fixed in advance; there is no move to cash out.

See also