Why use Execution Machine (EXM) and Serverless Functions

Community Labs
6 min readFeb 21, 2023

--

Written by Rohit Pathare.

Execution Machine (EXM) is a developer platform that provides the ability to create functions that are stored on a blockchain or blockchain-like system (Arweave). These functions are known as serverless functions.

Serverless functions are meant to perform only a specific set of instructions. However, code from functions can be reused and composed in custom ways via function calls as per various applications requirements. As these functions and any information associated with them is stored on chain, they cannot be tampered with and can be verified by anyone, making them immutable and trustless, respectively.

EXM is often compared to smart contracts due to the syntaxof the logic. Even though serverless functions created with EXM rely on Smartweave’s standard for smart contracts on Arweave, there are a few differences between EXM’s serverless functions and smart contracts.

Let’s look some of the situations where Execution Machine’s serverless functions might stand out and be the right choice to use.

Advantages of using EXM’s Serverless Functions

Image depicting functions as modules that can be composed as per application requirements
Functions are modules that can be composed as per application requirements
  • Serverless functions add a layer of modularity and can be composed as per various application requirements.
    Every serverless function performs a specific set of instructions that can be reused. The developer has flexibility to compose the functions to interact with each other in custom ways as per various applications’ requirements. On the other hand, functions within a smart contract can only interact with each other as defined in the contract itself and hence a single smart contract can only cater to a single or limited number of applications. This takes away some of the flexibility and reusability seen in serverless functions. However, smart contracts provide increased security by having this rigid structure.
Image showing how bug fixes and new features can be localised to specific functions
Bug fixes and new features can be localised to specific functions
  • Bug fixes and new feature integrations are easier with Serverless functions.
    As the logic of an application is split into individual functions, any new feature or bug fix can be isolated to the specific function. Any breakdowns are also limited to the specific functions. For updating the smart contract, however, a new contract must be created each time. These changes are expensive due to the additional data storage and processing required on chain. This can also mean potential downtime on all the features of a contract when an error occurs.
Image of cached layer that rapidly serves information to applications
Cached layer rapidly serves information to applications
  • Execution Machine has a cached layer for rapidly serving applications.
    Every function has data (variables as well as a ledger of interactions with these variables) associated with it known as state. Upon receiving a transaction request, EXM does two things. It sends a request to Arweave to process the transaction and in the meantime, it optimistically assumes that the transaction will be processed successfully, updates the state accordingly and stores this updated state in a cache layer on a dedicated centralised server for rapidly serving this updated state to applications. Due to the server being centralised, the cached data can be updated almost instantly. This is useful in applications where data must be regularly updated and served swiftly. Smart contracts on the other hand are relatively more secure but for this, they must wait for the transaction requests to be processed on chain.
Image depicting user interaction flow from creating a transaction with EXM
A centralised server caters to applications while data is also posted on Arweave
  • Execution Machine leverages a centralised system while guaranteeing a decentralised result.
    As mentioned earlier, EXM stores a copy of the data on a centralised server. This is a tradeoff for a better user experience, as seen in the previous point. However, any information stored on EXM’s cached layer can be lazily evaluated and cross-verified with the information stored on Arweave, enabling EXM’s functions to receive the benefits of a decentralised network. Learn more about how EXM works here.
Image on how devs of various backgrounds can interact with EXM with ease
Only an API key is needed to leverage EXM and store information on Arweave
  • Execution Machine seek to be crypto agnostic.
    There are no need for keys, wallet and other blockchain technologies that may be intimidating to learn or blockers for building. EXM also pays the fees for data storage and interactions with Arweave. Additionally, it bears the burden of executing these transactions and updating the state on the cached layer to serve the updated state to users. Traditionally, smart weave contracts rely on verifiable computing which requires the users to execute the transactions locally to access the latest state. Thus, making the platform inclusive and easy to use for everyone including web2 devs.

Use cases of EXM

The main use cases of EXM currently are those where data must be rapid served while maintaining the benefits of decentralisation like immutability, transparency and security.

Use Arweave as a database with EXM
  • Database
    Arweave can be leveraged as a decentralised data layer with the help of EXM. Some applications of this are healthcare records, legal records, registries.
Create decentralised social media applications by easily uploading and indexing data
  • Decentralised Social Media
    Decentralised social media is a specific but broad extension of the application of EXM as a data layer. Media (pictures, videos, text, etc.), posts and any meta-data associated with these can be uploaded to Arweave and indexed.
Build file systems with the help of easy uploading and indexing
  • File system
    Another extension of the database application is using EXM as a pseudo file system for uploading and indexing on Arweave.
Leverage EXM as an oracle to exchange information between Arweave and the real world
  • Oracles
    Traditionally blockchains are walled gardens (to maintain security) and they need an intermediary (oracle) to communicate with the real world and exchange data. EXM can be programmed to perform this function at regular intervals.
Build backend with EXM that can serve integrated applications and no code platforms
  • Backend as a service (BaaS)
    Infrastructure platforms can integrate EXM in order to leverage serverless functions. Some use cases of this are integrated backends and no-code platforms that can benefit from the modularity and ease of debugging.
Store digital identities with EXM
  • Digital Identity
    EXM-Based Auth Platforms, Identity Platforms, “Digital Wallets” Platforms can leverage EXM to store and index data.
Build rapidly serving decentralised developer tooling
  • Developer Tooling
    A notification system is an example of developer tooling that can be built with EXM.

It’s important to note that blockchain-based serverless functions are still in the early stages of development and further research is needed to fully understand their capabilities and limitations.

That’s all folks!

Checkout our articles on using EXM’s JS SDK and CLI for understanding the implementation.
Share your projects with us on Twitter.

Happy Building!

--

--

Community Labs
Community Labs

Written by Community Labs

Community Labs is a software development company and venture studio focused on the Arweave ecosystem.

No responses yet