Lambda (læmdə, Greek: λάμ(β)δα, lám(b)da, λ) is a smartweave execution layer as rollup on top of WeaveVM testnet, more precisely, an MEM implementation. Lambda make use of WeaveVM's DA and Arweave permanent storage (via WeaveVM as proxy) to facilitate highly complex smart contracts beyond EVM and solidty (bytecode machine) limitations.
git clone https://github.com/weavevm/lambda.git
cd lambda
npm install && npm run sequencer
Lambda calculus (λ-calculus) is the foundation of Lazy Evaluation, the programming language theory on which SmartWeave (and thus Lambda) is built. Therefore, we decided to name this rollup "Lambda".
Currently, the sequencer is written in JavaScript with NAPI-rs bindings to facilitate a full transition to Rust in the near future.
Lambda follows the data protocol outlined in ERC-7689 (smart blobs) with slight modifications. Most importantly, it shares to the same data structure for ERC-7689 transactions (types 1 and 2).
ERC-7689 describes how to utilize EIP-4844 (blobs) to create a data-computation layer. In contrast, Lambda uses transaction calldata. This difference in data availability allows Lambda to be deployed on any EVM L1s and L2s, while ERC-7689 is limited to EVMs with EIP-4844 implemented, mostly restricted to L1s.
Calldata offers Lambda a "permanent" data availability on the EVM network, while blobs are limited to ~14 days of availability.
This section outlines the format used by the lambda sequencer to push data to Arweave. The sequencer interfaces with Arweave using Irys. When indexing data from lambda into Arweave, the following JSON format is utilized to construct the tx data:
{
"TxId": "L1_txid",
"Type": "1 or 2",
"Caller": "tx_caller",
"Data": "tx_calldata"
}
The Lambda context is injected by the sequencer during the lazy evaluation of a transaction. It provides a suite of useful APIs that are accessible during execution and the retroactive lazy evaluation:
method | description | status |
---|---|---|
lambda.msg.sender |
return the transaction sender (EOA) | supported |
lambda.tx.id |
return the call's transaction id | supported |
export async function handle(state, action) {
const input = action.input;
if (input.function === "increment") {
state.counter += 1;
state.users.push(lambda.msg.sender);
return { state };
}
}
{
"counter": 0,
"users": []
}
Testnet sequencer endpoint: https://lambda.pink
curl -X POST https://wvm-lambda-0755acbdae90.herokuapp.com/deploy -H "Content-Type: application/json" -d '{"txid":"$CONTRACT_ADDRESS"}'
curl -X POST https://wvm-lambda-0755acbdae90.herokuapp.com/transactions -H "Content-Type: application/json" -d '{"txid":"$INTERACTION_TXID"}'
curl -X POST https://wvm-lambda-0755acbdae90.herokuapp.com/tx -H "Content-Type: application/json" -d '{"txid":"$TXID"}'
For more code examples on how to interact with the Lambda sequencer (deploying contracts, sending interactions, reading state), check the code snippets available in examples.
This repository is licensed under the MIT License.