# Lookback Window

In XYO Layer One, Lookback Windows enhance the efficiency of block building, validating, and indexing. This concept focuses on narrowing the amount of previous blocks that need to be maintained and analyzed, enabling more efficient blockchain operations.

### How the Lookback Window Works

XYO Layer One introduces a variable Lookback Window algorithm, which only requires nodes to store the most recent N transactions — such as the last 10,000 or 1 million. This drastically reduces storage needs while boosting transaction speeds. Older transactions are stored in a backup system, ensuring minimal disruption to performance and allowing for easy access when necessary.

### A Visual Representation of Lookbacks Windows

{% @mermaid/diagram content="sequenceDiagram
title XYO Variable Lookback Window
participant Block1
participant Block2
participant Block3
participant Block4

```
Block1->>Block2: Block is built
activate Block2
Block2-->>Block1: Lookback Window includes <br> recent N transactions
deactivate Block2

Block2->>Block3: Block is built
activate Block3
Block3-->>Block2: Lookback Window includes <br> recent N transactions
deactivate Block3
```

Block3->>Block4: Block is built
activate Block4
Block4-->>Block3: Lookback Window includes <br> recent N transactions
deactivate Block4
" %}

### Traditional Blockchain Structure

In most traditional blockchains, the Lookback Window spans the entire length of the chain. This means that to analyze data on the blockchain, a node must scan the entire history. While this allows for immediate access to all historical data, it comes at the cost of growing compute and storage requirements. As a result, the network’s hardware needs increase over time, pushing out smaller participants and causing decentralization to erode. Additionally, indexing of the blockchain is often outsourced to centralized Web2 services, creating further inefficiencies

### A Visual Representation of Traditional Blockchains

{% @mermaid/diagram content="sequenceDiagram
title Traditional Blockchains
participant Block1
participant Block2
participant Block3
participant Block4

```
Block1->>Block2: Block is built
activate Block2
Block2-->>Block1: Lookback Window <br> includes all previous blocks
deactivate Block2

Block2->>Block3: Block is built
activate Block3
Block3-->>Block1: Lookback Window includes all previous blocks
deactivate Block3
```

Block3->>Block4: Block is built
activate Block4
Block4-->>Block1: Lookback Window includes all previous blocks
deactivate Block4
" %}

### How XYO’s Lookback Window Improves Efficiency

This approach is a significant improvement over traditional blockchains like Bitcoin and Ethereum, where nodes must store the entire blockchain history and manage historical global states (like UTXOs or address balances). These systems face increasing hardware demands, especially as the network grows.

With XYO’s Lookback Window, the blockchain remains scalable, efficient, and capable of processing transactions quickly. By minimizing the storage required for blockchain operation, XYO Layer One ensures a more responsive decentralized ecosystem that is better equipped to handle future growth.
