# Building Applications with Espresso

Applications need fast, reliable state to operate, whether users are transacting on a single chain or coordinating activity across multiple systems. Without it, user experience degrades and financial operations face settlement risk.

Today, most applications face a tradeoff between speed and trust: fast state from a sequencer carries weaker settlement guarantees, while finality backed by a parent chain or L1 can take minutes to hours. For latency-sensitive applications like trading, payments, bridging, or intent settlement, neither is ideal.

Espresso removes this tradeoff by providing decentralized Proof of Stake finality within seconds. Applications read confirmed state through a Caff Node, a standard JSON-RPC endpoint that reflects Espresso-finalized state in real time, with no changes required to existing tooling.

## Single-Chain Applications

For applications on a single Espresso-integrated chain, fast finality translates directly to a better user experience. Use cases include:

* Token swaps and DEX interfaces: show settled balances immediately after execution
* Payment applications: confirm transfers in seconds, not minutes
* Gaming and NFT interactions: reflect state changes without waiting for downstream finality
* Any application where "pending" state creates friction or risk

**How it works** (for rollup-based integrations):

1. The user submits a transaction through the application frontend.
2. The chain's sequencer orders the transaction and produces a block.
3. Espresso's HotShot consensus finalizes that block within seconds.
4. A Caff Node derives the resulting state and exposes it over the standard JSON-RPC interface.
5. The frontend queries the Caff Node, the same call it already makes, and shows the user confirmed state.

For rollup-based integrations, the L1 batch is posted later for long-term security, but the application and its users never need to wait for it.

**Example:** A user swaps tokens on Rari (an Arbitrum Orbit chain integrated with Espresso). Without Espresso, the frontend shows "pending" until the batch lands on Arbitrum. With Espresso, the Caff Node reflects the settled swap within seconds of HotShot finalization.

## Cross-Chain Applications

Cross-chain coordination requires one system to reliably read the state of another. Today, middleware that acts on sequencer confirmations carries execution risk from weak guarantees; middleware that waits for full parent-chain finality faces multi-minute delays. Neither is ideal for fast, trust-minimized cross-chain settlement.

Espresso provides a shared finality layer that any connected system can read trustlessly. Beyond cross-chain middleware, this makes Espresso useful for any system that needs to coordinate or verify state across boundaries, whether that is cross-chain middleware, institutional settlement workflows, or financial systems that need a trustlessly readable source of truth. Because the Caff Node derives state directly from HotShot-finalized data rather than a sequencer soft confirmation, middleware and applications can act on source-chain state with stronger guarantees and lower execution risk.

Use cases include:

* **Message passing (e.g. Hyperlane):** Validators read source-chain events from a Caff Node and trigger relaying as soon as Espresso confirms, not after L1 finality.
* **Intents and solvers:** Solvers query Caff Nodes to access the latest confirmed state of source and destination chains, reducing both execution latency and the risk of acting on stale state.
* **Bridges and relayers (e.g. Across):** Source-chain confirmation from Espresso reduces the window between user action and message delivery.

Shared finality is particularly valuable for financial applications that need a timely and reliable view of positions across systems. Collateral management, margin monitoring, and cross-system settlement workflows all benefit from a single authoritative confirmation source rather than per-chain finality races.

## Going Further

For technical details on reading Espresso-confirmed state, see [Reading from Espresso](/network/developer/dapp/read-from-network.md).

For implementation guides, see the Developer section: [Single-Chain App via Caff Node](/network/developer/dapp/create-single-chain-app.md), [Crosschain via Hyperlane](/network/developer/dapp/create-cross-chain-app-hyperlane.md), and [Presto: Crosschain Minting](/network/developer/dapp/deploy-presto.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.espressosys.com/network/learn/building-with-espresso.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
