# Request for SUAPP: Coprocessor for Base

**URL:** https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277
**Category:** SUAVE
**Tags:** request-for-suapp
**Created:** [April 4, 2024, 10:04pm UTC](https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277 "2024-04-04T22:04:18Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sxysun](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/s/f1d935/32.png) [@sxysun](https://collective.flashbots.net/u/sxysun)
#### Post date: [April 4, 2024, 10:04pm UTC](https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277/1 "2024-04-04T22:04:18Z")

</div>

SUAVE could be used to build a programmable coprocessor for Ethereum mainnet as well as rollups like Base. Nobody to this date has made a crypto coprocessor that is able to do private compute over shared state, while A LOT of applications depend on it.

Here we describe one possible architecture for it based on typical crypto coprocessor model.

## Architecture

The design is illustrated by the graph below. The green boxes represent program running inside SGX.

 ![image](https://collective.flashbots.net/uploads/default/original/2X/6/69d446544b60049994f657f3b705f86dc5bcc387.png)

## Lifecycle of a user:

1. People register compute jobs on Base (e.g., call a contract that emits an event `SUAVECoprocess(job)`
2. an event loop calls a SUAVE-geth node running inside an SGX, sending a transaction that calls the `BaseCoprocessingContract` on the function `MonitorBase`
3. the function `MonitorBase` fetches the latest block on Base, get all the transactions, goes through the events they emit, upon seeing an event that registers a job, do the job (by routing to the best Service Subnet), then post the result back by sending a transaction to Base
4. enjoy applications enabled by private credible compute today

## Contract

```solidity
contract MonitorBase {
    uint256 public lastBlock; // Last block number that was processed

    // Event definitions
    event JobProcessed(bytes indexed job, bytes result);
    event TransactionSent(bytes indexed txn);

    // Main monitoring function
    function monitorBase() external {
        // Fetch events using a precompiled function (or an oracle)
        bytes[] memory events = Suave.doHTTPRequest(etherscan, base, lastBlock);

        for (uint i = 0; i < events.length; i++) {
            // Process each event to get a co-processing job
            bytes memory job = getCoprocessingJob(events[i]);

            // Execute the job using a precompiled function (or an oracle)
            bytes memory result = Suave.doHTTPRequest(subnetAPIRouter(job), job);

            // Send the result as a transaction
            sendTxn(result, events[i].info);

            emit JobProcessed(job, result);
        }

        // Update the last processed block
        lastBlock = block.number;
    }

    // Function to send a transaction
    function sendTxn(bytes memory data, bytes memory contractInfo) internal {
        // Create and sign a transaction using precompiled functions
        bytes memory txn = Suave.signEthTransaction(Suave.createTxn(data, contractInfo), baseChainId);

        // Send the transaction using a precompiled function (or an oracle)
        Suave.doHTTPRequest(baseRPC, txn);

        emit TransactionSent(txn);
    }
}

```

## Roadmap

Here we use the most degen example of AI services for the roadmap.

1. PoC on Rigil testnet + [ChatGPT](https://github.com/flashbots/suave-std/pull/42) as a Subnet
2. PoC of SUAVE-geth inside SGX
3. Open source LLM as a Subnet
4. Open source LLM subnet on SGX
5. attestation of all SGX parts on Ethereum mainnet

---

<div class="post-metadata">

### Author: ![JoakimEQ](https://collective.flashbots.net/user_avatar/collective.flashbots.net/joakimeq/32/1682_2.png) [@JoakimEQ](https://collective.flashbots.net/u/JoakimEQ)
#### Post date: [April 9, 2024, 4:02pm UTC](https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277/2 "2024-04-09T16:02:56Z")

</div>

At Equilibrium, we have experience in both building rollups, as well as working with TEEs.

Do I understand correctly that this is like an RFP or a Optimism Mission where soon anyone can write up a short proposal to get funding to build this?

Or this more of a “laundry list of ideas” or “Request for Startups” just to serve as an inspiration for builders who are looking to start something new in crypto? 🙂

Cool idea for sure!

---

<div class="post-metadata">

### Author: ![sxysun](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/s/f1d935/32.png) [@sxysun](https://collective.flashbots.net/u/sxysun)
#### Post date: [April 9, 2024, 7:40pm UTC](https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277/3 "2024-04-09T19:40:39Z")

</div>

it’s a laundry list of ideas for now rather than a formal RFP, but everything is context specific

---

<div class="post-metadata">

### Author: ![julie](https://collective.flashbots.net/letter_avatar_proxy/v4/letter/j/4af34b/32.png) [@julie](https://collective.flashbots.net/u/julie)
#### Post date: [April 14, 2024, 6:15pm UTC](https://collective.flashbots.net/t/request-for-suapp-coprocessor-for-base/3277/4 "2024-04-14T18:15:51Z")

</div>

i need this!
