SDK


In most ways Optimism is EVM equivalent (opens new window). However, the are a few differences, which sometimes require decentralized applications to access Optimism-specific services.

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:

  1. On chain contract calls (opens new window). This is the way your contracts can get Optimism information or services directly.
  2. The JavaScript SDK. For use when you write JavaScript or TypeScript code, either in the client or a Node.js server.
  3. Off chain, using RPC. Which is more complicated but usable from any development stack (Python, Rust, etc.).

Improving the SDK

If you find a bug, or if there's a feature you think we should add, there are several ways to inform us.