# Main Proof Request

The proofs are always wrapped into a ssz-container with the name `C4Request`. This Container holds the a version (4 bytes) and unions for different proof types.

The 4 `Version` Bytes are encoded as `dom, major, minor, patch`.

* 0 : `domain` . describe which chain-type is used. 6 = OP-Stack
* 1 : `major` . the major version of the prover.
* 2 : `minor` . the minor version of the prover.
* 3 : `patch` . the patch version of the prover.

The `data` union can hold different types which represents the final data to be verified.

The `proof` union can hold different types which represents the proof of the data.

The `sync_data` union holds optional data used to update the sync\_committee. Most of the time this is empty since syncing the pubkey only is used whenever it is needed. But the structure allows to include those sync\_proofs enabling a fully stateless proof. Note: OP-Stack uses the same sync\_data structure as Ethereum since it shares the consensus layer.

## if

[chains/op/ssz/op\_types.c](https://github.com/corpus-core/colibri-stateless/blob/dev/src/chains/op/ssz/op_types.c#L88)

Finds the index of a target definition within an array of SSZ definitions. Searches for a container type whose elements pointer matches the target.

```c
static inline size_t array_idx(const ssz_def_t* array, size_t len, const ssz_def_t* target) {
  for (size_t i = 0; i < len; i++) {
    if (array[i].type >= SSZ_TYPE_CONTAINER && array[i].def.container.elements == target) return i;
```

**Parameters**

* **`array`** : Array of SSZ definitions to search
* **`len`** : Length of the array
* **`target`** : Target definition to find (compares elements pointer)

**Returns**

Index of the matching definition, or 0 if not found

## \&C4\_REQUEST\_CONTAINER

[chains/op/ssz/op\_types.c](https://github.com/corpus-core/colibri-stateless/blob/dev/src/chains/op/ssz/op_types.c#L108)

Returns the SSZ type definition for a given OP-Stack verification type enum. Maps op\_ssz\_type\_t enum values to their corresponding SSZ definition pointers. Used to retrieve the correct type definition for parsing and validating SSZ-encoded proof data.

```c
const ssz_def_t* op_ssz_verification_type(op_ssz_type_t type) {
  switch (type) {
    case OP_SSZ_VERIFY_REQUEST:
      return &C4_REQUEST_CONTAINER;
```

**Parameters**

* **`type`** : The verification type enum value

**Returns**

Pointer to the corresponding SSZ definition, or NULL for invalid types

## C4OpRequest

a Proof for multiple accounts the main container defining the incoming data processed by the verifier

The Type is defined in [src/chains/op/ssz/op\_types.c](https://github.com/corpus-core/colibri-stateless/blob/dev/src/chains/op/ssz/op_types.c#L68).

```python
class C4OpRequest(Container):
    version   : ByteVector [4]          # the [domain, major, minor, patch] version of the request, domain=6 = OP-Stack
    data      : Union [                 # the data to prove (OP-Stack reuses Ethereum's data union for compatibility)
        None,                           # 
        Bytes32,                        # the blockhash  which is used for blockhash proof
        Bytes[1073741824],              # the bytes of the data
        Uint256,                        # the balance of an account
        EthTxData,                      # the transaction data
        EthReceiptData,                 # the transaction receipt
        List [EthReceiptDataLog, 1024], # result of eth_getLogs
        EthBlockData,                   # the block data
        EthProofData,                   # the result of an eth_getProof
        EthSimulationResult]            # the result of an colibri_simulateTransaction
    proof     : Union [                 # the proof of the data (OP-Stack specific proof types)
        None,                           # 
        OpAccountProof,                 # a Proof of an Account like eth_getBalance or eth_getStorageAt
        OpTransactionProof,             # a Proof of a Transaction like eth_getTransactionByHash
        OpReceiptProof,                 # a Proof of a TransactionReceipt
        List [OpLogsBlock, 256],        # a Proof for multiple Receipts and txs
        OpCallProof,                    # a Proof of a Call like eth_call
        OpBlockProof]                   # Proof for BlockData
    sync_data : Union [                 # the sync data containing proofs for the transition between the two periods (OP-Stack reuses Ethereum's sync_data union)
        None,                           # 
        C4EthLcSyncdata,                # Light Client Sync Data
        C4EthZkSyncdata]                # ZK Proof Sync Data
```

**Referenced Types**

* [EthTxData](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/transaction-proof#ethtxdata)
* [EthReceiptData](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/receipt-proof#ethreceiptdata)
* [EthReceiptDataLog](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/logs-proof#ethreceiptdatalog)
* [EthBlockData](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/block-proof#ethblockdata)
* [EthProofData](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/account-proof#ethproofdata)
* [EthSimulationResult](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/colibri-rpc-methods/colibri_simulatetransaction#ethsimulationresult)
* [OpAccountProof](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/account-proof#opaccountproof)
* [OpTransactionProof](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/transaction-proof#optransactionproof)
* [OpReceiptProof](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/receipt-proof#opreceiptproof)
* [OpLogsBlock](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/logs-proof#oplogsblock)
* [OpCallProof](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/call-proof#opcallproof)
* [OpBlockProof](https://corpus-core.gitbook.io/specification-colibri-stateless/specifications/block-proof#opblockproof)
* [C4EthLcSyncdata](https://github.com/corpus-core/colibri-stateless-doc/blob/main/specification/specifications/ethereum/synccommittee.md#c4ethlcsyncdata)
* [C4EthZkSyncdata](https://corpus-core.gitbook.io/specification-colibri-stateless/ethereum/synccommittee-proof#c4ethzksyncdata)
