<!-- Canonical: https://docs.linea.build/api/linea-smart-contracts/interfaces/l1/il1messageservice -->

> For the complete Linea documentation index, see [llms.txt](/llms.txt).
> Agents can fetch this page as Markdown at [https://docs.linea.build/api/linea-smart-contracts/interfaces/l1/il1messageservice.md](https://docs.linea.build/api/linea-smart-contracts/interfaces/l1/il1messageservice.md).

# IL1MessageService

# `IL1MessageService`

### ClaimMessageWithProofParams

#### Parameters

| Name | Type | Description |
| --- | --- | --- |

```solidity
struct ClaimMessageWithProofParams {
  bytes32[] proof;
  uint256 messageNumber;
  uint32 leafIndex;
  address from;
  address to;
  uint256 fee;
  uint256 value;
  address payable feeRecipient;
  bytes32 merkleRoot;
  bytes data;
}
```

### L2MerkleRootDoesNotExist

```solidity
error L2MerkleRootDoesNotExist()
```

_Thrown when L2 Merkle root does not exist._

### InvalidMerkleProof

```solidity
error InvalidMerkleProof()
```

_Thrown when the Merkle proof is invalid._

### ProofLengthDifferentThanMerkleDepth

```solidity
error ProofLengthDifferentThanMerkleDepth(uint256 actual, uint256 expected)
```

_Thrown when Merkle depth doesn't match proof length._

### claimMessageWithProof

```solidity
function claimMessageWithProof(struct IL1MessageService.ClaimMessageWithProofParams _params) external
```

Claims and delivers a cross-chain message using a Merkle proof.

_if tree depth is empty, it will revert with L2MerkleRootDoesNotExist. if tree depth is different than proof size, it will revert with ProofLengthDifferentThanMerkleDepth._

#### Parameters

| Name | Type | Description |
| --- | --- | --- |
| _params | struct IL1MessageService.ClaimMessageWithProofParams | Collection of claim data with proof and supporting data. |

Contributions not accepted

These reference pages are automatically generated based on Linea's [smart contracts](https://github.com/Consensys/linea-monorepo/tree/main/contracts/src). To ensure they accurately match the deployed smart contracts, we cannot accept any contributions that edit these pages.
