# OPinit Stack

#### The OPinit Stack is a CosmosSDK based vm-agnostic Optimistic Rollup framework. The OPinit Stack follows a similar interface to Optimism's [OP Stack](https://stack.optimism.io/), specifically Bedrock, to ensure ease of understanding. The current version of OPinit Stack uses the Initia L1 Governance set for fraud-proof disputes.

<figure><img src="https://content.gitbook.com/content/pUvrGia2zAh06hjawOb6/blobs/RzhYycUkmGtlZCTrLUgu/02.png" alt=""><figcaption></figcaption></figure>

OPinit consis of two Cosmos modules, `ophost` and `opchild` as well as 4 bot programs which are L2 specific.&#x20;

### OPHost

OPHost module has 4 major features:&#x20;

1. Interface for creating OP Bridge and managing permissioned bridge executor and challenger.
   * Operator and Challenger addresses can be changed via Governance proposals
2. Batch Inbox which records L2's transaction batch.&#x20;
   * Transaction batch does not become a state, but only remains as tx index like Ethereum's calldata
3. L2 Output Oracle where L2's output root can be registered to.
   * Only permissioned bridge executors can register new output oracle root.
4. Interface for deleting L2 outputs registered by challenges, and modifying operators and challenger addresses through gov message.
   * In the current version, only permissioned challenger can delete output proposals just like OP Stack's bedrock version.

### OPChild

OPChild module consists of 3 major features:

1. Replacing staking, gov, and distribution modules required to use CometBFT .
2. Generating L2 Sequencer.&#x20;
3. Bridge interfaces that can be run by permissioned bridge executor.

### Bridge Executor

OPinit's bridge executor is in charge of monitoring `initiate_token_deposit` message from L1 and relaying it to L2, and monitoring `initiate_token_withdrawal` message from L2 and creating withdrawal storage each epoch.&#x20;

### Output Submitter

OPinit's output submitter utilizes withdrawal storage and final L2 block in the epoch generated by the Bridge Executor every epoch to generate L2 output root which is submitted to L1.&#x20;

### Batcher

Batcher is a bot which collects all L2's block data to record as L1's calldata. Batcher is supported for both Initia L1 and Celestia L1.&#x20;

### Challenger

Challenger monitors L2 operator and submits a challenge whenever the operator misbehaves outside of chosen set of rules, mainly for submitting invalid blocks or censorship problems. To prevent spamming attacks, the current version only allows permissioned challengers to challenge. In the later versions any annonymous challengers can participate by having stake in the network.&#x20;

### Implementation

Please visit [here](https://github.com/initia-labs/OPinit) to see implementation.
