Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify bridging execution fees #936

Merged
merged 7 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 69 additions & 7 deletions docs/get-started/how-to/bridge/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ image: /img/socialCards/bridge-your-tokens.jpg
---

import DocCardList from '@theme/DocCardList';
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

You can bridge bridge tokens (ETH or ERC-20) to provide liquidity in different ways. Linea's default
canonical token bridge allows you to bridge ETH or ERC-20 tokens using a UI.
Expand Down Expand Up @@ -60,10 +62,70 @@ If you are interested by this option, please get in touch with us so that we can

## What are the execution fees?

There are two types of execution fees that can be applied when you are bridging your tokens, the postman fee and the anti-DDOS fee.

The postman fee is only applied during the automatic claiming process and is calculated by the following formula:

`Postman Fee = target layer gas price * (gas estimated + gas limit surplus) * margin` where target layer gas price is `eth_gasPrice` on the target layer, `gas estimated = 100,000`, `gas limit surplus = 6000`, and `margin = 2`.

The anti-DDOS fee is only applied when bridging from L2 to L1 and is set to `0.001 Eth`
Two types of execution fees can be applied when you are bridging your tokens: the postman fee and
the anti-DDOS fee. Since the postman fee is only applied during the automatic claiming process,
execution fees vary depending on _what_ you're bridging and the direction.

Refer to the table for which fees will apply to your bridge transfer:

<Tabs className="my-tabs">
<TabItem value="ETH" label="ETH">
<table>
<tr>
<th>Type</th>
<th>Transaction fee</th>
<th>Anti-DDOS fee</th>
<th>Postman fee</th>
</tr>
<tr>
<td>L1 to L2 (Manual claiming)</td>
<td>:white_check_mark:</td>
<td>:x:</td>
<td>:x:</td>
</tr>
<tr>
<td>L1 to L2 (Automatic claiming)</td>
<td>:white_check_mark:</td>
<td>:x:</td>
<td>:white_check_mark:</td>
</tr>
<tr>
<td>L2 to L1 (Manual claiming)</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
<td>:x:</td>
</tr>
</table>
</TabItem>
<TabItem value="ERC-20" label="ERC-20">
<table>
<tr>
<th>Type</th>
<th>Transaction fee</th>
<th>Anti-DDOS fee</th>
<th>Postman fee</th>
</tr>
<tr>
<td>L1 to L2 (Manual claiming)</td>
<td>:white_check_mark:</td>
<td>:x:</td>
<td>:x:</td>
</tr>
<tr>
<td>L2 to L1 (Manual claiming)</td>
<td>:white_check_mark:</td>
<td>:white_check_mark:</td>
<td>:x:</td>
</tr>
</table>
</TabItem>
</Tabs>

Key:
- Transaction fee: The transaction (gas) fee required for the bridge operation.
- Anti-DDOS fee: A 0.001 ETH fee applied when bridging from L2 to L1.
- Postman fee: `target layer gas price * (gas estimated + gas limit surplus) * margin`, where:
- `target layer gas price` = `eth_gasPrice` on the target layer
- `gas estimated` = 100,000
- `gas limit surplus` = 6000
- `margin` = 2
18 changes: 17 additions & 1 deletion docs/technology/message-service.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,23 @@ addresses above.
- An optional field used to incentivize a Postman to perform `claimMessage(...)` automatically
on the destination chain (not available when bridging from L2 to L1, or for non-ETH transfers)
- `_calldata`: a flexible field that is generally created using `abi.encode(...)`
1. Dapp uses the [Postman SDK](https://www.npmjs.com/package/@consensys/linea-sdk?activeTab=readme)
:::info[Calculating `_fee`]

- L1 -> L2:
- Automatic claiming: Postman fee = `target layer gas price * (gas estimated + gas limit surplus) * margin`, where:
- `target layer gas price` = `eth_gasPrice` on the target layer
- `gas estimated` = 100,000
- `gas limit surplus` = 6000
- `margin` = 2
- Manual claiming: 0
- L2 -> L1:
- Manual claiming: Anti-DDOS fee = `0.001 ETH`

See our [main bridge page](../get-started/how-to/bridge/index.mdx) for more information on the
execution fees that apply.

:::
2. Dapp uses the [Postman SDK](https://www.npmjs.com/package/@consensys/linea-sdk?activeTab=readme)
to simplify the execution of messages on the destination layer by:
- Triggering the delivery
- If messages don't get delivered by the postman, the message can be manually claimed by
Expand Down
Loading