Key differences between EVM and Stellar for LayerZero developers. Understand the authorization model, storage tiers, TTL management, and other core concepts.
LayerZero’s universal messaging protocol enables any blockchain that supports state propagation and events to participate in crosschain communication — including Stellar.LayerZero provides Stellar Soroban contracts that can communicate with the equivalent Solidity Contract Libraries deployed on EVM chains.
If you’re new to LayerZero, we recommend reviewing “What is LayerZero?” before continuing.
Stellar’s Soroban smart contract platform differs from the EVM in several fundamental ways. This section covers the key differences you’ll encounter when building LayerZero applications on Stellar:
In Solidity, you check msg.sender to verify who called a function. Soroban uses a fundamentally different approach — the Soroban Authorization Framework:
In Soroban, the caller explicitly authorizes the action. This works with both contract-to-contract calls and user wallets, and supports batched authorization across multiple calls in a single transaction.
Solidity uses inheritance to build contract hierarchies (contract MyOFT is OFT). Soroban uses trait composition with proc macros:
// Soroban: #[lz_contract] provides contract, TTL, and auth; #[oapp] generates OApp trait implementations#[lz_contract]#[oapp]pub struct MyOApp;// You implement the receive logicimpl LzReceiveInternal for MyOApp { fn __lz_receive(env: &Env, origin: &Origin, guid: &BytesN<32>, message: &Bytes, extra_data: &Bytes, executor: &Address, value: i128) { // Your application logic }}
The #[oapp] macro generates implementations for OAppCore, OAppReceiver, OAppSenderInternal, and OAppOptionsType3. You can customize specific traits using #[oapp(custom = [receiver])].
All Soroban storage entries have a Time-To-Live (TTL). If a persistent entry’s TTL expires, it becomes archived and must be restored before it can be read. LayerZero contracts automatically manage TTL extension for critical storage entries.
On EVM, LayerZero fees are paid via msg.value. On Stellar, fees are paid by explicitly transferring the native token (XLM) to the Endpoint before calling send:
// Soroban: explicit fee transfer (handled internally by OApp)// 1. Transfer native fee to endpointnative_token.transfer(fee_payer, endpoint_address, native_fee);// 2. Call endpoint.send(...)
This is handled internally by the OApp base contract — you don’t need to manage fee transfers manually.