Skip to content

Architecture

bitCaster is a handful of independent pieces that talk to each other over open protocols.

bitCaster app or CLI

Open source

One app, two roles. Anyone can take either one.

Market creator = Oracle

Asks the question, and later signs the answer.

Trader

Buys and sells shares.

  • 1Creator registers a market
  • 6Winners cash out with the signed result
  • Deposit · withdraw
  • 3Traders place orders
  • 5Oracle signs the result

Cashu mint

Open source

Issues the tokens, holds the bitcoin, and pays out.

2Share market info

4Settle matched trades

Matching engine

Closed source · public API

Keeps the order book and matches buyers with sellers.

Steps 1 to 6 follow one market from creation to payout. Deposits and withdrawals can happen at any time.

The app runs in your browser. At heart it is a Cashu wallet on steroids. It talks to the mint to move tokens, and to the matching engine to read markets and place orders.

The mint issues your ecash and your market shares, and it holds the bitcoin behind them. When a market resolves, it checks the oracle’s signature and pays out the winning shares. During the beta there is one mint, operated by bitCaster. You rely on it to stay online and to honor withdrawals.

The mint is open source and speaks an open protocol, so anyone can run it or audit it. The code is bitCaster’s fork of CDK, and the protocol is defined by two specifications, NUT-CTF and NUT-CTF-settle.

The matching engine keeps an order book for every market, matches buyers with sellers, and broadcasts prices in real time. It never holds your wallet.

An order sent to the matching engine carries locked funds. It states what you want, something like “swap these tokens for this many sats”, and the easiest way to think of it is as a smart contract that the mint enforces.

A market’s oracle is the person who created it. They announce the event when they create the market, and they sign its result once the event is over. The signed result goes to the matching engine and closes the market. Winners then hand it to the mint when they cash out, and the mint checks the signature itself before it pays anyone.

Strictly speaking, the oracle is not a part of bitCaster. But you can use bitCaster to become a market creator, and so an oracle, yourself.

The app, the command-line client, the mint, and the protocol specifications are all public in the bitCaster repository, so you can inspect everything that touches your funds. The matching engine is closed source, which makes spam protection harder to game. Its API specification is public, so anyone can build a client for it.