Skip to main content

Why Lyquid?

Lyquid represents a paradigm shift in blockchain development by offering several key advantages:

Unified Programming Model Traditional blockchain development forces you to separate your on-chain and off-chain logic, often requiring different languages, frameworks, and coordination layers. Lyquid simplifies this by unifying both under a single programming model, where on-chain and off-chain state coexist seamlessly, and logic is written side by side.

lyquid::state! {
// On-chain state (like Solidity storage)
network total_supply: U256 = U256::ZERO;
network balances: network::HashMap<Address, U256> = network::new_hashmap();

// Off-chain state (unique to Lyquid)
instance local_transactions: Vec<Transaction> = Vec::new();
}

With Lyquid, your off-chain computation code is bundled together with the on-chain logic in a hash-verified package. This ensures that Lyquor nodes, which execute the on-chain logic faithfully, also run the corresponding off-chain logic consistently, eliminating the need for external or bespoke off-chain infrastructure.

However, because this logic runs off-chain, it can still react independently to external events and access each node's own off-chain, instance-local state. This makes it possible to build efficient distributed and decentralized protocols, where all nodes execute consistent logic, while still interacting with their own unique local environment, which unlocks new classes of applications.

Ethereum Friendliness and API Compatibility If you're coming from Solidity, you'll feel right at home. Lyquid's programming model aligns naturally with the mental model of EVM developers, but with all the benefits of modern Rust semantics and Lyquor's powerful execution model.

Here's a quick comparison using a familiar example (an ERC-20 transfer function):

// Solidity
contract ERC20 {
mapping(address => uint256) private _balances;
/* ... other state variables ... */

function transfer(address to, uint256 amount) public returns (bool) {
address owner = msg.sender;
_transfer(owner, to, amount);
return true;
}
/* ... other functions ... */
}
// Lyquid
lyquid::state! {
network balances: network::HashMap<Address, U256> = network::new_hashmap();
/* ... other state variables ... */
}

lyquid::method! {
network fn transfer(&mut ctx, to: Address, amount: U256) -> LyquidResult<bool> {
let from = ctx.caller.clone(); // equivalent to msg.sender
transfer(&mut ctx.network, from, to, amount)?;
Ok(true)
}
/* ... other functions ... */
}

The parallels between Solidity and Lyquid are intuitive:

  • Solidity's mapping ↔ Lyquid's network::HashMap
  • Solidity's msg.sender ↔ Lyquid's ctx.caller
  • Solidity's public functions ↔ Lyquid's network methods

In addition, during the Lyquid build process, our compiler tools automatically generate compatibility layers that expose your contract's methods via standard Ethereum APIs like eth_call and eth_sendTransaction. As long as your function signatures use supported types (e.g., integers, strings, vectors, fixed arrays, etc.), your contracts can be called directly through Ethereum wallets. No custom SDKs or wrappers are required.

This means you can build next-generation contracts with Lyquid while still using familiar wallets, RPC tooling, and DApp interfaces, combining forward-looking capabilities with backward-compatible ergonomics.

Invisible Power, Built Right In Lyquid doesn't just simplify development. It embeds powerful features that redefine smart contract execution. Our Direct Memory Architecture (DMA) eliminates the gap between on-chain and off-chain computation by enabling on-chain logic and state to run as efficiently as off-chain, container-style code. This approach erases the traditional performance disparities, delivering rapid, cost-effective processing without sacrificing security. Conversely, DMA lets off-chain computation enjoy the same simplicity and programmability as on-chain logic, offering a more intuitive, stateful programming model compared to typical function-style serverless solutions.

Complementing DMA, the Universal Procedure Call (UPC) offers a fault-tolerant, decentralized primitive for off-chain computation. Unlike many current off-chain solutions which rely on ad hoc, centralized setups that sacrifice decentralization and reliability, UPC provides a concise, resilient pattern to coordinate off-chain execution across the network. This approach simplifies the development of complex distributed protocols while restoring the benefits of true decentralization for off-chain operations.

Together, DMA and UPC empower Lyquid to deliver a next-generation smart contract/serverless computing platform that offers high-performance execution and robust, decentralized off-chain coordination, all within a unified programming model.

FeatureSolidity/EVMRust/WASM (Solana, ink!, CosmWasm, ICP)Lyquid
On-chain Persistent State✅ (storage, slots)✅ (serialized key-value objects)✅ (network state)
Off-chain Local State❌ Not supported❌ Requires external indexing or workers✅ Native persistent (instance state)
Native Off-chain Computation❌ Not supported❌ External solutions required✅ On-chain style, per-node behavior with verified code
Developer Ergonomics🟡 Custom DSL, limited types🟡 Rust-native but complex setup, explicit serialization✅ Rust-native, minimal macros, easy setup
Execution Efficiency❌ Slow, high gas overhead🟡 Faster instruction speed, more state overhead✅ Consistent high efficiency on-chain & off-chain (DMA, minimal overhead)