Skip to content

Execution Engine & Off-Chain Component

Smart contracts are isolated on their respective blockchains, limiting their access to external systems. Any blockchain application that requires integration with Web 2.0 technologies, need to implement this off-chain logic separately from the contract (on-chain), and need to ensure lockstep versioning between these components.

The Platform Blockchain provides Execution Engines and Off-Chain Components to solve this issue. These components allow programmers to extend their smart contracts with systems that can be automatically be run off-chain, with access to external systems such as local storage and Web 2.0. These components can be used to build confidential and auditable Key Management Services, Secret-sharing Services, among other types of services.

Capabilities of Off-Chain Components

Off-Chain Components is an extension of Smart Contracts such that they are capable avoiding the contract isolation issue above. Capabilities that are useful in the context of Off-Chain Components:

  • Web 2.0 Server for downloading from or uploading to the Smart Contract.
  • Server with private storage only available locally. Suitable for storing and reasoning about secrets that cannot be stored on-chain, but which should be available to, or managed by the Smart Contract in some capacity.
  • Automatic action whenever the Smart Contract is updated on-chain, by some on-chain transaction. Allows for doing work that cannot be done on-chain, such as working on confidential information, or accessing randomness, or Web 2.0.
  • Automatic sending of on-chain transactions based on some trigger, such as a HTTP request.

These capabilities allows for use cases such as:

  • Key Management Service that employs secret sharing for confidentiality. See Example contracts / Off-chain-secret-sharing for an example contract that implements a KMS with on-chain orchestration and authentication.
  • Specialized authentication systems that are not natively available for The Platform Blockchain.
  • Other forms of decentralized Web Servers that requires orchestration.
  • Automated notification of the on-chain once a specific date has passed.
  • Improved integration of web3 with Web 2.0.

Execution Engines and Off-Chain Component

The Platform Blockchain's Off-Chain Components are written as extensions to existing Smart Contracts, by implementing automatic invocations to respond to changes on the blockchain, and to receive incoming communication through Web 2.0.

Execution Engines are nodes that downloads the states and bytecode of specific smart contracts, inspects the bytecode for some specially marked code (the Off-Chain Component), and runs the code in an asynchronous manner, and on a server distinct from the blockchain. The Execution Engine provides all the methods required for the Off-Chain Component.

Compared to the On-Chain part of the Smart Contracts, these Off-Chain components provide:

  • Flexibility: Any protocol can be implemented in the Off-Chain Component, as these are entirely programmable.
  • Expressiveness: Write your off-chain and on-chain execution in Rust.
  • Secret storage: Built in storage for managing secret data.

Data flow for Off-Chain Components

Further reading for developers:

Running Off-Chain Components

The developer of the smart contract is themselves responsible for setting up the servers that will be running the off-chain components. These servers can be configured to run the Off-Chain Component of specific smart contracts.