# Optimistic Rollup

## Optimistic Rollups <a href="#optimistic-rollups" id="optimistic-rollups"></a>

SatoChain operates as an "Optimistic Rollup," an innovative approach that relies on the consensus mechanism of another blockchain, termed the "parent" blockchain (e.g., PoW or PoS), instead of deploying its own consensus mechanism. In SatoChain's primary network, Bitcoin serves as the parent blockchain.

<figure><img src="https://280885374-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2oUjAWEupimD7loPOJqF%2Fuploads%2Fdbk7XOKoTlzBzkMf7UYV%2Foptimismrollup.jpeg?alt=media&#x26;token=d478e67e-bebf-4727-94e3-25b1a786287f" alt=""><figcaption></figcaption></figure>

\
**Data Storage**
----------------

In SatoChain, Layer 2 blocks are stored on the Bitcoin blockchain with minimal Layer 1 Gas fees. These blocks are presented as transaction data on Bitcoin, and once these "transactions" are integrated into blocks with substantial proofs, the transaction data becomes immutable and resistant to censorship. This mechanism ensures that SatoChain's mainnet inherits the availability and integrity guarantees provided by Bitcoin.

## Block Creation <a href="#block-creation" id="block-creation"></a>

The production and management of SatoChain blocks predominantly lie in the hands of an entity known as the "sequencer," which aids the SatoChain Layer 2 network by:

1. Confirming transactions and updating state.
2. Constructing and executing Layer 2 blocks.
3. Submitting user transactions to Layer 1.

In SatoChain, the sequencer maintains a private mempool, similar to Bitcoin's Layer 1, to prevent opportunities for MEV. Blocks on the SatoChain mainnet are generated at intervals of 3-60 seconds (exact timing to be determined), irrespective of whether they are empty, filled up to the block's gas limit, or fall somewhere in between.

Transaction submission to the sequencer occurs in two ways:

1. Transactions submitted on Layer 1 (deposits) are included in the corresponding Layer 2 block's chain, identified by an "epoch" and sequence number. This approach ensures censorship resistance at the level of Layer 1 Bitcoin.
2. Direct submission of transactions to the sequencer, with lower costs compared to Layer 1 but lacking resistance to censorship since the sequencer is the sole entity aware of these transactions.

Initially, the SatoChain Foundation serves as the exclusive block producer on the SatoChain mainnet, gradually transitioning to a decentralized sequencer.

## Block Execution <a href="#block-execution" id="block-execution"></a>

The execution engine receives blocks through two mechanisms:

1. Self-updating via a peer-to-peer network, akin to how Layer 1 execution clients synchronize state.
2. Rollup nodes (implemented as SatoChain-Node components) deriving Layer 2 blocks from Layer 1, a slower but censorship-resistant mechanism.

## Asset Bridging across Layers <a href="#asset-bridging-across-layers" id="asset-bridging-across-layers"></a>

SatoChain's architecture facilitates users to exchange messages between Layer 2 and Layer 1, enabling asset transfers between the two networks. The specific communication mechanism depends on the direction of message transmission.

In the context of standard bridging on the SatoChain mainnet, users can deposit assets from the Bitcoin network into the SatoChain mainnet and withdraw the same assets back to the Bitcoin mainnet.

## Assets Moving from Bitcoin to SatoChain <a href="#assets-moving-from-bitcoin-to-satochain" id="assets-moving-from-bitcoin-to-satochain"></a>

In SatoChain's terms, transactions from Bitcoin to the SatoChain mainnet are termed deposits, even if they involve no additional assets.

These deposit transactions become part of the blockchain of the first Layer 2 block of an "epoch," corresponding to the L1 block in which the deposit occurred, typically created a few minutes after the corresponding Layer 1 block.
