Soda Labs
Soda Labs Docs

Host contracts

Host contracts are the on-chain trust anchor of Bubble, managing access control and triggering off-chain encrypted computation.

Host Contracts Overview

Host contracts are a critical component in the blockchain ecosystem, specifically engineered to function on any supported blockchain, whether it's EVM-compatible or non-EVM. Their primary role is to serve as reliable bridges, ensuring seamless interaction between on-chain applications and the MPC (Multi-Party Computation) protocol. These host contracts are fundamental to maintaining trust and efficiency within the network.

Core Functions of Bubble Host Contracts

These smart contracts are designed with several key functions that make them indispensable in their role:

  1. Interaction with Encrypted Data: Host contracts allow confidential smart contracts to interact securely with encrypted data, referred to as "handles". This ensures that data privacy is maintained while still enabling necessary operations within the blockchain environment.
  2. Access Control Operations: They manage who can view or interact with handles, performing rigorous access control operations. This capability helps in safeguarding sensitive information and maintaining the integrity of data transactions.
  3. Event Emission for the Bubble Connector: Host contracts are responsible for emitting events that are essential for the Bubble connector in order to compute the secure operations.
  4. Signature verification: Host contracts provide cryptographic signature verification functionalities, allowing smart contracts to validate digital signatures associated with encrypted data or external requests. This ensures the authenticity of data sources and the integrity of interactions within the Bubble system.

Developer Integration Through GC Solidity Library

Developers benefit from host contracts indirectly through the GC Solidity library. This library abstracts much of the inherent complexity associated with the direct use of host contracts. By doing so, it provides a smooth integration into existing development workflows, enabling developers to leverage the power of host contracts without needing to understand their intricate details fully.

On this page