For example, decentralized applications might need to estimate gas costs. The standard Ethereum tooling assumes that gas cost is proportional to the gas used by the transaction, which is correct on L1, but not on Optimism. Our gas costs are predominately the cost of writing the transaction to L1, which depends on the transaction size, not the amount of processing required. This difference requires us to have separate methods to provide gas estimates.
There are three ways to access Optimism services:
- On chain contract calls (opens new window). This is the way your contracts can get Optimism information or services directly.
- Off chain, using RPC. Which is more complicated but usable from any development stack (Python, Rust, etc.).