Contract Lifecycle (VM)
Last updated
Last updated
The entire smart contract development flow goes through three phases:
Smart-Contract development. A developer writing a smart contract on L1X. They will be using Rust programming language which provides a safe and efficient environment for contract development. L1X Smart Contract SDK provides them a safe API they can use to build such contracts.
Building the smart-contract. The code goes through various transformations to reach its final form.
Macro pre-processing. By leveraging Rust’s powerful metaprogramming capabilities we can create high-level abstractions for the ease of development on L1X.
LLVM. The LLVM compiler infrastructure will be used for compiling and optimizing Rust code into the platform-agnostic LLVM Intermediate Representation (IR).
LLVM IR -> WASM. Enabled by the existing LLVM compilation capabilities.
WASM -> eBPF. A custom translator takes the generated WASM file and translates it to eBPF bytecode.
Running. The resulting ELF file with eBPF bytecode is the contract binary that developer publishes on-chain.
L1X VM. The Layer One X Virtual Machine responsible for executing the smart contracts in a secure and efficient manner, integrating with the L1X blockchain and handling state updates.