MoonBite
MoonBite
Get Notified Get Wallet
Open network

Build on MoonBite.

A clean, read-only REST API for the chain โ€” blocks, transactions and search, no keys required. Run a node, index the chain, or wire MBITE into your app.

REST API

Read-only endpoints

Every endpoint returns JSON with a status field. These are read-only โ€” they never move funds or expose keys.

GET /api/blockchain/info

Chain height, tip hash, coins in circulation, tx count and mempool size.

{
  "status": "success",
  "height": 128,
  "tip_hash": "โ€ฆ",
  "total_money_coins": 1280,
  "tx_count": 129,
  "mempool_size": 0
}

GET /api/explorer/blocks

Paginated block list, newest first. Params: limit (1โ€“50), offset.

{
  "status": "success",
  "blocks": [ { "height": 128,
    "hash": "โ€ฆ", "tx_count": 1,
    "confirmations": 1 } ],
  "total": 129
}

GET /api/explorer/block/<id>

A single block by height or hash, including its transactions.

GET /api/explorer/tx/<txid>

A transaction by id, from the active chain or the mempool, with inputs/outputs.

GET /api/explorer/search?q=

Resolve a query to a block (height/hash) or a transaction (txid).

GET /api/transactions

The most recent transactions across the mempool and latest blocks.

Exchange API ยท Phase 2

Non-custodial order book & atomic-swap settlement

The order book stores intents only โ€” never coins, keys, or balances. Settlement is a cross-chain HTLC atomic swap between the two wallets; the server just coordinates the hand-off and, once enabled, verifies it on-chain. A trade only moves last_price after the verifier confirms both HTLC legs redeemed on-chain โ€” there is no fabricated market data.

POST /api/exchange/order

Place a buy/sell order. Returns a one-time secret cancel_token โ€” the only credential that can cancel the order or drive its swap. The public MBITE address cannot.

{ "side": "sell", "pair": "MBITE/LTC",
  "price": "0.0005", "amount": "100",
  "mbite_address": "moon1โ€ฆ",
  "quote_address": "ltc1โ€ฆ" }

GET /api/exchange/orders?pair=

The public order book for a pair: bids, asks, and last_price (null until an on-chain-verified trade settles). The cancel_token is never exposed on any read path.

POST /api/exchange/order/<id>/swap/init

Register the HTLC hand-off for a matched pair. Auth: cancel_token. Records only public swap parameters โ€” hashlock, recipient/refund pubkeys, and timelocks (base must out-live quote). No key or preimage is ever accepted.

{ "cancel_token": "โ€ฆ",
  "hashlock": "<sha256(preimage)>",
  "base_recipient_pubkey": "02โ€ฆ",
  "base_refund_pubkey": "02โ€ฆ",
  "quote_recipient_pubkey": "02โ€ฆ",
  "quote_refund_pubkey": "02โ€ฆ",
  "base_locktime": 172800,
  "quote_locktime": 86400 }

POST /api/exchange/order/<id>/swap/funded

Report an HTLC funding txid for one leg (base | quote). Auth: cancel_token. This is only a hint telling the verifier where to look โ€” the fact is re-checked on-chain, never trusted on your word. Advances the state machine toward both_locked.

GET /api/exchange/order/<id>/swap

The public swap state for a matched order: swap_init โ†’ base_funded โ†’ quote_funded โ†’ both_locked โ†’ quote_redeemed โ†’ base_redeemed โ†’ settled (or expired on refund/timeout). The preimage appears only once it is already public on-chain.

POST /api/exchange/verify operator

Runs one read-only on-chain verification pass over pending swaps and settles any that fully redeemed. Off unless the operator sets VERIFIER_ENABLED, and gated by an X-Verifier-Token secret โ€” intended for a cron/timer, not public traffic. The single event that lets last_price move.

The swap verifier assembles the HTLC redeemscript, derives its funding address, confirms both legs are funded to the agreed amount and depth, extracts the preimage from the public quote redemption, and confirms the base leg reused that same preimage. It builds, signs, and broadcasts nothing. See swap_verifier.py in the repo.

Merchant API

Accept MBITE โ€” payment observation, no custody

Raise an invoice against your own address; the server observes the chain for a matching inbound payment and marks it paid. Funds go wallet-to-wallet โ€” the server never holds them.

POST /api/merchant/invoice

Raise a payment request against a merchant address. Snapshots the address's prior receipts so only a new inbound payment settles this invoice. Returns a BIP21-style pay_uri.

GET /api/merchant/invoice/<id>

Poll one invoice โ€” re-checks the chain for payment on every call and flips pending โ†’ paid / expired.

GET /api/merchant/invoices?merchant_id=

A shop dashboard read: list a merchant's invoices, each freshly checked on-chain. Listing also advances any that have been paid or expired since last seen.

POST /api/merchant/invoices/poll

Sweep all pending invoices in one pass, auto-marking paid/expired ones โ€” so a shop (or a timer) need not poll each invoice by hand. Idempotent; observes only.

Run a node

Enforce the rules yourself.

A full node validates every block and transaction against MoonBite's consensus rules and helps other peers stay in sync. Don't trust โ€” verify.

Node & downloads
# Create an address
moonbite-cli getnewaddress

# Check chain state over REST
curl -s http://127.0.0.1:5000/api/blockchain/info
๐Ÿงฌ

Litecoin lineage

Battle-tested core, familiar tooling and address formats (moon1โ€ฆ / Mโ€ฆ).

๐Ÿ”“

No auth to read

Public read-only endpoints. Nothing here can spend coins or reveal a key.

๐ŸŒ

CORS-friendly

JSON responses allow cross-origin reads, so you can build web dashboards directly.