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.
Lifecycle of a user:
- People register compute jobs on Base (e.g., call a contract that emits an event
SUAVECoprocess(job)
- an event loop calls a SUAVE-geth node running inside an SGX, sending a transaction that calls the
BaseCoprocessingContract
on the functionMonitorBase
- 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 - enjoy applications enabled by private credible compute today
Contract
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.
- PoC on Rigil testnet + ChatGPT as a Subnet
- PoC of SUAVE-geth inside SGX
- Open source LLM as a Subnet
- Open source LLM subnet on SGX
- attestation of all SGX parts on Ethereum mainnet