Optimism 백서

Optimism

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 13쪽

: the matrix is a routing page (clause 3 of the three-clause test), so every listing links one canonical documentation home and restates nothing. ## Listing Criteria A tool or SDK is eligible for the matrix only if **all** of the following hold: 1. **Open source, public repository.** The source is publicly available and the repository is linkable from the matrix. 2. **Works with the OP Stack as documented.** A developer can follow the tool's own quickstart against an OP Stack chain and succeed. Listings for tools that only incidentally support the OP Stack must link the OP-Stack-relevant entry point, not a generic homepage. 3. **Actively maintained.** The project ships releases and responds to issues. An archived or visibly abandoned repository is disqualifying. 4. **Has one canonical documentation home.** There is a single place we can link as the source of truth (per the content guide's dual-sourcing ban we will not maintain a copy of its documentation here). 5. **Honest support status.** The listing's support status must match what the owner declares in its own repository or docs. Experimental or preview software is listed as such, never as production. 6. **Third-party listings are marked.** Any listing not owned by the Optimism Collective passes through the `<ThirdPartyContent>` component, per the [content guide](/op-stack/contribute/content-guide). ## Proposing a Listing Open a pull request against the [matrix page](/app-developers/tools-sdks/support-matrix) that adds one row and, in the PR description, states how the tool meets each criterion above — with links as evidence (repository, docs home, release page, the owner's own status declaration). Reviewers apply this page; if a criterion is unclear, the fix is a PR to this page, not an exception. ## Removal Rule A listing is removed — not left stale — when it no longer meets the criteria. Typical triggers: * The repository is archived, or releases and issue activity have stopped. * The documented quickstart no longer works against an OP Stack chain. * The canonical docs home is gone or no longer maintained. * The owner's declared status changed and the listing was not updated (in that case, update the row instead if the tool still qualifies). Removal is an ordinary pull request that cites the failed criterion. Rows are never soft-deprecated in place: the ethereum.org experience this policy is modeled on shows that stale curated tables are worse than absent ones. ## Maintenance Sweep Curated listings rot silently, so accuracy is maintained by a scheduled sweep rather than by hoping readers report drift: * **What is checked.** Every sweep re-verifies all four cells of every row — purpose, owner, canonical docs link, and support status — against the upstream repository and docs, and re-checks each criterion above. * **What is recorded.** The sweep PR (or its "no changes" note) lists what was checked and the upstream sources consulted, so the next sweep starts from evidence. * **Who runs it.** The docs maintainers own the sweep as part of the standing docs review rotation; anyone may run one ahead of schedule by opening the same kind of PR. * **Outcome.** Each row is updated, confirmed, or removed under the removal rule. A sweep that cannot verify a row treats it as failing. ## Next Steps * Browse the [Tools & SDKs support matrix](/app-developers/tools-sdks/support-matrix). * Read the [content guide](/op-stack/contribute/content-guide) for the site-wide rules this policy inherits. # Consensus Source: https://docs.optimism.io/app-developers/tools-sdks/op-alloy/building/consensus The `op-alloy-consensus` crate provides an Optimism consensus interface. It contains constants, types, and functions for implementing Optimism EL consensus and communication. This includes an extended `OpTxEnvelope` type with [deposit transactions](https://specs.optimism.io/protocol/deposits.html), and receipts containing OP Stack specific fields (`deposit_nonce` + `deposit_receipt_version`). In general a type belongs in this crate if it exists in the `alloy-consensus` crate, but was modified from the base Ethereum protocol in the OP Stack. For consensus types that are not modified by the OP Stack, the `alloy-consensus` types should be used instead. ## Block [`op-alloy-consensus`](https://crates.io/crates/op-alloy-consensus) exports an Optimism block type, [`OpBlock`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/type.OpBlock.html). This type simply re-uses the `alloy-consensus` block type, with `OpTxEnvelope` as the type of transactions in the block. ## Transactions Optimism extends the Ethereum [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) transaction envelope to include a deposit variant. ### [`OpTxEnvelope`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/transaction/enum.OpTxEnvelope.html) The [`OpTxEnvelope`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/transaction/enum.OpTxEnvelope.html) type is based on [Alloy](https://github.com/alloy-rs/alloy)'s `TxEnvelope` type. Optimism modifies the `TxEnvelope` to the following. * Legacy * EIP-2930 * EIP-1559 * EIP-7702 * Deposit Deposit is a custom transaction type that is either an L1 attributes deposit transaction or a user-submitted deposit transaction. Read more about deposit transactions in [the specs](https://specs.optimism.io). ### Transaction Types ([`OpTxType`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/transaction/enum.OpTxType.html)) The [`OpTxType`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/transaction/enum.OpTxType.html) enumerates the transaction types using their byte identifier, represents as a `u8` in rust. ## Receipt Types Just like [`op-alloy-consensus`](https://crates.io/crates/op-alloy-consensus) defines transaction types, it also defines associated receipt types. [`OpReceiptEnvelope`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/enum.OpReceiptEnvelope.html) defines an [Eip-2718](https://eips.ethereum.org/EIPS/eip-2718) receipt envelope type modified for the OP Stack. It contains the following variants - mapping directly to the `OpTxEnvelope` variants defined above. * Legacy * EIP-2930 * EIP-1559 * EIP-7702 * Deposit There is also an [`OpDepositReceipt`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/struct.OpDepositReceipt.html) type, extending the alloy receipt type with a deposit nonce and deposit receipt version. # RPC Engine Types Source: https://docs.optimism.io/app-developers/tools-sdks/op-alloy/building/engine The [`op-alloy-rpc-types-engine`](https://docs.rs/op-alloy-rpc-types-engine/latest/op_alloy_rpc_types_engine/) crate provides Optimism types for interfacing with the Engine API in the OP Stack. Optimism defines a custom payload attributes type called [`OpPayloadAttributes`](https://docs.rs/op-alloy-rpc-types-engine/latest/op_alloy_rpc_types_engine/struct.OpPayloadAttributes.html). `OpPayloadAttributes` extends alloy's [`PayloadAttributes`](https://docs.rs/alloy-rpc-types-engine/latest/alloy_rpc_types_engine/payload/struct.PayloadAttributes.html) with a few fields: transactions, a flag for enabling the tx pool, the gas limit, EIP 1559 parameters, and a minimum base fee (used after the Jovian hardfork). Optimism also returns a custom type for the `engine_getPayload` request for both V3 and V4 payload envelopes. These are the [`OpExecutionPayloadEnvelopeV3`](https://docs.rs/op-alloy-rpc-types-engine/latest/op_alloy_rpc_types_engine/payload/v3/struct.OpExecutionPayloadEnvelopeV3.html) and [`OpExecutionPayloadEnvelopeV4`](https://docs.rs/op-alloy-rpc-types-engine/latest/op_alloy_rpc_types_engine/payload/v4/struct.OpExecutionPayloadEnvelopeV4.html) types, which both wrap payload envelope types from [`alloy-rpc-types-engine`](https://crates.io/crates/alloy-rpc-types-engine). # Building Source: https://docs.optimism.io/app-developers/tools-sdks/op-alloy/building/index This section offers in-depth documentation into the various `op-alloy` crates. Some of the primary crates and their types are listed below. * [`op-alloy-consensus`](https://crates.io/crates/op-alloy-consensus) provides [`OpBlock`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/type.OpBlock.html), [`OpTxEnvelope`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/transaction/enum.OpTxEnvelope.html), [`OpReceiptEnvelope`](https://docs.rs/op-alloy-consensus/latest/op_alloy_consensus/enum.OpReceiptEnvelope.html), and more. * [`op-alloy-rpc-types-engine`](https://crates.io/crates/op-alloy-rpc-types-engine) provides the [`OpPayloadAttributes`](https://docs.rs/op-alloy-rpc-types-engine/latest/op_alloy_rpc_types_engine/struct.OpPayloadAttributes.html). # op-alloy Source: https://docs.optimism.io/app-developers/tools-sdks/op-alloy/intro Welcome to the hands-on guide for getting started with `op-alloy`! `op-alloy` connects applications to the OP Stack, leveraging high performance types, traits, and middleware from [Alloy](https://github.com/alloy-rs/alloy). <Warning> **Development Status** `op-alloy` is in active development, and is not yet ready for use in production. During development, this documentation will evolve quickly and may contain inaccuracies. Please [open an issue](https://github.com/ethereum-optimism/optimism/issues/new) if you find any errors or have any suggestions for improvements, and also feel free to [contribute](https://github.com/ethereum-optimism/optimism/blob/develop/CONTRIBUTING.md) to the project! </Warning> ## Sections ### [Getting Started](/app-developers/tools-sdks/op-alloy/starting) To get started with op-alloy, add its crates as a dependency and take your first steps. ### [Building with op-alloy](/app-developers/tools-sdks/op-alloy/building/index) Walk through types and functionality available in different `op-alloy` crates. ### [Contributing](https://github.com/ethereum-optimism/optimism/blob/develop/CONTRIBUTING.md) Contributors are welcome! It is built and maintained by Alloy contributors, members of [OP Labs](https://github.com/ethereum-optimism), and the broader open source community. `op-alloy` follows and expands the OP Stack standards set in the [specs](https://specs.optimism.io). ### Licensing `op-alloy` is licensed under the combined Apache 2.0 and MIT License, along with a SNAPPY license for snappy encoding use. # Add op-alloy to your project Source: https://docs.optimism.io/app-developers/tools-sdks/op-alloy/starting Add the op-alloy crates to a Rust project with Cargo and pick the feature flags you need. [op-alloy](https://github.com/ethereum-optimism/optimism/tree/develop/rust/op-alloy) consists of a number of crates that provide a range of functionality essential for interfacing with any OP Stack chain. The most succinct way to work with `op-alloy` is to add the [`op-alloy`](https://crates.io/crates/op-alloy) crate with the `full` feature flag from the command-line using Cargo. ```txt theme={null} cargo add op-alloy --features full ``` Alternatively, you can add the following to your `Cargo.toml` file. ```txt theme={null} op-alloy = { version = "2.0", features = ["full"] } ``` For more fine-grained control over the features you wish to include, you can add the individual crates to your `Cargo.toml` file, or use the `op-alloy` crate with the features you need. After `op-alloy` is added as a dependency, crates re-exported by `op-alloy` are now available. ```rust theme={null} use op_alloy::{ consensus::OpBlock, network::Optimism, rpc_types::OpTransactionReceipt, rpc_types_engine::OpPayloadAttributes, }; ``` ## Features The [`op-alloy`](https://crates.io/crates/op-alloy) defines many [feature flags](https://docs.rs/crate/op-alloy/latest/features) including the following. Default * `std` * `k256` * `serde` Full enables the most commonly used crates: `consensus`, `network`, `rpc-types`, `rpc-types-engine`, and `rpc-jsonrpsee`. The `provider` crate is not part of `full` and is enabled with its own `provider` feature. * `full` The `k256` feature flag enables the `k256` feature on the `op-alloy-consensus` crate. * `k256` Arbitrary enables arbitrary features on crates, deriving the `Arbitrary` trait on types. * `arbitrary` Serde derives serde's Serialize and Deserialize traits on types. * `serde` Additionally, individual crates can be enabled using their shorthand names. For example, the `consensus` feature flag provides the `op-alloy-consensus` re-export so `op-alloy-consensus` types can be used from `op-alloy` through `op_alloy::consensus::InsertTypeHere`. ## Crates * [`op-alloy-network`](https://crates.io/crates/op-alloy-network) * [`op-alloy-provider`](https://crates.io/crates/op-alloy-provider) * [`op-alloy-consensus`](https://crates.io/crates/op-alloy-consensus) (supports `no_std`) * [`op-alloy-rpc-jsonrpsee`](https://crates.io/crates/op-alloy-rpc-jsonrpsee) * [`op-alloy-rpc-types`](https://crates.io/crates/op-alloy-rpc-types) (supports `no_std`) * [`op-alloy-rpc-types-engine`](https://crates.io/crates/op-alloy-rpc-types-engine) (supports `no_std`) ## `no_std` As noted above, the following crates are `no_std` compatible. * [`op-alloy-consensus`](https://crates.io/crates/op-alloy-consensus) * [`op-alloy-rpc-types-engine`](https://crates.io/crates/op-alloy-rpc-types-engine) * [`op-alloy-rpc-types`](https://crates.io/crates/op-alloy-rpc-types) To add `no_std` support to a crate, ensure the [check\_no\_std](https://github.com/ethereum-optimism/optimism/blob/develop/rust/op-alloy/scripts/check_no_std.sh) script is updated to include this crate once `no_std` compatible. # op-revm Source: https://docs.optimism.io/app-developers/tools-sdks/op-revm op-revm is the Optimism variant of revm, implementing OP Stack modifications to the EVM. `op-revm` is the Optimism variant of [revm](https://github.com/bluealloy/revm) — the OP Stack's modifications to the Ethereum Virtual Machine, packaged as a custom EVM built on top of the upstream `revm` framework. ## Features `op-revm` extends `revm` with everything the OP Stack needs on top of vanilla Ethereum execution: * **Deposit transactions** — the L1-to-L2 deposit transaction type and its execution semantics. * **L1 cost accounting** — `L1BlockInfo` and per-transaction L1 fee / blob fee calculation. * **Operator fees** — operator fee handling introduced in Isthmus and refined in Jovian. * **OP-specific precompiles** — including accelerated BN254 pairing. * **OP halt reasons & transaction errors** — OP Stack–specific execution failure modes. * **Hardfork-aware spec selection** — `OpSpecId` selects the right behavior for each OP Stack hardfork (Bedrock, Regolith, Canyon, Ecotone, Fjord, Granite, Holocene, Isthmus, Jovian, …). ## Provenance `op-revm` is vendored from upstream [`bluealloy/revm`'s `crates/op-revm`](https://github.com/bluealloy/revm/tree/main/crates/op-revm) and imported into the monorepo so it can evolve in lock-step with the rest of the OP Stack Rust code. The upstream release history lives in the [revm releases](https://github.com/bluealloy/revm/releases). ## Crate features The crate exposes the usual `revm` feature knobs, forwarded through to the underlying `revm` crate: * `default = ["std", "c-kzg", "secp256k1", "portable", "blst"]` * `std` — enables `std`-dependent code paths in `revm`, `alloy-primitives`, `serde_json`, etc. * `serde` — derives `serde` impls and forwards to `revm/serde` and `alloy-primitives/serde`. * `portable`, `c-kzg`, `secp256k1`, `blst`, `bn` — pass-through feature gates for the cryptographic backends. * `dev`, `memory_limit`, `optional_balance_check`, `optional_block_gas_limit`, `optional_eip3541`, `optional_eip3607`, `optional_no_base_fee`, `optional_fee_charge` — debugging and testing knobs forwarded to `revm`. `op-revm` supports `no_std` builds: disabling default features (or building with `--no-default-features`) produces a crate suitable for fault-proof and zkVM targets such as `riscv32imac-unknown-none-elf`. ## Building & testing From the `rust/` workspace root: ```bash theme={null} # Build cargo build -p op-revm # Run tests with all features cargo nextest run -p op-revm --all-features # no_std check (mirrors upstream's riscv32imac CI) cargo build -p op-revm \ --target riscv32imac-unknown-none-elf \ --no-default-features ``` The `no_std` build is also exercised by `just check-no-std` and runs in CI on every PR that touches `rust/**`. ## Using op-revm `op-revm` is the EVM used by [op-reth](/op-stack/components/op-reth) for OP Stack block execution, and by [Kona](https://github.com/ethereum-optimism/optimism/tree/develop/rust/kona) inside the fault-proof program and rollup node. Most users will consume it transitively through one of those components rather than depending on it directly; depend on `op-revm` directly only when building a custom OP Stack execution environment (for example, an alternate client or a zkVM proof backend). ## License `op-revm` is licensed under the MIT License — see [`rust/op-revm/LICENSE`](https://github.com/ethereum-optimism/optimism/blob/develop/rust/op-revm/LICENSE). # Supersim Multichain Development Environment Source: https://docs.optimism.io/app-developers/tools-sdks/supersim Learn how to use the Supersim local dev environment tool designed to simulate the OP Stack multi-chain environment. <Info> Interop is currently in active development and not yet ready for production use. The information provided here may change. Check back regularly for the most up-to-date information. </Info> [Supersim](https://github.com/ethereum-optimism/Supersim) is a local development environment tool designed to simulate the OP Stack for developers building multi-chain applications. It provides a simplified way to test and develop applications that interact with multiple chains within the OP Stack ecosystem. ## Supersim workflow ```mermaid theme={null} graph LR A[Write Smart Contracts] --> B[Deploy on Supersim] B --> C[Test Cross-Chain Interactions] C --> D[Debug and Refine] D --> B C --> E[Ready for Production] ``` This diagram illustrates the typical workflow for developers using Supersim, from writing smart contracts to testing and refining cross-chain interactions. ## Features and benefits * Simulates multiple OP Stack chains locally (e.g., chain 901, 902) * Supports testing of cross-chain messaging and interactions * Includes pre-deployed interoperability contracts * Offers a CLI interface for starting and managing Supersim instances * Provides local JSON-RPC endpoints for each simulated chain * Allows for custom configuration of chain parameters * Facilitates testing of Superchain-specific features like cross-chain token transfers * Easy to use with common Ethereum development tools * Supports chain forking ## Supersim CLI interaction ```mermaid theme={null} graph TD A[Developer] --> B[Supersim CLI] B --> C[Chain 901] B --> D[Chain 902] B --> E[...] C --> F[JSON-RPC Endpoint] D --> G[JSON-RPC Endpoint] E --> H[JSON-RPC Endpoint] ``` This diagram illustrates how developers interact with Supersim through the CLI, which simulates OP Stack-specific features (specifically interop) on locally run chains, each with its own JSON-RPC endpoint and pre-deployed interoperability contracts. ## Next steps * View more [Supersim tutorials](/app-developers/tutorials/development/supersim/first-steps) # Tools & SDKs Support Matrix Source: https://docs.optimism.io/app-developers/tools-sdks/support-matrix One page that differentiates the OP Stack SDK surfaces and developer tools — what each is for, who owns it, where its canonical docs live, and its support status. <Warning> Items on this page refer to third-party projects or products that are not maintained by Optimism. They are provided for convenience; refer to each project's own documentation as the source of truth. </Warning> This page is the canonical hub for the tools
프로젝트로 돌아가기