Skip to main content

Lanes and templates

A lane is an appchain with its own rules that settles on Stellar. It is made of:

PartWhere it runsWhat it does
The engineinside every nodeThe lane's app, a Soroban Wasm. It runs every block. Consensus executes this exact Wasm, so every node computes the same state
The sequenceryour hostOrders transactions into blocks, at the lane's block time, and serves the lane's API
The validatorsyour hosts, or run by othersRe-execute every block from the sequencer, rebuild each checkpoint themselves, and sign it only if it matches
The relayerthe sequencer's hostPosts checkpoints to Stellar and brings deposits and forced withdrawals from Stellar into the lane
The settlement contractStellarHolds the lane's token, checks every checkpoint's signatures, and pays withdrawals and exits

Templates​

A template is an engine plus the node binary that runs it. Caravel has two:

  • Perps: perpetual futures on an order book, priced by an oracle feed. Caravel Perps, the first lane, runs it on testnet in Circle's testnet USDC.
  • Payments: transfers with a flat fee or none, in the token you choose.

Both are built from the same platform, so they share the CLI, the lane file, settlement and exits. The app SDK (caravel-app-sdk, no_std) is how a new template is written: Payments is built on it.

One CLI for every template​

caravel reads [app] template from the lane file and asks that template's node binary for what only it knows, such as the genesis hashes, through a small plugin protocol. Everything else is the platform's: plans, deployments, hosts, keys and the users' flows.