copy-of-template-to-be-modified-(2)-1680285161.png
2023-04-01
Tip the author

EXM, a Serverless Functions Platform Explanation

EXM, a Serverless Functions Platform, Supercharges dApps with its cross-chain capabilities - A deep dive.

As cloud computing continues to evolve, one trend that is gaining popularity is the use of serverless functions. Instead of running an entire server to host a web application, serverless functions allow developers to create small, modular functions that can be run independently in response to events.

What are Serverless Functions 

Before diving into EXM’s improvements, I’d like to touch on some of the current benefits of using serverless functions that can paint a better picture of their capabilities.

  1. Cost savings: Since serverless functions only run when they are needed, you only pay for what you use. This means you can avoid the cost of running a server around the clock, which can be a significant expense.

  2. Scalability: Serverless functions can scale automatically in response to changes in demand. This means you don't need to worry about managing server capacity or provisioning new resources as your application grows.

  3. Faster development: With serverless functions, developers can focus on writing code rather than managing infrastructure. This can lead to faster development cycles and a more agile development process.

  4. Reduced maintenance: Since serverless functions are managed by the cloud provider, there is less infrastructure to maintain. This can reduce the amount of time and resources spent on maintenance tasks.

  5. Increased reliability: Serverless functions can be more reliable than traditional servers because they are designed to handle failures automatically. This means you don't need to worry about managing backups or redundancy.

Overall, serverless functions offer a number of benefits and as more organisations move to the cloud or seek better cost-efficient ways to run their applications, it's likely that we'll see an increase in the adoption of this technology. 

What is EXM?

The developer platform EXM, or Execution Machine, is the only platform designed specifically for the use and deployment of serverless functions in the blockchain ecosystem. EXM empowers the new web of applications by using a chain-agnostic data layer called Arweave, a type of blockchain that is designed to store any kind of arbitrary data. This data can be basic text, audio, or video, with a one-time payment to store and zero cost to recall any of that data from the growing pool of public uploads. It also has smart contracts, a type of digitally binding and verifiable code.

We believe EXM will play an important role in the adoption of the Arweave ecosystem. Our core goal is bringing the necessary developer tooling to leverage Arweave without necessarily knowing how it works, what's a blockchain or even what's Web3. Mass adoption of the ecosystem will occur as we remove the barrier lines- Founder - Andres Pirela.

         

EXM could be compared to other widely used and gaining popularity platforms such as Vercel, Deno, and Cloudflare. As businesses and developers alike are finding that the trade-offs of using serverless functions are beneficial in a bottom-line-impacting way, the growth and use will be increasing substantially compared to other native counterparts.
EXM is a perfect fit for developers looking to build on top of Arweave. It enables builders to create trustless applications without a user having to have a wallet and no use of tokens or wallets involved in the process. Unlike many other blockchain dApp platforms, users do not pay for their interaction when using EXM, thus bringing a native web experience to their development and integration.

How does EXM work?

Unlike many, if not all serverless platforms, EXM is capable of spinning up a new server every time a request comes in, while also being deterministically and incrementally stateful. What does this mean?

Statefulness is a way for programs to hold data that persists through different execution cycles. Traditional servers simply do not remember the context of previous requests. EXM, on the other hand, is fully capable of maintaining the state between each server request.

*State isn’t necessary for you to have an EXM application.

EXM is also capable of executing an endless amount of requests while persisting the state during each cycle. While this system can be complex, the bottom line is that your application is capable of holding data and sharing it in atomic order as traffic is received.

Off-chain computing with On-chain proofs

Off-chain computing can consist of things like transactional ordering services, randomness that can be verified, and smart contract automation. It can complex computational conditions that can then execute logic through EXM and then a proof is stored in an on-chain proof with Arweave. Abstracting away resources increases the utility and capabilities of what blockchains are capable of. By leveraging the computational power outside of the network or by adding oracles like Redstone, developers can focus on their applications and not the time it takes between network calls or the amount of traffic on the network, making scalability, cost efficiency, and high-performance applications to be easily built.

Lazy Evaluation and Verifiable Computing

Lazy evaluated contracts lets the users' machine do the work, instead of the network of nodes having to agree on the result. Since the data has already been verified through the network, it increases the speed at which the end result is in a workable state.

Making the state of a contract readable faster even if there are interactions happening in real-time.

Verifiable computing is the off-chain mechanism that will do the evaluating. It has 2 parts to the overall description, requirements and compatibilities.

1. Executor: The executor keeps track of all the information that comes in and can tell you what it has without having to process everything again.

2. Processor: The processor makes sure everything runs smoothly and that entries are in the right order.

3. Conveyor: The conveyor is like a helper that takes all the things that the processor has checked and sends them to Arweave. This way, we can always check back and see what happened from a verifiable source of truth.

With these three things in place, the following compatibilities are then needed.

1. The source code of the smart contract must be compatible with the executor and must be stored in a data-based blockchain.

2. The smart contract must be written in a way that is fully deterministic over time, a system in which no randomness is involved in the development of future states of the system.

Inside the Function

EXM has an API for interacting with outside API’s within the function itself. The built-in global deterministicFetch function acts the same as a javascript native fetch or Axios, giving applications even more flexibility. Being deterministic, it allows lazy evaluation to give flexibility within your functions.

Assumptions:

  • Your data will always be persisted automically request after request. Requests will never collide.

  • EXM will provide you with an optimistic state of your application while the final state is being calculated.

  • Data is always stored in Arweave.

Why use EXM 

EXM is the perfect fit for developers looking to build on top of Arweave. It enables builders to create trustless applications with no use of tokens or wallets involved in the process. Unlike many other Web3 dApp platforms, users do not pay for their interaction when using EXM thus bringing a Web2 experience to your development.

To make smart contracts and serverless function development even easier, the decent.land team has built Molecule.sh, an API for EXM developers that's built on top of the deterministicFetch EXM feature and composed of multiple reusable EXM components/codes to facilitate writing EXM functions, to easily incorporate contracts comparable to the OpenZeppelin smart contract library. This ensures that EXM smart contracts are secure and well-tested, while also providing developers with a wide range of pre-built functions that can be easily integrated into their own contracts.

But EXM isn't just limited to the Arweave blockchain. Thanks to its chain-agnostic design, the EXM platform and Molecule.sh smart contract library can be used across multiple blockchains. This makes it easier for developers to create cross-chain dApps that can interact with multiple networks. This means that developers can use their preferred blockchain wallet to interact with Arweave smart contracts, without needing to create separate Arweave-specific wallet.

Unlike many, if not all serverless platforms, EXM is capable of both spinning up a new server per request while also being deterministically & incrementally stateful.

How to use EXM through examples

Like counter

Imagine a "like" counter seen on various social media sites. Each request increments the counter amount by one. This kind of action requires database support on traditional servers but can be handled seamlessly via one call to EXM.

User Registry

EXM has also launched a user registry tutorial to learn how to create these serverless functions. The registry is an example of how to deploy, interact, and read the state of their functions from within a dApp.

To use the user registry tutorial, developers need an account and an API key. They also need to write a handler file containing an entry point method named "handle" with two parameters: state and action. The handler file is used to write the dApp, and its file name does not impact the way the code is deployed or interacted with.

The dApp tutorial reads data sent by a write operation, including a username, name, and last name, and pushes the data to an array of objects containing users. The code then returns the modified state variable with the new user, backed by predefined content that developers can use or rely on from the very first write operation.

Learning how to use the registry to store and manage user data in a decentralised manner. EXM hopes that the user registry tutorial will encourage more developers to use its platform to create innovative dApps with serverless functions.

Sybil Resistance

In conclusion, the launch of the EXM platform is a significant step forward for the decentralised application ecosystem as a whole. With multiple tutorials and ready-to-go functions by Molecule.sh, developers can learn to create more powerful and secure dApps that are backed by decentralised user data, opening up new possibilities for the future of decentralised applications, and encouraging more developers to use its platform to create innovative dApps that is an inclusive ecosystem with serverless functions.

Who is EXM and how to get involved;

  1. Andres Pirela - Founder @andreestech

  2. EXM - @exmbuild

  3. Discord 

Resources

Dameon M

Hi, I'm Dameon. Passionate about all things technological that can make our lives a little easier through social connectivity. A love for the oceanside has me residing in Miami, Florida.

Sign up for newsletter

Sign up here to get the latest news and updates delivered directly to your inbox.