# System Composition

### How These Three Components Work Together

Eclipse’s system flows from execution to data availability, and from settlement to exit verification:

{% @mermaid/diagram content="graph TD
%% Deposit Flow
DEP\[User Deposit on Ethereum] --> DEPCONTRACT\[Deposit Contract]
DEPCONTRACT --> ECLIPSE\[Eclipse Chain]

```
%% Normal Transaction Flow
TX[User Transactions] --> ECLIPSE

%% Data Availability Flow (Simplified)
ECLIPSE --> CPUB[Celestia Publisher<br/>Index, Batch & Compress]
CPUB --> CELESTIA[Celestia Network]
CPUB --> GATEWAY[Ethereum Gateway<br/>Anchor DA Commitments]

%% Withdrawal Flow
WTX[User Withdrawal] --> RELAYER[Trusted Relayer]
RELAYER --> BRIDGE[Canonical Bridge<br/>7-day delay]
BRIDGE --> WUSER[User Claims Funds]

%% Optional Challenges (Simplified)
CHALLENGES[Optional: DA Challenges] -.-> BRIDGE

%% Styling
classDef deposit fill:#e8f5e8
classDef execution fill:#e1f5fe
classDef da fill:#f3e5f5  
classDef withdrawal fill:#fff3e0
classDef challenge fill:#ffebee

class DEP,DEPCONTRACT deposit
class TX,ECLIPSE execution
class CPUB,CELESTIA,GATEWAY da
class WTX,RELAYER,BRIDGE,WUSER withdrawal
class CHALLENGES challenge" %}
```

We can break this down further:

1. **User Transaction**: Begins on Eclipse and is picked up by the sequencer.
2. **Data Availability**: The Celestia publisher compresses and posts the block data to Celestia, receiving `span_sequence` commitments.
3. **DA Commitment Anchoring**: The Gateway takes the Celestia `span_sequence` data and submits BatchHeaders to Ethereum.
4. Withdrawals:
   * Initiation: Users request withdrawals through a trusted withdrawal relayer
   * Authorization: The withdrawal relayer calls `authorizeWithdraw` on the Canonical Bridge
   * Claim Period: Users call `claimWithdraw` 7 days later to complete the withdrawal
5. Data Availability Challenges (Separate Optimistic Process):
   * Anyone can submit DA proofs to challenge unavailable data
   * Not required for normal operation (optimistic system)
   * Only needed if there's a dispute about data availability
6. Finality: The Bridge processes authorized withdrawals after the delay period.

Each module is independently upgradable and maintains strict boundaries, but their collaboration underpins Eclipse’s modular rollup design.

The Publisher handles DA at scale using Celestia. The Gateway anchors DA commitments and facilitates messages. The Canonical Bridge finalizes user exits by validating Merkle proofs before authorizing Treasury transfers.&#x20;

Each module is decoupled, yet interdependent, and the entire system is designed to evolve, enabling upgrades like fraud proofs, decentralized sequencing, and dynamic withdrawal verification.

#### Visualizing Deposit vs Withdraw Flow

To better illustrate how deposits and withdraws flow:

{% @mermaid/diagram content="graph LR
MSG\[Message: Ethereum to Eclipse] --> RUNTIME\[Eclipse Runtime]
RUNTIME --> CELESTIA\[Data posted to Celestia]
CELESTIA --> GATEWAY\[Eclipse L1 Gateway]
GATEWAY --> ETH\[DA commitments anchored on Ethereum]

%% Withdrawal Flow
WTX\[User Withdrawal] --> RELAYER\[Trusted Relayer]
RELAYER --> BRIDGE\[Canonical Bridge<br/>7-day delay]
BRIDGE --> WUSER\[User Claims Funds]

%% Optional Challenges (Simplified)
CHALLENGES\[Optional: DA Challenges] -.-> BRIDGE" %}

This visual helps delineate between forward-facing execution logic (e.g. messages coming in) and backward-facing verification logic (e.g. data leaving Eclipse).

{% hint style="success" %}
**Note:** All code-level details and developer-facing documentation will be shared post open-sourcing. For now, this overview serves to provide mental models for how Eclipse components collaborate while maintaining verifiability and safety.
{% endhint %}


---

# 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.eclipse.xyz/architecture/eclipse-architecture/architectural-overview/core-infrastructure/system-composition.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.
