Skip to main content

Workflow

As explained in the section on Actors, smart contract-based requests can originate from various Request Chains, depending on where the smart contracts of the respective dApps (referred to as 'Users') are deployed. Staking tokens separately on each Request Chain would be inefficient for Executors, so the Serverless protocol utilizes a Common Chain to manage Executors' stakes, as well as to handle rewards and penalties. However, this creates a challenge where requests originate from, and responses are expected on, chains other than the one managing rewards and penalties.

The Serverless protocol employs a category of actors known as Gateways to bridge requests and responses between the Request Chain and the Common Chain. Both Gateways and Executors rely on Trusted Execution Environments (TEEs) to ensure they are accurately relaying messages and performing computations. If they fulfill their duties correctly, they are compensated by the Users; however, if they fail to submit the expected messages or responses (as confirmed transactions) within the specified deadlines, they are subject to slashing.

Following workflows describe how the various actors within the protocol coordinate with one another.

  1. Registration of Gateways
  2. Registration of Executors
  3. Request-response lifecycle
  4. Serverless Subscriptions