> For the complete documentation index, see [llms.txt](https://ibran-fi.gitbook.io/ibran-fi-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ibran-fi.gitbook.io/ibran-fi-docs/documentation/developer-docs-cross-chain-messaging-with-hyperlane/architecture.md).

# Architecture

## Architecture: Hyperlane in Ibran Finance

At its core, **Hyperlane** enables arbitrary message passing between blockchains via on-chain Mailbox contracts. Ibran Finance uses this capability to send encoded lending-related data such as position information or user actions across chains for processing or finalization.

When a user interacts with the lending protocol, for example by initiating a deposit, a smart contract on the **origin chain (Base)** uses the Mailbox contract to dispatch a message. This message contains the necessary information about the user action and is emitted as an event on-chain.

A **Relayer service** monitors these Mailbox contracts and picks up the emitted messages. The Relayer then delivers the message to the **destination chain** such as Arbitrum or Optimism, where another Mailbox contract receives it.

On the destination chain, Ibran Finance has deployed a settlement or verification contract that consumes the message. Before execution, the message is verified by an **Interchain Security Module (ISM)**, a plug-and-play component in Hyperlane that validates the authenticity and origin of the message. Once verified, the message is processed by the target contract, updating balances, recording settlement, or taking another action depending on the payload.

<figure><img src="https://1706890399-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fut1KR5gBsYRStYYEyRyp%2Fuploads%2FAhbc74aldF5HFdYsfOlt%2Fibranarchifarcaster.png?alt=media&amp;token=c63c79f0-87ce-45ce-a35b-9bde83f789f3" alt=""><figcaption></figcaption></figure>

## Lock and Release Flow for WETH

In addition to standard lending operations, Ibran Finance uses **Hyperlane** to facilitate lock and release operations for Ethereum-backed assets.

**1. Lock on Base**\
The user deposits **WETH** into the protocol on Base, locking it in a custody smart contract.

**2. Message Dispatch**\
The custody contract sends a message via Hyperlane’s Mailbox containing lock details such as asset type, amount, and user address.

**3. Relayer Delivery**\
The message is delivered to the destination chain where the wrapped or synthetic version of the asset will be released.

**4. Release on Destination Chain**\
A corresponding wrapped WETH is minted or transferred to the user’s address on the destination chain.

**5. Redeem Process**\
To unlock the original asset, the user returns or burns the wrapped asset on the destination chain, triggering Hyperlane to send a verified unlock message back to Base.

**6. Unlock on Base**\
The custody contract releases the original WETH to the user.

This flow ensures assets move securely across chains without relying on centralized custody or traditional bridges.

## Components Used

* **Mailbox Contracts:** Deployed by Hyperlane on all supported chains, these contracts provide the interface for sending and receiving interchain messages.
* **Relayer:** A service that listens to Mailbox dispatch events on the source chain and delivers them to the destination chain’s Mailbox. This can be run by Ibran Finance or independent operators.
* **Interchain Security Module (ISM):** A configurable security layer that validates messages before allowing execution. In Ibran Finance, ISMs are tailored for both lending messages and lock-release operations.
* **Sender Contract:** A Base-based contract that encodes and sends lending or lock-release data to the Mailbox.
* **Receiver Contract:** A contract on the destination chain that consumes verified messages and updates state, mints wrapped assets, or records settlements.

## Why Hyperlane for Ibran Finance

* **Permissionless Deployment:** Integration does not require approval, allowing rapid deployment on new chains.
* **Customizable Security:** ISMs can be tuned for different trust assumptions depending on message type or chain pair.
* **Efficient Interoperability:** Eliminates the need for centralized bridges while maintaining speed and security.

This architecture ensures that lending and Ethereum-backed operations on Ibran Finance remain decentralized, composable, and secure across multiple chains.
