Architecture

Lightd Gateway Architecture

Morana Lightd is a gateway (a Go service) through which the wallet and the messenger work with the blockchain without downloading the whole chain. The gateway reads its own full node, keeps its own index and serves the apps exactly what they need.

What it does

  • Serves block headers and compact blocks (blocks trimmed down to what a wallet needs) — the wallet uses them to find its own private transfers.
  • The gateway serves block filters (BIP157/158). The wallet can sync through them without sending its transparent addresses to the gateway. If the gateway does not support filters, the wallet falls back to requesting address history, which reveals the addresses. Committing block filter headers to the chain would let the wallet check whether the gateway has shown every incoming payment. This is being considered for the open testnet.
  • Serves transparent outputs and history for an address, with support for cursor-based pagination.
  • Accepts transactions for broadcast and answers whether a transaction made it into a block, with an inclusion proof.
  • Looks up a MORID name (a short name on the blockchain) and returns the record together with a proof from the block.
  • Serves the relay swarm membership (the list of relays, the servers that deliver messages) from the chain, with proofs — the messenger picks its relays from it.
  • Feeds the network explorer.

Apps talk to the gateway over HTTPS (REST); the gateway also has a gRPC interface.

Why you do not have to trust the gateway

The gateway does not receive users’ private keys, sign their transfers or decrypt their private data. The app verifies headers and proofs itself and rejects data that fails those checks. If the node behind the gateway does not answer, the gateway reports the failure rather than presenting it as “not found”.

One thing the app cannot check on its own: that the gateway showed the chain with the most work rather than a lagging branch. For important operations, cross-check with a second source — another gateway or your own node.

If the chain reorganizes (another branch overtakes the current one), the wallet itself rolls back up to 100 blocks and recomputes its data.

What the wallet checks itself, and what it cannot check yet

The wallet verifies the proof of work of each block header and checks that the headers form an unbroken chain from the first block.

The wallet checks each block’s compact private data against the MSNR record — the note tree root and data digest. This lets it detect a hidden private spend or changes to the data covered by the check.

The wallet cannot yet independently verify that the gateway has shown every incoming payment to transparent addresses. If the gateway omits one, the wallet may not detect it. Committing block filter headers to the chain would let the wallet check whether the gateway has shown every incoming payment. This is being considered for the open testnet. Until then, cross-check important incoming transparent payments with a second gateway or your own node.

Privacy

  • The gateway sees public block data and the requests sent to it.
  • If the wallet asks for the history of a transparent address, the gateway sees that address. The block-filter path does not reveal addresses.
  • The gateway cannot decrypt private transfers — only the wallet holding your keys can.
  • The most privacy comes from your own gateway on top of your own node.

Endpoint

Gateway (testnet, Europe):   https://gw1.morana.network
Gateway (testnet, Americas): https://gw2.morana.network
Gateway (testnet, Asia):     https://gw3.morana.network

There are three gateways, one per continent, all operated by the project. A .onion address will follow, and the app will be able to ask any of them.

Running your own

The gateway needs its own full Morana node started with -txindex=1. It reaches the node's RPC only on a local address (port 39232 on testnet) and keeps its own index. The gateway itself listens on a local address and is exposed through a TLS proxy. The /admin/ endpoints are closed behind a token, and requests are rate-limited.

If you are writing your own client: amounts in gateway responses are whole numbers of atoms (the *_sat fields), 1 XMOR = 100,000,000 atoms.