L1-L2 Interoperability
Common use cases
Many use cases require multi-layer interoperability, such as:
- The network's censorship resistance.
- Custom bridges.
- Multi-layer governing smart contracts.
- Multi-layer transfers.
L1 to L2 communication
L1 to L2 communication is governed by the
IZkSync.sol
inherited interfaces.
Gas estimation
The SDK processes gas estimation for transactions implicitly. However, it is also possible to implement the gas estimation processes explicitly.
L1 to L2 gas estimation for transactions
- Basic costs are measured in the amount of gas, and so the final cost depends on the gas price that the transaction assigns. The transaction process requires the current L1 gas price, transaction base cost, and transaction gas limit which defines the maximum amount of gas a transaction can consume.
L2 to L1
L2 to L1 communication is based on transferring the data as a message, and not on L1 transaction execution.
Priority queue
- All transaction types are supported by the priority queue.
- The priority queue must be fully permissionless to prevent malicious activity. For example, malicious users might send multiple transactions which push up the block gas limit to unworkable levels. To mitigate against this, submitting transactions to the priority queue is no longer free and users must pay a fee to the operator.