Connector
The connector bridges the blockchain and the MPC engine, relaying operation events off-chain and returning verified results.
Overview
The Connector serves as a bridge between the blockchain and the Multi-Party Computation (MPC) engine. By facilitating the interaction between the blockchain and the MPC engine, the Connector ensures that complex computations can be conducted securely and efficiently.
Responsibilities
The primary responsibility of the Connector is to enable the secure execution of operations requested within the blockchain network. Through this functionality, the Connector ensures that the security and privacy of these operations are uncompromised throughout the process. As blockchain technology continues to evolve, the need for such secure execution mechanisms becomes increasingly critical.

Entities
The connector is composed of some entities that work together to get the secure operation executed:
- Opcode decoder: Each bubble event is processed by a specific decoder responsible for converting the event into a secure operation.
- Listener: Monitors chain events. When a GC event occurs, it utilizes an opcode decoder to transform the event into a secure operation.
- Connector: Incorporates listeners for each supported chain. When a listener detects a request, the connector forwards the secure operation to the sequencer for processing. Additionally, it maintains a listener for the sequencer's decryption results, and upon receiving a result, it transfers it to the relayer.
- Sequencer: Handles a list of requested secure operations and sends them to the MPC engine for execution. After receiving responses from the MPC engine, it processes the data. Decrypted results are sent to the relayer to be returned to the calling contract, while encrypted data is stored internally. It is also responsible for saving all data in a database.
- Relayer: Responsible to send decryption results to the calling contract.
- Storage service: Used to save data in the database.
Functionality
Below is a detailed diagram of the connector flow:

Upon receiving a request from the blockchain, the Connector plays a pivotal role in initiating the interaction between the blockchain network and the MPC engine.
Here's how it works:
- The user performs a transaction that includes the secure "transfer" function (0).
- This transaction is forwarded to the Bubble Host Contract, GCHandler, which emits the GCTransfer event.
- The listener catches the event (1) and uses an opcode decoder to decode it into a secure operation.
- The Connector retrieves this operation and sends it to the Sequencer.
- The sequencer saves the event in its opcodes list (2).
- When the time comes, it sends the list as an opcodes block to the MPC engine (3-5).
- The MPC engine computes the secure operation and returns the result to the Sequencer (6-7).
- The sequencer processes the given results and saved the data.
- In case the user transaction contained decryption, the Sequencer creates a decryption result.
- The Connector gets this decryption result and forwards it to the Relayer (8).
- The Relayer executes a transaction to the user contract with the decryption results (9).