Commit 45c15a62 authored by Ori Pomerantz's avatar Ori Pomerantz

feat(*): Following Mattie's outline

parent 45b10b9d
...@@ -42,27 +42,23 @@ module.exports = { ...@@ -42,27 +42,23 @@ module.exports = {
}, },
nav: [ nav: [
/* When you update here, don't forget to update the tiles /* When you update here, don't forget to update the tiles
in src/README.md */ in src/README.md */
{ {
text: 'How Optimism Works', text: 'How Optimism Works',
link: '/docs/protocol/', link: '/docs/how-optimism-works/'
}, },
{ {
text: 'Support', text: 'Protocol Specs',
link: '/docs/biz/' link: '/docs/protocol/'
}, },
{ {
text: 'Security', text: 'Security',
link: '/docs/security-model/', link: '/docs/security-model/',
}, },
{ {
text: 'Dev Docs', text: 'Developer Docs',
link: '/docs/developers/', link: '/docs/developers/',
}, },
{
text: "Governance",
link: "/docs/governance/"
},
{ {
text: 'Contribute', text: 'Contribute',
link: '/docs/contribute/', link: '/docs/contribute/',
...@@ -121,174 +117,35 @@ module.exports = { ...@@ -121,174 +117,35 @@ module.exports = {
} }
], ],
searchPlaceholder: 'Search the docs', searchPlaceholder: 'Search the docs',
sidebar: { sidebar: {
'/docs/governance/': [ '/docs/how-optimism-works': [
[ '/docs/how-optimism-works/design-philosophy.md',
'/docs/governance/', '/docs/how-optimism-works/rollup-protocol.md',
'What is the Optimism Collective?' ],
], '/docs/protocol/': [
[ '/docs/protocol/contract-overview.md',
'https://www.optimism.io/vision',
'The Optimistic Vision'
],
{
title: "OP Holders",
children: [
'/docs/governance/howto-delegate.md',
'/docs/governance/economics.md',
'/docs/governance/allocations.md',
'/docs/governance/airdrop-1.md'
],
collapsable: true,
},
{
title: "Delegates",
children: [
'/docs/governance/delegate.md',
'/docs/governance/existing-delegate.md',
'/docs/governance/delegate-info.md',
],
collapsable: true,
},
{
title: "Proposal Submitters",
children: [
'/docs/governance/proposals.md',
[
'https://gov.optimism.io/tags/c/proposals/38/passed',
'Passed Proposals'
]
],
collapsable: true,
},
{
title: "Token House Governance",
children: [
'/docs/governance/token-house.md',
'/docs/governance/token-house-history.md',
'/docs/governance/gov-fund.md',
[
"https://docs.google.com/spreadsheets/d/1Ul8iMTsOFUKUmqz6MK0zpgt8Ki8tFtoWKGlwXj-Op34",
"Governance Fund Tracker"
],
[
'https://gov.optimism.io/t/working-constitution-of-the-optimism-collective/55',
"Working Constitution"
],
[
'https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md',
'Operating Manual'
]
],
collapsable: true,
},
{
title: "Citizen House Governance",
children: [
'/docs/governance/citizens-house.md',
'/docs/governance/citizenship.md',
'/docs/governance/retropgf-2.md',
],
collapsable: true
},
[
'https://calendar.google.com/calendar/u/0?cid=Y19mbm10Z3VoNm5vbzZxZ2JuaTJncGVyaWQ0a0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t',
'Governance Calendar'
],
'/docs/governance/attestation-station.md'
], ],
'/docs/security-model/': [ '/docs/security-model/': [
'/docs/security-model/optimism-security-model.md', '/docs/security-model/optimism-security-model.md',
'/docs/security-model/bounties.md', '/docs/security-model/bounties.md',
[ ],
'https://medium.com/ethereum-optimism/our-pragmatic-path-to-decentralization-cb5805ca43c1',
'Decentralizing Optimism'
]
],
'/docs/protocol/': [
{
title: 'How Optimism Works',
children: [
'/docs/protocol/1-design-philosophy.md',
'/docs/protocol/2-rollup-protocol.md',
],
collapsable: false,
},
{
title: 'Protocol Specs',
children: [
'/docs/protocol/protocol-2.0.md',
'/docs/protocol/compressed-ctc.md'
],
collapsable: false,
}
],
'/docs/developers/': [ '/docs/developers/': [
'/docs/developers/releases.md',
{
title: 'Building on Optimism',
children: [
'/docs/developers/build/using-tools.md',
'/docs/developers/build/transaction-fees.md',
'/docs/developers/build/system-contracts.md',
'/docs/developers/build/dev-node.md',
'/docs/developers/build/run-a-node.md',
'/docs/developers/build/differences.md',
'/docs/developers/build/json-rpc.md',
'/docs/developers/build/testing-dapps.md',
'/docs/developers/build/cheap-dapp.md'
],
},
{
title: 'Bridging L1 and L2',
children: [
'/docs/developers/bridge/basics.md',
'/docs/developers/bridge/standard-bridge.md',
'/docs/developers/bridge/messaging.md',
'/docs/developers/bridge/comm-strategies.md'
],
collapsable: true,
},
'/docs/developers/known-issues.md',
{
title: "Useful Tools",
children: [
'/docs/useful-tools/networks.md',
'/docs/useful-tools/debugging.md',
'/docs/useful-tools/faucets.md',
'/docs/useful-tools/monitoring.md',
'/docs/useful-tools/explorers.md',
'/docs/useful-tools/providers.md',
'/docs/useful-tools/oracles.md',
'/docs/useful-tools/meta-tx.md',
['https://www.optimism.io/apps/tools', 'Third Party Tools'],
],
},
{
title: "SDK",
children: [
'/docs/sdk/js-client.md',
[
'https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/docs',
'Optimism Contracts'
],
'/docs/sdk/alchemy-sdk.md'
]
},
'/docs/developers/media.md',
{ {
title: "OP Stack: Bedrock", title: "OP Stack: Bedrock",
children: [ children: [
'/docs/developers/bedrock/explainer.md', '/docs/developers/opstack/explainer.md',
'/docs/developers/bedrock/differences.md', '/docs/developers/opstack/differences.md',
'/docs/developers/bedrock/public-testnets.md', '/docs/developers/opstack/public-testnets.md',
'/docs/developers/bedrock/node-operator-guide.md', '/docs/developers/opstack/node-operator-guide.md',
'/docs/developers/bedrock/upgrade-guide.md', '/docs/developers/opstack/upgrade-guide.md',
'/docs/developers/bedrock/metrics.md' '/docs/developers/opstack/metrics.md'
] ]
} },
'/docs/developers/releases.md'
], ],
'/docs/contribute/': [
'/docs/contribute/README.md'
]
} }
}, },
......
...@@ -6,36 +6,26 @@ heroImage: /assets/logos/header.png ...@@ -6,36 +6,26 @@ heroImage: /assets/logos/header.png
heroText: The Optimism Docs heroText: The Optimism Docs
features: features:
- title: Quick Start
icon: book
details: How-to guides and tutorials for users and developers.
link: /docs/guides/
- title: How Optimism works - title: How Optimism works
icon: info-square icon: info-square
details: General explanation of what makes Optimism tick. details: General explanation of what makes Optimism tick.
link: /docs/protocol/2-rollup-protocol/ link: /docs/how-optimism-works/
- title: Optimism's Security Model
icon: shield
details: Understand the safety and liveness properties of Optimism.
link: /docs/security-model/
- title: Protocol specs - title: Protocol specs
icon: ruler-triangle icon: ruler-triangle
details: More detailed information about how Optimism works under the hood. details: More detailed information about how Optimism works under the hood.
link: /docs/protocol/ link: /docs/protocol/
- title: Optimism's Security Model
icon: shield
details: Understand the safety and liveness properties of Optimism.
link: /docs/security-model/
- title: Developer docs - title: Developer docs
icon: code icon: code
details: Resources for building a decentralized application on Optimism. details: Resources for building a decentralized application on Optimism.
link: /docs/developers/ link: /docs/developers/
- title: Tools for developers
icon: hammer
details: Useful third-party tools for easier development and deployment.
link: /docs/useful-tools/
- title: Contribute - title: Contribute
icon: hands-helping icon: hands-helping
details: Check out the Optimism community and join the conversation. details: Check out the Optimism community and join the conversation.
......
---
title: How do I get project support (marketing / integrations / etc.)?
lang: en-US
---
Welcome! We're stoked that you're launching on Optimism.
If you have not filled out the [get started form](https://oplabs.typeform.com/get-in-touch?typeform-source=community.optimism.io) please do so prior to reading this.
We are excited for your deployment onto Optimism!
You will be welcomed by [the following metrics](https://dune.com/optimismfnd/Optimism) 📈📈 (up and to the right!), [a budding community](https://discord-gateway.optimism.io/) 🫂🫂, and some great exclusive [Telegram Channels](https://t.me/+Cb7q0a1YqItkZTRk) ⚙️⚙️ for builders.
The OPLabs team gets a flurry of inbound messages and calls every day and we reply to them as efficiently as possible, but we are only human!
Please be patient if you are in need of direct support.
We cannot always provide direct help, but we strive to help everyone succeed on Optimism through the various resources we provide to projects.
## Developer Support 🙋💻
Steps to take if you would like developer support immediately, ranked in order of response times.
1. See our [Developer Documentation](../developers/), [Tutorials](https://github.com/ethereum-optimism/optimism-tutorial), and [Help Center](https://help.optimism.io)
1. Head over to [**#dev-support**](https://discord.com/channels/667044843901681675/887914409207414785) on discord for the fastest help
1. Join [this TG group](https://t.me/+Cb7q0a1YqItkZTRk) and ask for help there
1. Last attempt: [Fill out this form](https://oplabs.typeform.com/get-in-touch?typeform-source=community.optimism.io)
## Marketing Requests 🦸🦸
When your project is deployed on Optimism, you can be added to [our ecosystem page](https://www.optimism.io/apps/all).
Simply [fill out this form](https://oplabs.typeform.com/op-marketing) to be included. Inclusion is at our discretion.
We add new projects live on the Optimism mainnet [here](https://www.optimism.io/apps/all) once a week.
### Promoting Values before anything else
We love to promote values-aligned projects as part of our broader content program.
### Tweeting
We do the occasional retweet but the bar for these is kept quite high in order to keep our Twitter feed as valuable/high signal as possible.
Other than RT's, we may like or reply to a tweet or include it in our weekly wrap up thread.
You're welcome to submit your tweet for amplification but please keep in mind if and how we interact with it is at our sole discretion.
### OPRadio
We also host a weekly Twitter Space in an interview/podcast format called OP Radio. You're welcome to express interest in being featured on OP Radio, but keep in mind that we maintain the final say on whether it makes sense or not.
## Governance Grants
Grants are mainly handled by [The Optimism Collective](https://app.optimism.io/announcement), our open governance system/digital society. If you are interested in applying, we first recommend the following:
- Check that your application falls within the possible Governance Grant categories in the [OPerating manual](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md#valid-proposal-types).
- Deploy to Optimism (we are [EVM Equivalent](https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), not just EVM compatible so it is very easy to deploy).
Check out our [getting started tutorial](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/getting-started) to see how to deploy. We also have [tons of more in-depth tutorials](https://github.com/ethereum-optimism/optimism-tutorial) for bridging and other L2 specific functionality.
- Try gaining organic traction:
- Traction can be gained through our community.
- Head over to [our discord](https://discord-gateway.optimism.io/) and check out [#showandtell](https://discord.com/channels/667044843901681675/819333988719263774) or [#demoday](https://discord.com/channels/667044843901681675/960493820674465883).
Demo Day is an AMA about your product to our community. Apply in Discord.
- Seek synergies – look at other teams already deployed on Optimism that could work with your product and reach out to them.
- Once you have done the above, check out our [governance grant process](https://gov.optimism.io/t/grant-proposal-template/3233).
- To get reviews in real time from governance delegates go to discord and post about your project in [#temp-check](https://discord.com/channels/667044843901681675/1011238484373159956).
## Other Helpful Links
Curious about our Optimistic Origins?
Listen to [this OPRadio Episode](https://twitter.com/optimismFND/status/1585015947626426368) with one of our founders, [@JingleJam](https://twitter.com/jinglejamOP).
What do the next 100 years have in store for crypto? [@Karl_dot_tech](https://twitter.com/karl_dot_tech) shares his vision in [this chat with Bankless](https://www.youtube.com/watch?v=60F2wtjZO5M).
Want to see what we are doing with Retroactive Public Goods? [See here](../governance/retropgf-2.md)
Changes to the protocol coming in the near term include multi-client architecture, and the world’s next generation fault proof.
Check out [Bedrock](https://dev.optimism.io/introducing-optimism-bedrock/) and [Cannon](https://medium.com/ethereum-optimism/cannon-cannon-cannon-introducing-cannon-4ce0d9245a03).
Want to see the first ever step forward into a modular rollup architecture? We are making it easy for anyone to deploy their own app-specific rollup via the [OP Stack](https://optimism.mirror.xyz/fLk5UGjZDiXFuvQh6R_HscMQuuY9ABYNF7PI76-qJYs).
**Fun fact:** A team has already launched [a Voxel Game on the OP Stack](https://dev.optimism.io/opcraft-autonomous-world/)!
Interested in exploring more?
[Fill out this form](https://docs.google.com/forms/d/e/1FAIpQLSciIONqVoMI6ivlrvp2EAdjrWqmZVGIpEaBbhaVZ17ZOf8DqQ/viewform?usp=sharing).
**Last note:** [We’re hiring](https://boards.greenhouse.io/oplabs)!
Join our community!
Have fun!
Enjoy life!
Don’t worry so much!
Brush your teeth!
Eat apples!
Eat bacon!
Research the origins of public relations!
Give back to your community!
Tweet things you don’t actually believe!
Download free music using your library card!
Don’t download a car!
Don’t listen to anyone except for your parents, and even then, with a grain of salt!
## WELCOME TO THE COLLECTIVE 🔴✨
differences.md
\ No newline at end of file
---
title: Bridging basics
lang: en-US
---
Although Optimism is an L2 (and therefore fundamentally connected to Ethereum), it's also a separate blockchain system.
App developers commonly need to move data and assets between Optimism and Ethereum.
We call the process of moving data and assets between the two networks "bridging".
## Sending tokens
For the most common usecase, moving tokens around, we've created the [Standard Token Bridge](./standard-bridge.md).
The Standard Token Bridge is a simple smart contract with all the functionality you need to move tokens between Optimism and Ethereum.
It also allows you to easily create L2 representations of existing tokens on Ethereum.
## Sending data
If the Standard Token Bridge doesn't fully cover your usecase, you can also [send arbitrary data between L1 and L2](./messaging.md).
You can use this functionality to have a contract on Ethereum trigger a contract function on Optimism and vice versa.
We've made this process as easy as possible by giving developers a simple API for triggering a cross-chain function call.
We even [use this API under the hood](https://github.com/ethereum-optimism/optimism/blob/a21cec6d3d00c9d7ed100c0257d4b966b034620f/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol#L202) inside the Standard Token Bridge.
---
title: Communication Strategies
lang: en-US
---
Dapps' inter-layer communication strategies are based on trade-offs between several parameters:
- Speed
- Cost
- Trust assumptions
An issue related to both speed and decentralization is the L2 state.
This state is vulnerable to fault challenges until the fault challenge period (currently one week) passes.
If you want to do something that relies on the L2 state prior to that point, you should [run a replica](../build/run-a-node.md) yourself to make sure the state you use is correct.
## Fully centralized
If your dapp has a centralized always on server, the easiest solution is to just have two providers, one connected to Ethereum (L1) and the other to Optimism (L2).
| Parameter | Evaluation |
| - | - |
| Speed | Fastest
| Cost | Cheapest
| Trust assumption | Centralized
### Using the client (please don't)
The client (typically a browser with a wallet) can also connect to both Ethereum and Optimism, but it isn't a great mechanism for inter-layer communication.
You know what the code in the server is, because you wrote it.
You know what the code in the client is *supposed to be*, but it is possible for users to run a different client that pretends to be the legitimate one.
The only time that you can trust the client for inter-layer communication is when it is in the best interest of the user running the client not to lie.
And even then, you shouldn't because a hacker can cause a user to run malware.
## Fully decentralized
If you want to keep the same decentralization promises as Optimism and Ethereum, you can [rely on our messaging infrastructure](messaging.md).
You are already trusting Optimism to run the chain, and the messaging infrastructure goes through the same development process.
### Messages from L1 to L2
If you want L1 code to either tell L2 code to do something, or update L2 code with some information, you just need to [issue a single L1 transaction](messaging.md#for-ethereum-l1-to-optimism-l2-transactions).
| Parameter | Evaluation |
| - | - |
| Speed | ~15 minutes
| Cost | Cheapish (requires an L1 transaction)
| Trust assumption | Same as using Optimism
### Messages from L2 to L1
Sending messages from L2 to L1 is [a lot harder](messaging.md#for-optimism-l2-to-ethereum-l1-transactions).
It requires two transactions:
1. An initiating transaction on L2, which is pretty cheap.
1. Once the fault challenge period passes, a claiming transaction on L1, which includes [a merkle proof](https://medium.com/crypto-0-nite/merkle-proofs-explained-6dd429623dc5).
This transaction is expensive because merkle proof verification is expensive.
| Parameter | Evaluation |
| - | - |
| Speed | >7 days
| Cost | Expensive
| Trust Assumption | Almost as good as using Optimism, however someone needs to initiate the claim transaction on L1
## Incentivized communication
You can also use incentives, for example using a mechanism such as [UMA's](../../useful-tools/oracles/#universal-market-access-uma).
This is similar to the way optimistic rollups work - honest relays get paid, dishonest ones get slashed.
However, this mechanism is only truly decentralized if there are enough relayers to make sure there will always be an honest one.
Otherwise, it's similar to centralized communications, just with a few extra relayers that can take over.
\ No newline at end of file
This diff is collapsed.
---
title: Using the Standard Bridge
lang: en-US
---
Certain interactions, like transferring ETH and ERC20 tokens between the two networks, are common enough that we've built the "Standard Bridge" to make moving these assets between L1 and L2 as easy as possible.
The standard bridge functionality provides a method for an ERC20 token to be deposited and locked on L1 in exchange of the same amount of an equivalent token on L2. This process is known as "bridging a token", e.g. depositing 100 USDC on L1 in exchange for 100 USDC on L2 and also the reverse - withdrawing 100 USDC on L2 in exchange for the same amount on L1. In addition to bridging tokens the standard bridge is also used for ETH.
The Standard Bridge is composed of two main contracts the [`L1StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/master/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol) (for Layer 1) and the [`L2StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/master/packages/contracts/contracts/L2/messaging/L2StandardBridge.sol) (for Layer 2).
Here we'll go over the basics of using this bridge to move ERC20 assets between Layer 1 and Layer 2.
::: tip
[See here for a step by step tutorial](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/cross-dom-bridge-erc20)
:::
## Deposits
::: warning NOTICE
We're working hard to get more smart contract wallet software deployed and tested on Optimism.
However, as a safety measure, **we currently block smart contract wallets from calling the `depositETH` and `depositERC20` functions**.
If you want to deposit using a smart contract wallet and you know what you're doing, you can use the `depositETHTo` and `depositERC20To` functions instead.
:::
### Depositing ERC20s
ERC20 deposits into L2 can be triggered via the `depositERC20` and `depositERC20To` functions on the [`L1StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol).
You **must** approve the Standard Token Bridge to use the amount of tokens that you want to deposit or the deposit will fail.
::: danger Use the standard bridge contract only with standard bridge tokens
The standard bridge can only be used with tokens that have a properly configured ERC-20 version on Optimism.
If you send any other type of token to the standard bridge directly (not using the user interface or the API), it gets stuck there and you lose that value.
Note that if you use the [Optimism bridge UI](https://app.optimism.io/bridge), or the [Optimism SDK](../../sdk/js-client.md) it automatically chooses the correct bridge contract, so this problem does not happen.
There are two ways to check if a token can use the standard bridge:
1. Look in [the token list](https://static.optimism.io/optimism.tokenlist.json).
If a token can use the standard bridge, then the `"chainId": 10` entry will have the standard L2 bridge address, `0x4200..0010`. For example, this entry shows that on the main Optimism network `0xBTC` can use the standard bridge.
```json
{
"chainId": 10,
"address": "0xe0BB0D3DE8c10976511e5030cA403dBf4c25165B",
"name": "0xBitcoin",
"symbol": "0xBTC",
"decimals": 8,
"logoURI": "https://ethereum-optimism.github.io/data/0xBTC/logo.png",
"extensions": {
"optimismBridgeAddress": "0x4200000000000000000000000000000000000010"
}
},
```
In the token exists in the token list but does not use the standard bridge, the `extensions.optimismBridgeAddress` value is different. For example, this entry shows that on the main Optimism network `DAI` uses a different bridge:
```json
{
"chainId": 10,
"address": "0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",
"name": "Dai stable coin",
"symbol": "DAI",
"decimals": 18,
"logoURI": "https://ethereum-optimism.github.io/data/DAI/logo.svg",
"extensions": {
"optimismBridgeAddress": "0x467194771dAe2967Aef3ECbEDD3Bf9a310C76C65"
}
},
```
1. You can "ask" the L2 token contract by calling it.
ERC-20 tokens that can use the standard bridge not only if they:
- Have an `l2Bridge` method
- That method returns `0x4200...0010`.
For example, [this link](https://explorer.optimism.io/address/0xe0bb0d3de8c10976511e5030ca403dbf4c25165b#readContract) can be used to see that `0xBTC` uses the standard bridge.
Note that you cannot query the L1 token contract the same way.
L2 contracts know the identity of their L1 counterpart, but L1 contracts only need to implement the standard ERC-20 methods.
:::
### Depositing ETH
ETH deposits into L2 can be triggered via the `depositETH` and `depositETHTo` functions on the [`L1StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L1/messaging/L1StandardBridge.sol).
ETH deposits can alternatively be triggered by sending ETH directly to the `L1StandardBridge`.
Once your deposit is detected and finalized on Optimism, your account will be funded with the corresponding amount of ETH on L2.
## Withdrawals
### Withdrawing ERC20s
ERC20 withdrawals can be triggered via the `withdraw` or `withdrawTo` functions on the [`L2StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L2/messaging/L2StandardBridge.sol).
If you'd like to see this contracts in action, you should check out the [L1 ⇔ L2 deposit-and-withdraw example](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/cross-dom-bridge-erc20).
### Withdrawing ETH
Unlike on L1, we do not have a separate function on L2 for withdrawing ETH.
Instead, you can use the `withdraw` or `withdrawTo` functions on the [`L2StandardBridge`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L2/messaging/L2StandardBridge.sol) and use the address `0xDeadDeAddeAddEAddeadDEaDDEAdDeaDDeAD0000` as the L2 token address.
## Adding an ERC20 token to the Standard Bridge
::: tip
To add your token to the standard bridge, see the guide [Adding an ERC20 token to the Standard Bridge](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/standard-bridge-standard-token).
:::
## The Optimism token list
The Standard bridge allows a one-to-many mapping between L1 and L2 tokens, meaning that there can be many Optimism implementations of an L1 token.
However there is always a one-to-one mapping between L1 and L2 tokens in the [Optimism token list](https://github.com/ethereum-optimism/ethereum-optimism.github.io/blob/master/optimism.tokenlist.json).
The token list is used as the source of truth for the [Optimism Gateway](https://gateway.optimism.io) which is the main portal for moving assets between Layer 1 and Layer 2.
If you want to have your token added to the token list, you must make a pull request against the [Optimism token list repository](https://github.com/ethereum-optimism/ethereum-optimism.github.io#adding-a-token-to-the-list).
You'll need the addresses for both the L1 and L2 tokens, as well as a logo for the token.
If you're looking for an example to follow, take a look at [this simple pull request that adds a token to the token list](https://github.com/ethereum-optimism/ethereum-optimism.github.io/pull/43/files).
---
title: Making Optimism Dapps Even Cheaper
lang: en-US
---
The cost of using a decentralized application in Optimism is much lower than the cost of the equivalent application on L1 Ethereum.
[See here](https://l2fees.info/) for the current values.
However, with proper optimization, we can make our decentralized applications even cheaper.
Here are some strategies.
## Background
This is a basic introduction into some of the concepts you need to understand to fully optimise your contracts in the Optimism L2 environment.
### What are the transaction fees?
The cost of an L2 transaction on Optimism is composed of two components:
- L2 execution fee, which is proportional to the gas actually used in processing the transaction.
Normally the cost of L2 gas is 0.001 gwei, but this may increase when the system is extremely congested.
Do not hardcode this value.
- L1 data fee, which is proportional to:
- The gas cost of writing the transaction's data to L1 (roughly equal to the transaction's length)
- The cost of gas on L1.
The cost of gas on L1 can be extremely volatile.
To view the current gas costs as a user, [see here](https://public-grafana.optimism.io/). To retrieve them programatically, [see here](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/sdk-estimate-gas).
For a more in depth look at how transaction fees are calculated see our [fee documentation](transaction-fees.md).
### Optimization tradeoffs
In almost all cases, the L1 data fee is the vast majority of the transaction's cost.
The L2 execution fee is, comparatively speaking, negligible.
This means that the optimization tradeoffs are very different in Optimism than they are in Ethereum.
Transaction call data is *expensive*.
The cost of writing a byte to L1 is approximately 16 gas.
At a cost of 45 gwei per L1 gas unit, writing one byte to L1 on Optimism costs 720 gwei, or 720,000 units of L2 gas (at the non-congested price of 0.001 gwei per L2 gas unit).
In comparison, on-chain processing and storage are cheap.
The worst case for writing to storage (previously uninitialized storage) is a cost of [22100 L2 gas per EVM word, which contains 32 bytes of data](https://www.evm.codes/#55), which averages out to less than 700 L2 gas / byte.
At a cost of 45 gwei per L1 gas unit, this means it is cheaper to write a whole kilobyte to storage, rather than add one byte to the transaction call data.
## Modify the [ABI (application binary interface)](https://docs.soliditylang.org/en/latest/abi-spec.html)
[The standard ABI](https://docs.soliditylang.org/en/latest/abi-spec.html) was designed with L1 tradeoffs in mind.
It uses four byte function selectors and pads values to a 32 byte size.
Neither is optimal when using Optimism.
It is much more efficient to [create a shorter ABI with just the required bytes, and decode it onchain](https://ethereum.org/en/developers/tutorials/short-abi/).
All of your [`view`](https://docs.soliditylang.org/en/latest/contracts.html#view-functions) and [`pure`](https://docs.soliditylang.org/en/latest/contracts.html#pure-functions) functions can use the standard ABI at no cost.
## Use smaller values when possible
Your modified ABI is not going to pad values, so the less bytes you use the better.
For example, it is standard to use `uint256` for amounts.
This means that the highest number we can represent is 2<sup>256</sup>-1, or about 1.2*10<sup>77</sup>.
When storing ETH balances, for example, using `uint256` is overkill as there are only [120 million ETH](https://ycharts.com/indicators/ethereum_supply). Thus, we can safely store ETH balances in `uint88` which is just eleven bytes.
Go through your contracts and identify any values that will never reach 32 bytes and reduce them to logical sizes. You can do this same process for ints, bytes and [other Solidity data types](https://docs.soliditylang.org/en/develop/types.html#types).
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
---
title: Interacting with Optimism contracts
lang: en-US
---
Optimism is composed, in part, of a series of smart contracts on both L1 (Ethereum) and L2 (Optimism).
You may want to interact with these contracts for any number of reasons, including:
- Sending messages between L1 and L2
- Sending tokens between L1 and L2
- Querying information about the current [L1 data fee](./transaction-fees.md#the-l1-data-fee)
- And lots more!
On this page we'll show you how to work with these contracts directly from other contracts and how to work with them from the client side.
## Finding contract addresses
You'll need to find the address of the particular contract that you want to interact with before you can actually interact with it.
Check out the [Networks and Connection Details page](../../useful-tools/networks.md) for links to the contract addresses for each network.
You can also find the addresses for all networks in the [deployments folder](https://github.com/ethereum-optimism/optimism/tree/master/packages/contracts/deployments) of the [`contracts` package](https://github.com/ethereum-optimism/optimism/tree/master/packages/contracts).
## Interacting from another contract
All you need to interact with the Optimism system contracts from another contract is an address and an interface.
You can follow [the instructions above](#finding-contract-addresses) to find the address of the contract you want to interact with.
Now you simply need to import the appropriate contracts.
### Installing via NPM or Yarn
We export a package [`@eth-optimism/contracts`](https://www.npmjs.com/package/@eth-optimism/contracts?activeTab=readme) that makes it easy to use the Optimism contracts within NPM or Yarn based projects.
Install the package as follows:
```
npm install @eth-optimism/contracts
```
### Importing contracts
Simply import the desired contract or interface from the `@eth-optimism/contracts` package:
```solidity
import { SomeOptimismContract } from "@eth-optimism/contracts/path/to/SomeOptimismContract.sol";
```
Please note that `path/to/SomeOptimismContract` is the path to the contract [within this folder](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/contracts).
For example, if you wanted to import the [`L1CrossDomainMessenger`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L1/messaging/L1CrossDomainMessenger.sol) contract, you would use the following import:
```solidity
import { L1CrossDomainMessenger } from "@eth-optimism/contracts/L1/messaging/L1CrossDomainMessenger.sol";
```
### Getting L2 contract addresses
Addresses of system contracts on the L2 side of the network are the same on every network.
We provide these addresses as constants within the [`Lib_PredeployAddresses`](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/libraries/constants/Lib_PredeployAddresses.sol) contract.
## Interacting from the client side
Just like when interacting from another contract, we've created a few packages that make it easy to interact with the Optimism system contracts from the client side.
### Installing via NPM or Yarn
You can use the [`@eth-optimism/contracts`](https://www.npmjs.com/package/@eth-optimism/contracts?activeTab=readme) package to interact with the Optimism system contracts from a JavaScript or TypeScript based project.
Install the package as follows:
```
npm install @eth-optimism/contracts
```
### Getting contract artifacts, interfaces, and ABIs
You can get the compiler artifact, bytecode, and ABI for any Optimism contract as follows:
```ts
import { getContractDefinition } from '@eth-optimism/contracts'
const artifact = getContractDefinition('SomeOptimismContract')
const abi = artifact.abi
const bytecode = artifact.bytecode
const deployedBytecode = artifact.deployedBytecode
```
Similarly, you can also get [ethers Interface objects](https://docs.ethers.io/v5/api/utils/abi/interface/) for any contract:
```ts
import { getContractInterface } from '@eth-optimism/contracts'
const iface = getContractInterface('SomeOptimismContract')
```
### Getting L2 contract addresses
You can get the address of any L2 contract as follows:
```ts
import { predeploys } from '@eth-optimism/contracts'
const address = predeploys.CONTRACT_NAME_GOES_HERE
```
---
title: Testing Decentralized Applications with Optimism
lang: en-US
---
For the most part running applications on Optimism is identical to running them on Ethereum, so the testing is identical too.
In this article you learn the best practices for Optimism testing where there are differences.
## Unit tests and single layer integration tests
The vast majority of tests do not involve any Optimism-specific features.
In those cases, while you *could* test everything on Optimism, that would normally be inefficient.
Most Ethereum development stacks include features that make testing easier, which normal Ethereum clients, such as geth (and our modified version, l2geth) don't support.
Therefore, it is a good idea to run the majority of tests, which do not rely on Optimism-specific features, in the development stack.
It is a lot faster.
Ideally you would want to be able to run some tests on Optimism (either a [local development environment](dev-node.md) or [the test network](../../useful-tools/networks.md#optimism-goerli).
This would be a much slower process, but it would let you identify cases where [the equivalence between Optimism and Ethereum breaks down](differences.md) (or the equivalence between Ethereum itself and the development stack, for that matter).
## Multilayer integration tests
Some dapps need Optimism-specific features that aren't available as part of the development stack.
For example, if your decentralized application relies on [inter-domain communication](../bridge/messaging.md), the effort of developing a stub to let you debug it in a development stack is probably greater than the hassle of having the automated test go to [a local development environment](dev-node.md) each time.
## Integration with other products
In many cases a decentralized application requires the services of other contracts.
For example, [Perpetual v. 2](https://v2docs.perp.fi/benefits-of-v2) cannot function without [Uniswap v. 3](https://uniswap.org/blog/uniswap-v3).
If that is the case you can use [mainnet forking](https://hardhat.org/hardhat-network/guides/mainnet-forking.html).
It works with Optimism with the exception of transactions that use the `L1BlockNumber` opcode directly.
Alternatively, you can connect to our [test network](../../useful-tools/networks.md#optimism-goerli) if those contracts are also deployed there (in many cases they are).
---
title: Transaction fees on L2
lang: en-US
---
## Understanding the basics
Transaction fees on Optimism work a lot like fees on Ethereum.
However, Layer 2 introduces some new paradigms that means it can never be exactly like Ethereum.
Luckily, Optimism's [EVM equivalence](https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306) makes these differences easy to understand and even easier to handle within your app.
Let's take a look at the two sources of cost in a transaction on Optimism: the L2 execution fee and the L1 data/security fee.
### The L2 execution fee
Just like on Ethereum, transactions on Optimism have to pay **gas** for the amount of computation and storage that they use.
Every L2 transaction will pay some **execution fee**, equal to the amount of gas used by the transaction multiplied by the gas price attached to the transaction.
This is exactly how fees work on Ethereum with the added bonus that gas prices on Optimism are seriously low.
Here's the (simple) math:
```
l2_execution_fee = transaction_gas_price * l2_gas_used
```
The amount of L2 gas used depends on the particular transaction that you're trying to send.
Thanks to [EVM equivalence](https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306), transactions typically use approximately the same amount of gas on Optimism as they do on Ethereum.
Gas prices fluctuate with time and congestion, but you can always check the current estimated L2 gas price on the [public Optimism dashboard](https://public-grafana.optimism.io/d/9hkhMxn7z/public-dashboard?orgId=1&refresh=5m).
### The L1 data fee
Optimism differs from Ethereum because all transactions on Optimism are also published to Ethereum.
This step is crucial to the security properties of Optimism because it means that all of the data you need to sync an Optimism node is always publicly available on Ethereum.
It's what makes Optimism an L2.
Users on Optimism have to pay for the cost of submitting their transactions to Ethereum.
We call this the **L1 data fee**, and it's the primary discrepancy between Optimism (and other L2s) and Ethereum.
Because the cost of gas is so expensive on Ethereum, the L1 data fee typically dominates the total cost of a transaction on Optimism.
This fee is based on four factors:
1. The current gas price on Ethereum.
2. The gas cost to publish the transaction to Ethereum. This scales roughly with the size of the transaction (in bytes).
3. A fixed overhead cost denominated in gas. This is currently set to 2100.
4. A dynamic overhead cost which scales the L1 fee paid by a fixed number. This is currently set to 1.0.
Here's the math:
```
l1_data_fee = l1_gas_price * (tx_data_gas + fixed_overhead) * dynamic_overhead
```
Where `tx_data_gas` is:
```
tx_data_gas = count_zero_bytes(tx_data) * 4 + count_non_zero_bytes(tx_data) * 16
```
You can read the parameter values from the [gas oracle contract](https://explorer.optimism.io/address/0x420000000000000000000000000000000000000F#readContract).
::: warning NOTE
Ethereum has limited support for adding custom transaction types.
As a result, unlike the L2 execution fee, **users are not able to set limits for the L1 data fee that they may be charged**.
The L1 gas price used to charge the data fee is automatically updated when new data is received from Ethereum.
**Spikes in Ethereum gas prices may result in users paying a higher or lower than estimated L1 data fee, by up to 25%.**
[See here for a detailed explanation why the difference is capped at 25%](https://help.optimism.io/hc/en-us/articles/4416677738907-What-happens-if-the-L1-gas-price-spikes-while-a-transaction-is-in-process).
:::
## Stuff to keep in mind
### Sending transactions
The process of sending a transaction on Optimism is identical to the process of sending a transaction on Ethereum.
When sending a transaction, you should provide a gas price greater than or equal to the current L2 gas price.
Like on Ethereum, you can query this gas price with the `eth_gasPrice` RPC method.
Similarly, you should set your transaction gas limit in the same way that you would set your transaction gas limit on Ethereum (e.g. via `eth_estimateGas`).
### Responding to gas price updates
Gas prices on L2 default to 0.001 Gwei but can increase dynamically if the network is congested.
When this happens, the lowest fee that the network will accept increases.
Unlike Ethereum, Optimism currently does not have a mempool to hold transactions with too low a fee.
Instead, Optimism nodes will reject the transaction with the message `Fee too low`.
You may need to handle this case explicitly and retry the transaction with a new gas price when this happens.
### Displaying fees to users
Many Ethereum applications display estimated fees to users by multiplying the gas price by the gas limit.
However, as discussed earlier, users on Optimism are charged both an L2 execution fee and an L1 data fee.
As a result, you should display the sum of both of these fees to give users the most accurate estimate of the total cost of a transaction.
[See here for a code sample using the JavaScript SDK](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/sdk-estimate-gas)
#### Estimating the L2 execution fee
You can estimate the L2 execution fee by multiplying the gas price by the gas limit, just like on Ethereum.
#### Estimating the L1 data fee
You can use the SDK [(see here)](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/sdk-estimate-gas).
Alternatively, you can estimate the L1 data fee using the `GasPriceOracle` predeployed smart contract located at [`0x420000000000000000000000000000000000000F`](https://explorer.optimism.io/address/0x420000000000000000000000000000000000000F).
[The `GasPriceOracle` contract](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L2/predeploys/OVM_GasPriceOracle.sol) is located at the same address on every Optimism network (mainnet and testnet).
To do so, call `GasPriceOracle.getL1Fee(<unsigned RLP encoded transaction>)`.
#### Estimating the total fee
You can estimate the total fee by combining your estimates for the L2 execution fee and L1 data fee.
### Sending max ETH
Sending the maximum amount of ETH that a user has in their wallet is a relatively common use case.
When doing this, you will need to subtract the estimated L2 execution fee and the estimated L1 data fee from the amount of ETH you want the user to send.
Use the logic described above for estimating the total fee.
## Common RPC Errors
### Insufficient funds
- Error code: `-32000`
- Error message: `invalid transaction: insufficient funds for l1Fee + l2Fee + value`
You'll get this error when attempting to send a transaction and you don't have enough ETH to pay for the value of the transaction, the L2 execution fee, and the L1 data fee.
You might get this error when attempting to send max ETH if you aren't properly accounting for both the L2 execution fee and the L1 data fee.
### Gas price too low
- Error code: `-32000`
- Error message: `gas price too low: X wei, use at least tx.gasPrice = Y wei`
This is a custom RPC error that Optimism returns when a transaction is rejected because the gas price is too low.
See the section on [Responding to gas price updates](#responding-to-gas-price-updates) for more information.
### Gas price too high
- Error code: `-32000`
- Error message: `gas price too high: X wei, use at most tx.gasPrice = Y wei`
This is a custom RPC error that Optimism returns when a transaction is rejected because the gas price is too high.
We include this as a safety measure to prevent users from accidentally sending a transaction with an extremely high L2 gas price.
See the section on [Responding to gas price updates](#responding-to-gas-price-updates) for more information.
---
title: Using your favorite tools
lang: en-US
---
How do you use your favorite tools for building contracts when you're working with Optimism?
Just use them!
<!--
TODO: We need a page on EVM equivalence.
-->
Optimism isn't just EVM compatible, it's EVM *equivalent*.
All the Ethereum tooling you know and love should work on Optimism without lots of fiddling.
Hardhat? Brownie? Truffle?
Yep, yep, and yep.
If you find a tool that *doesn't* seem to work with Optimism out of the box, try [opening an issue over on GitHub](https://github.com/ethereum-optimism/optimism/issues).
Someone working on Optimism will probably help fix the issue pretty quickly.
## Hardhat
Configuring Hardhat to deploy your contracts to Optimism is a breeze.
Simply add the following to your Hardhat config file:
```js
module.exports = {
networks: {
...
// for mainnet
'optimism': {
url: "https://mainnet.optimism.io",
accounts: [privateKey1, privateKey2, ...]
},
// for testnet
'optimism-goerli': {
url: "https://goerli.optimism.io",
accounts: [privateKey1, privateKey2, ...]
},
// for the local dev environment
'optimism-local': {
url: "http://localhost:8545",
accounts: [privateKey1, privateKey2, ...]
},
},
...
}
```
## Foundry
[Foundry](https://www.paradigm.xyz/2021/12/introducing-the-foundry-ethereum-development-toolbox) is a blazing fast, portable and modular toolkit for Ethereum application development written in Rust.
Foundry supports Optimism out of the box!
Just provide an Optimism RPC:
```sh
forge create ... --rpc-url=https://goerli.optimism.io/
```
Additionally, you can use [forge-optimism](https://github.com/tarrencev/forge-optimism) to simulate the optimism context and simplify testing.
## Truffle
Configuring Truffle is easy too:
```js
const HDWalletProvider = require('@truffle/hdwallet-provider')
...
module.exports = {
networks: {
...
// for mainnet
'optimism': {
provider: () => {
return new HDWalletProvider(YOUR_MAINNET_MNEMONIC_GOES_HERE, 'https://mainnet.optimism.io')
}
network_id: "10"
},
// for testnet
'optimism-goerli': {
provider: () => {
return new HDWalletProvider(YOUR_GOERLI_MNEMONIC_GOES_HERE, 'https://goerli.optimism.io')
}
network_id: "420"
},
// for the local dev environment
'optimism-local': {
provider: () => {
return new HDWalletProvider('test test test test test test test test test test test junk', 'http://localhost:8545')
}
network_id: "420"
}
},
...
}
```
## Brownie
[Brownie](https://github.com/eth-brownie/brownie) is a Python-based development and testing framework for EVM smart contracts. Brownie supports Optimism out of the box!
## Waffle
Starting from [Waffle](https://github.com/TrueFiEng/Waffle) v4.x.x you can use Waffle chai matchers to test your smart contracts on Optimism. We recommend following [this guide](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/getting-started)(scroll down to `Waffle` section) to get to know [Waffle](https://github.com/TrueFiEng/Waffle).
If you want to add [Waffle](https://github.com/TrueFiEng/Waffle) to an already existing project, you can install it with (replace `npm install` with the package manager's you're using relevant command):
```bash
npm install --save-dev ethereum-waffle@alpha @ethereum-waffle/optimism@alpha
```
## Other tools
Got a favorite tool that works well with Optimism?
Want it displayed on this page?
[Make a pull request over on the docs repository](https://github.com/ethereum-optimism/community-hub/pulls)!
--- ---
title: Known Issues (none) title: Building with OP Stack
lang: en-US lang: en-US
--- ---
**None at present** Stuff goes here
---
title: Developer Videos
lang: en-US
---
### Getting started with Optimism
In this video you learn how to use Optimism for your own development:
- [Deploy a contract on Optimism (Foundry) (1:24)](https://youtu.be/_Y6CwsYgqwI?t=84)
- [Interact with an Optimism contract (Foundry) (2:20)](https://youtu.be/_Y6CwsYgqwI?t=140)
- [Use the Etherscan block explorer with Optimism (2:53)](https://youtu.be/_Y6CwsYgqwI?t=173)
- [Getting started docs, with other development stacks (4:45)](https://youtu.be/_Y6CwsYgqwI?t=285)
- [Getting test ETH (6:00)](https://youtu.be/_Y6CwsYgqwI?t=360)
- [The Optimism Bridge (7:25)](https://youtu.be/_Y6CwsYgqwI?t=445)
- [Inter-layer communication, between Ethereum and Optimism (8:48)](https://youtu.be/_Y6CwsYgqwI?t=528)
- [Gas cost calculation (10:20)](https://youtu.be/_Y6CwsYgqwI?t=620)
<iframe src="https://www.youtube.com/embed/_Y6CwsYgqwI" title="Getting Started with Optimism" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
## ETHOnline 2022 | Optimism Summit
September 22nd, 2022
### Modular OP Stack - Karl Floersch
This talk covers the OP Stack chain software, and how the Bedrock release will enable deployments of op-chains which serve new use cases, are future proof, and will all one day fit together to form the Superchain.
<iframe src="https://www.youtube.com/embed/jlKPjiDu_KM?list=RDCMUCfF9ZO8Ug4xk_AJd4aeT5HA" title="Modular OP Stack - Karl Floersch" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
### Introduction to Architecture - Joshua Gutow
This talks covers bedrock’s architecture. It explains how redesigning the rollup architecture in bedrock reduces fees & increases implementation simplicity. It also covers the various components of the system & how they interact.
<iframe src="https://www.youtube.com/embed/fkoTMchOFPI?list=RDCMUCfF9ZO8Ug4xk_AJd4aeT5HA" title="Introduction to Architecture - Joshua Gutow" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
### Modular sequencing - Norswap Laurent
In this video you learn the design space around two design choices related to sequencing:
- *who* sequences (decentralization)
- *how* they sequence (MEV!)
<iframe src="https://www.youtube.com/embed/aKxS16TG2jk?list=PLXzKMXK2aHh4vbe7GLQfOnL-QJ1O5EqMv" title="Modular sequencing - Norswap Laurent" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
### Pluggable data availability - Protolambda
In this talk protolambda explains how the next Optimism upgrade improves the rollup with modular design, and how this can be utilized to quickly adopt future scaling improvements like EIP-4844 (a.k.a. proto-danksharding).
OP Labs is contributing to L1 research and development to increase the data availability used for securing all L2s.
<iframe src="https://www.youtube.com/embed/-xWpalvZeEU?list=PLXzKMXK2aHh4vbe7GLQfOnL-QJ1O5EqMv" title="Pluggable data availability - Protolambda" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
### Panel: State of 4844
The end game for data availability on Ethereum - Full Sharding - and how EIP-4844 gets us closer to that goal. This video discusses:
- Where we are with the implementation of EIP-4844 and what else was needed to be done before CFI.
- How the community could help us ship EIP-4844.
- Data Availability and the concept of a Data Availability Layer; analogous to the CL and EL. This concept helps reason about how data, i.e. the blobs, fits in Ethereum.
<iframe src="https://www.youtube.com/embed/uxYkGdCFsjI?list=PLXzKMXK2aHh4vbe7GLQfOnL-QJ1O5EqMv" title="Panel: State of 4844" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
### Intro to Quix - Mark Dawson
The NFT ecosystem on Optimism is an exciting, growing space.
Mark Dawson is the co-founder of Quix, the largest NFT marketplace on Optimism.
He discusses early NFT communities on Optimism, the upcoming NFT bridge, composable NFTs, and how to get started in the OP NFT ecosystem.
<iframe src="https://www.youtube.com/embed/Z8L8vNDgJjY?list=PLXzKMXK2aHh4vbe7GLQfOnL-QJ1O5EqMv" title="Intro to Quix - Mark Dawson" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
---
title: What is the Optimism Collective?
lang: en-US
---
The [Optimism Collective](https://app.optimism.io/announcement) is a band of companies, communities, and citizens working together to reward public goods and build a sustainable future for Ethereum.
Together we will dispel the myth that public goods cannot be profitable.
Public goods (including public goods for Optimism and Ethereum) often go underfunded when incentives aren't properly aligned, forcing many to make trade-offs between earning a profit and building for the common good.
The Optimism Collective is bound by a mutually beneficial pact, [a vision](https://www.optimism.io/vision) that can be summed up with the equation **Impact = Profit**.
### Impact = Profit
The Optimism Collective will deploy a new model for rewarding those who create or sustain public goods - [retroactive public goods funding](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c), to support projects and communities building for the common good.
Retroactive public goods funding is advantageous because it is relatively easy to agree on what *is* useful, and see who built it.
It is a lot harder to identify in advance what *will be* useful, and which team will do the best job of building it.
The possibility of an eventual exit payment can also encourage investors to fund initial public good development efforts until the usefulness is obvious, in the same way that the possibility of an eventual IPO or buy out encourages investors to fund startups today.
### How is this going to be governed?
The Optimism Collective takes [an experimental and agile approach to governance](https://optimism.mirror.xyz/r888e4B5iiNQi-3_mO26ixgv-plQ099XWgqEOv9iWKA) relentlessly iterating towards a system which stands the test of time.
Initially, the Collective's model of digital democratic governance will consist of two houses: the *Token House* and the *Citizens' House*.
## Token House
Governance of the Optimism Collective began with the launch of the OP token and the [Token House](token-house.md).
OP was distributed to hundreds of thousands of addresses that engaged in positive-sum, community-oriented behavior with [Airdrop #1](airdrop-1.md).
You can read more about the [distribution criteria here](airdrop-1.md).
As Token House members, OP holders are responsible for submitting, deliberating, and voting on various types of governance proposals.
In carrying out these functions, OP holders may either [vote directly, or delegate their OP voting power to an eligible third party](delegate.md).
The Token House votes on these proposal types:
- [Governance fund](gov-fund.md) grants
- Protocol upgrades
- Inflation adjustment
- Director removal
- Treasury appropriations
- Rights protection
[Read here for more details](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md#valid-proposal-types).
## Citizens' House
The Citizens' House is a large-scale experiment in [non-plutocratic governance](https://vitalik.ca/general/2021/08/16/voting3.html) and retroactive funding of public goods.
The Citizens' House is responsible for [retroactive public goods funding (RPGF)](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c).
For more information about the Citizens' House, read [the Overview](./citizens-house.md).
For details about RetroPGF 2, visit [the RetroPGF 2 program details](./retropgf-2.md).
For plans around identity and governance, see [the Citizenship page](./citizenship.md).
**What is described here is an initial experiment**.
The specifics of this system will evolve as the Collective grows.
This diff is collapsed.
---
title: OP Allocations
lang: en-US
---
## Allocations at a glance
![](../../assets/docs/governance/allocations/pie2.jpeg)
| Category | Percentage | Description |
| --- | --- | --- |
| Ecosystem Fund | 25% | The Ecosystem Fund is a proactive program meant to stimulate development in the Collective ecosystem by providing funding to projects and communities |
| Retroactive Public Goods Funding (RetroPGF) | 20% | RetroPGF is the Optimism Collective’s primary mechanism to adequately and reliably **reward** public goods for the impact they provide |
| User airdrops | 19% | A series of airdrops to reward users for specific helpful behaviors, beginning with Airdrop #1 |
| Core contributors | 19% | The people who’ve been working tirelessly to bring the Optimism Collective into existence |
| Sugar xaddies | 17% | Investors |
## User Airdrops
***Allocation: 19%***
The Optimism Foundation will distribute a portion of the OP allocation to members of the Optimism and Ethereum communities in multiple waves.
### Airdrop #1
The first user airdrop will distribute **5%** of the OP token supply.
This airdrop is targeted towards people who:
- Behave in positive-sum ways.
- Contribute actively to their communities.
- Have been priced out of Ethereum.
The addresses and amounts were chosen to reward Optimism users, as well as attract core Ethereum users to the OP family.
Airdrop #1 cast a wide net to distribute OP to more than 250k addresses. See the [Airdrop #1 documentation](airdrop-1.md) for a detailed breakdown of eligibility criteria.
### Future airdrops (#2, 3, …)
An allocation of **14%** of the OP token supply will be held in reserve for future user airdrops.
As a result of the game-able nature of airdrops, the Optimism Foundation will be responsible for determining airdrop metrics as fairly as possible.
The intent behind airdrops is to distribute them to addresses which positively impact the Optimism community.
The best way to improve your odds of receiving future airdrops is to get involved!
## Ecosystem Fund
***Allocation: 25%***
The Ecosystem Fund is an incentive program designed to stimulate development of the Collective ecosystem.
The Ecosystem Fund will be used to directly fund the communities and companies that drive the expansion of the Collective ecosystem (OPCOs).
The allocation dedicated to the Ecosystem Fund is to be further split into the following categories:
1. Governance Fund **(5.4%)**
2. Partner Fund **(5.4%)**
3. Seed Fund **(5.4%)**
4. Unallocated **(8.8%)**
The Ecosystem Fund is intended to be a kick-starting mechanism that will be phased out entirely once the OP in the fund has been depleted.
The Optimism Foundation expects the function served by the Ecosystem Fund (proactive funding) to eventually be replaced by private third-party investors who can expect to be paid out by the [Retroactive Public Goods Funding](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) mechanism.
![](../../assets/docs/governance/allocations/ecosystem_fund_process.jpeg)
The wide variety of funding mechanisms ensures that airdrops constantly flow to users who make valuable contributions to the ecosystem.
These contributions result in ecosystem growth, ecosystem growth results in demand for block space, demand for block space results in revenues, and these revenues are then productively re-deployed into the ecosystem as additional airdrops.
Each fund can be thought of as a parallel experiment in OP allocation, enabling rapid iteration and doubling down on what works to further grow the ecosystem.
### Governance Fund
An allocation of **5.4%** of the OP token supply will be dedicated to the first Governance Fund.
All projects demonstrating usage on Optimism can request tokens from this fund at [gov.optimism.io](https://gov.optimism.io/)
### Partner Fund
An allocation of **5.4%** of the OP token supply will be dedicated to the Partner Fund.
These funds will be distributed strategically by the Optimism Foundation to grow the Optimism ecosystem for the benefit of the entire Collective.
### Seed Fund
An allocation of **5.4%** of the OP token supply will be dedicated to the Seed Fund, a fund for early stage projects launching in and adjacent to the Optimism ecosystem.
### Unspent allocation for future growth programs
An allocation of **8.8%** of the OP token supply will be held in reserve for future community growth programs.
## Retroactive Public Goods Funding
***Allocation: 20%***
[Retroactive Public Goods Funding (RetroPGF)](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c) will initially be distributed by the [Citizens' House](citizens-house.md).
RetroPGF rounds are expected to occur on a quarterly basis with the objective of ensuring that all OPCOs are rewarded adequately, appropriately, and reliably based on their impact to the Collective—key to our [vision](https://optimism.io/vision).
RetroPGF will be funded by several revenue sources:
1. 20% of the initial OP token supply held as the “RetroPGF Reserve”.
1. Optimism network transaction fees and sequencer revenue.
The Optimism Foundation may choose to increase the total OP payout of any given period by tapping into the 20% RetroPGF Reserve.
## Core Contributors
***Allocation: 19%***
The Core Contributors allocation will be distributed to the people who helped bring Optimism and the Optimism Collective from concept to reality, and will continue to pay for development of the protocol.
All tokens distributed as part of the Core Contributors allocation will be subject to a lockup period.
## Sugar Xaddies
***Allocation: 17%***
Investors.
They funded us and our crazy vision for the future.
Couldn’t-a done it without ya.
All tokens distributed as part of the Sugar Xaddies allocation will be subject to a lockup period.
## Token Distribution Details
At genesis there will be an initial total supply of 4,294,967,296 OP tokens.
The total token supply will inflate at a rate of 2% per year.
64% of the initial token supply (i.e., the aggregate amount of OP **not** reserved for core contributors or sugar xaddies) will be distributed to the community as described above.
These distributions will be administered over time by the Optimism Foundation in its role as steward of the Optimism Collective.
In Year 1, 30% of the initial token supply will be made available to the Foundation for distribution.
After the first year, token holders will vote to determine the Foundation’s annual OP distribution budget.
The Foundation expects to seek the following annual allocations:
- Year 2: 15% of the initial token supply
- Year 3: 10% of the initial token supply
- Year 4: 4% of the initial token supply
If the Foundation’s authorized OP expenditures ever reaches below 10% of the initial token supply, it is expected to request an additional allocation.
Taken together, the Foundation expects the total supply of unlocked OP tokens to approximate the graph below.
Note this graph is for illustration only, and actual unlocked supply will depend on governance and the rate that OP is allocated across user airdrops, the Ecosystem Fund, and RetroPGF.
![](../../assets/docs/governance/allocations/alloc-by-time.png)
---
title: What is the AttestationStation?
lang: en-US
---
![](../../assets/docs/governance/attestationstation/attestationstation.png)
The AttestationStation is an **attestation smart contract** deployed on Optimism.
The goal of the AttestationStation is to provide a permissionless and accessible data source for builders creating reputation-based applications. By enabling anyone to make arbitrary attestations about other addresses, we can create a rich library of qualitative and quantitative data that can be used across the ecosystem.
<!-- TODO: Add source code link when we have an authoritative source -->
## General FAQ
#### What are attestations?
Attestations are statements by a creator (who attested this) about a subject (who is being attested about). Attestations could present any qualitative or quantitative statement. To paint a picture — actors might submit attestations that are contextual to their brand, ecosystem, and governance structure.
![](../../assets/docs/governance/attestationstation/attestations.png)
#### What can attestations be used for?
We imagine the first use case for attestations is to create sybil resistant identity that can power [non-plutocratic governance](https://vitalik.ca/general/2021/08/16/voting3.html).
Longer term, this open-source primitive can be used for a variety of sybil-resistant applications including on-chain credit scoring / under collateralized loans.
#### How can you go from attestations to sybil-resistant identity?
Attestations in the AttestationStation are on-chain and can be used by other smart contracts in a variety of applications. Instead of having a single entity owning user data and identity, the AttestationStation is a graph of peer-to-peer (p2p) attestations.
The first step to get from attestations to sybil-resistant identity is to grow the number of attestations in the AttestationStation. To do that, we are taking a two pronged approach by growing the number of:
* **Trusted attestations**: These attestations are made by organizations like Gitcoin, DegenScore, Otterspace, etc. attest about individual community members.
* **Social attestations**: These are attestations from one address about another. Eg zain.eth says kathy.eth is a colleague, kathy.eth says will.eth is a friend, etc.
![](../../assets/docs/governance/attestationstation/network.png)
Anyone can then take the graph of p2p attestations from the AttestationStation and run computations like EigenTrust over the set of data to derive identity sets on top of a purely subjective web of trust.
![](../../assets/docs/governance/attestationstation/eigan.png)
To build a robust, trustworthy identity network, these computations will be run iteratively. We can start with a purely subjective web of trust, and use that starting point to derive a larger web of trust, and so on — we can begin to establish a credibly neutral reputation that is entirely peer-to-peer.
#### How is the AttestationStation different from other attestation products?
The AttestationStation is deliberately dead simple and serves as an invite to ecosystem contributors to come build an open-source and permissionless attestation graph together.
Creating this system in a decentralized and open-source manner is important because it allows for greater inclusion and representation of different perspectives. This can help to ensure that the system is fair and accessible to all, and that it accurately reflects the diversity of the communities it serves.
#### How do I use the AttestationStation?
See [the tutorial](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/ecosystem/attestation-station).
#### What are the contract addresses for the AttestationStation?
| Network | Address |
| - | - |
| Optimism Goerli | [`0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77`](https://goerli-explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77) |
| Optimism Mainnet | [`0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77`](https://explorer.optimism.io/address/0xEE36eaaD94d1Cc1d0eccaDb55C38bFfB6Be06C77) |
#### What products are built on the AttestationStation?
If your product is using the AttestationStation, make a PR including how you're using attestations to be added to the list 😊
* [AttestationStation Interface by sbvegan](https://attestationstation.xyz/)
* [Optimist Score by Flipside](https://science.flipsidecrypto.xyz/optimist/)
* [Optimism Attestor by Clique](https://provenance.clique.social/attestor/opattestor)
#### I am building on the AttestationStation but have some questions, where can I discuss these?
The best place to ask any dev related questions is the #dev-support channel on [the Optimism Discord](https://discord-gateway.optimism.io/). If you need additional support check out this [Help Article](https://help.optimism.io/hc/en-us/articles/9762044018843-How-do-I-get-project-support-marketing-integrations-etc-).
#### I want to apply for a grant to build on the AttestationStation, how can I do this?
You can learn more about the variety of grants program available at Optimism [here](allocations/#ecosystem-fund). As a reminder, your work should be published to a public GitHub repo.
#### What are some things I should build with the AttestationStation?
It will take a huge community effort to realize the potential that reputation has to transform web3. That’s why we started small with the AttestationStation and an open invite to come experiment with us. We can already think of a bunch of fun projects to build today like:
* **EiganTrust**: Aggregate attestations from various communities and use techniques like [EigenTrust](https://en.wikipedia.org/wiki/EigenTrust) to derive reputation
* **SybilRank**: Create a [SybilRank](https://users.cs.duke.edu/~qiangcao/sybilrank_project/index.html) calculator! (h/t Barry Whitehat for the suggestion)
* **Data visualization**: Create data visualizations representing the different types of attestations in the AttestationStation
* **Predictive attestations**: Instead of attesting “I trust XYZ”, try fun attestations like, “I believe XYZ will be considered trusted by a majority of node in the future”. Plus, what if we add a slashing condition to the predictive attestation?
* **Attestation delegation**: Build a system which manages attestations automatically for users. This system should enable users to delegate some of their attestation assignment to a third party. For instance, users may opt-in to delegating their trust scores to a sybil detection court system. Another project is to build that sybil detection court system!
* **Attestation import**: Write proxy contracts which import attestations of various formats into the standardized AttestationStation format so that they can be consumed by the standard AttestationStation tooling.
* **Viral attestations**: Create systems which make it fun and easy for users to attest useful information about each other.
* **Composable NFT allowlists**: Create a way for creators to easily build, manage, and share mint allowlists for upcoming NFT drops!
## Technical specifications
The following is the breakdown of Optimism's AttestationStation smart contract.
### State
#### attestations
The following is the nested mapping that stores all the attestations made.
```
mapping(address => mapping(address => mapping(bytes32 => bytes))) public attestations;
```
The following is a struct that represents a properly formatted attestation.
#### AttestationData
```
struct AttestationData {
address about;
bytes32 key;
bytes val;
}
```
### Events
#### AttestationCreated
This event is emitted when an attestation is successfully made.
```
event AttestationCreated(
address indexed creator,
address indexed about,
bytes32 indexed key,
bytes val
);
```
### Functions
#### attest
```
function attest(AttestationData[] memory _attestations) public
```
Records attestations to the AttestationStation's state and emits an `AttestationCreated` event with the address of the message sender, address the attestation is about, the bytes32 key, and bytes value.
Parameters:
| Name | Type | Description |
| -------------- | ----------------- | ----------------------------------- |
| \_attestations | AttestationData[] | Array of `AttestationData` structs. |
---
title: Overview
lang: en-US
---
The Citizens' House is a large-scale experiment in [non-plutocratic governance](https://vitalik.ca/general/2021/08/16/voting3.html) and retroactive funding of public goods.
The Citizens’ House will work alongside the Token House to govern the Optimism Collective.
**In its first stage, the Citizens’ House is solely responsible for voting on retroactive public goods funding (RetroPGF)**.
The initial set of Citizens in this stage is determined by (a) criteria set by the Optimism Foundation and (b) a special election from the Token House.
During this bootstrapping phase, the Optimism Foundation will determine the scope and amount of each funding round, as well as administer the voting process.
Holding a voting badge in this initial set of Citizens **does not guarantee permanent citizenship** or voting rights in all future rounds of RetroPGF.
In future stages, the Citizens’ House role will expand.
For example, in addition to voting on RetroPGF funding, the Citizens’ House will work alongside the Token House to govern allocation of protocol profit, collaborate on criteria for participation in the Citizens’ House, and engage in a system of checks and balances to enforce the Collective’s Codes of Conduct.
Funding for RetroPGF can come from:
- **[20% of the initial OP supply](./allocations.md#retroactive-public-goods-funding)**
- Redeployment of some profit generated by the Optimism protocol
Many values-aligned projects on Optimism have also chosen to contribute a portion of their revenue to retroPGF.
If your project wants to contribute funds, you can send ETH, ERC-20 tokens, or NFTs to the ENS address **retroPGF.eth**.
It is supported on **[Optimism](https://explorer.optimism.io/address/0x15dda60616ffca20371ed1659dbb78e888f65556)** as well as **[Ethereum mainnet](https://etherscan.io/address/0x15dda60616ffca20371ed1659dbb78e888f65556)**.
Everything donated retroPGF.eth will be allocated to a RetroPGF round.
**What is described here is an initial experiment for RetroPGF 2**. The specifics of this system will evolve as the Collective grows.
## How RetroPGF Works
RetroPGF stands for Retroactive Public Goods Funding.
This is a series of experiments where members of the Citizens’ House allocate protocol profits or portions of the token treasury to projects they deem have provided substantial public good along certain criteria.
RetroPGF is based on the idea that it’s easier to determine what *was* useful than to issue proactive grants for what *might* be useful.
In each round of RetroPGF, Citizens vote on how to allocate funding looking backwards over a prescribed time period.
These rewards create strong incentives for people to build public goods that benefit the Optimism Collective.
The aggregate effect is an ecosystem that is easier to build on, learn about, and connect to, in turn driving application usage and generating more demand for blockspace.
By funding public goods sustainably, the Collective can create a rich ecosystem and a better economy.
![The public goods virtuous cycle](../../assets/docs/governance/economics/virt_cycle.png)
RetroPGF also provides possible exit liquidity for public goods projects, which opens up a market for early investment in those projects.
This means builders can:
- Be compensated for their positive contributions without generating direct revenue
- Raise capital to bootstrap based on the early potential and promise of their project
RetroPGF is core to Optimism’s value of `impact = profit`: the idea that that positive impact to the collective should be rewarded with profit to the individual.
In 2021, Optimism ran its [first round of RetroPGF](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c).
Community members voted to distribute $1 million across 58 open source software projects.
RetroPGF 2 takes place in Jan 2023. Read more [here](./retropgf-2.md).
## A Commitment to Experimentation
RetroPGF is a longterm bet to build the future Optimists want to see.
The Collective will conduct regular rounds of RetroPGF, each different from the last.
This is an emergent process that will take community participation to grow and prune.
RetroPGF has three core components, each with substantial surface area for experimentation.
1. **Impact scoping**: what should the Collective fund?
How is it defined and decided on?
1. **Impact scoring:** how does the Citizens’ House evaluate impact?
What units, process, or tools do we use?
1. **Impact settlement:** how does voting work?
For the first several rounds of RetroPGF, the Optimism Foundation will decide on scope and voting mechanics with input from the community.
Eventually the set of variables around what to fund, how much to fund, and how to vote will be up to the Citizens’ House, with checks and balances from the Token House.
Over time, the Collective aims to expand the scope of RetroPGF to support the production of public goods beyond the immediate Optimism ecosystem.
To get there, we must refine the tools and processes used for RetroPGF based on regular experimentation.
---
title: Citizenship
lang: en-US
---
## Identity on Optimism
The Citizens’ House relies on the concept of identity-based governance.
This is distinct from the more common pattern of token-voting governance (as used in [Optimism’s Token House](./token-house.md)).
To start, the initial set of Citizens in this stage is determined by (a) criteria set by the Optimism Foundation and (b) a special election from the Token House.
Citizenship is conferred by a simple entry in the [AttestationStation](./attestation-station.md).
In future stages, the Token House and Citizens’ House together will collaborate on ongoing criteria for participation in the Citizens’ House.
This means the criteria for Citizenship will evolve over time.
Holding a voting badge in RetroPGF 2 does not guarantee voting rights in all future rounds of RetroPGF, as eventually membership will be determined by governance and may change.
How does this work?
- Optimism has a neutral, permissionless attestation contract called the [`AttestationStation`](./attestation-station.md)
- Optimism Governance (Token + Citizens’ House) has authority over a function that takes the AttestationStation as an argument and uses any data included to determine the set of Citizens.
Optimism governance can use any reputation data written to the AttestationStation contract to determine Citizenship in future iterations of the Citizens’ House.
This system is designed to be flexible and future-proof; rather than prescribe citizenship criteria at the outset, the Collective is keeping true to its principle of iterative governance.
For more information on Optimism's identity layer, visit the [AttestationStation documentation](./attestation-station.md).
## Becoming a Citizen
The Citizens’ House is initiated with the set of 90 voters in [RetroPGF 2](./retropgf-2.md).
Eventually, Citizenship is intended to be widely distributed to a large group of humans across the Optimism ecosystem with expertise in many different subcultures and industries.
Eventually, Optimism governance will have the power to set criteria for Citizenship.
This means voting eligibility may someday be subject to rules and restrictions unknown today.
**Voting in RetroPGF 2 does not guarantee permanent participation in the Citizens’ House and future iterations of RetroPGF.**
The next wave of Citizenships will be issued in advance of RetroPGF 3, later in 2023.
---
title: Find and Track Your Delegate
lang: en-US
---
- [Identify your current delegate and view the delegate's voting record](https://help.optimism.io/hc/en-us/articles/6389519530779-How-do-I-see-how-my-delegate-voted-)
- [View information about specific delegates (their share of the votes, etc.)](https://dune.com/optimismfnd/optimism-op-token-house)
<!--
- [Delegate aggregate information (GINI coefficient, etc.)](https://app.flipsidecrypto.com/dashboard/optimism-governance-l5WXpo)
-->
\ No newline at end of file
---
title: How to be a delegate
lang: en-US
---
Participating in Token House governance can require a serious time commitment.
For this reason, people are able to delegate their OP to community members who have explicitly volunteered to play an active role in Token House governance.
Being a delegate is an important job that comes with a lot of responsibility.
Before deciding to become a delegate you should be familiar with:
* The [Working Constitution](https://gov.optimism.io/t/working-constitution-of-the-optimism-collective/55).
* The [Operating Manual](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md).
* The [Delegate Code of Conduct](https://gov.optimism.io/t/delegate-code-of-conduct/3943)
## Ready to be a delegate?
This is the process to become a delegate:
### Step 1: Commit
* Read the delegate responsibilities
* Post a completed [delegate commitment form](https://gov.optimism.io/t/delegate-commitments/235).
If you have any questions about the form, ask in the [delegation questions feedback thread](https://gov.optimism.io/t/delegation-questions-feedback-thread/236)
* It is not required, but you probably also want to [delegate your OP tokens' voting power to yourself](https://app.optimism.io/delegates).
Please note that the expectation is that token grants **will not be** self-delegated to grant recipients.
### Step 2: Set up your profile
* Set up your delegate profile.
Please note that delegate avatars are taken from ENS. 
[If you want to change your avatar, you’ll need to do it via ENS](https://medium.com/the-ethereum-name-service/step-by-step-guide-to-setting-an-nft-as-your-ens-profile-avatar-3562d39567fc).
The Optimism Foundation will add new profiles to the [delegate site](https://app.optimism.io/delegates) once per Season.
---
title: OP Economics
lang: en-US
---
::: tip Notice: OP Airdrop #1 is now available to claim
[Click here to claim](https://app.optimism.io/airdrop/check)
*Airdrop #1 does not require payment.*
*Stay safe!*
:::
The Optimism Collective is based on the idea that healthy public goods create a thriving and valuable ecosystem.
The economics of this ecosystem are designed to generate value for three constituencies:
- Value accrues to **tokenholders** through the productive re-deployment of sequencer revenue.
Sequencer revenue is primarily directed to fund public goods, which creates ecosystem value and drives demand for blockspace.
- Value accrues to **contributors and builders** directly from retroactive public goods funding and the markets it enables.
Builders also benefit symbiotically: it’s better to build in an ecosystem with well-funded tools, education, apps, and infrastructure.
- Value accrues to **users and community members** from ongoing airdrops of OP, from project incentives made possible by OP ecosystem funding, and from the benefit public goods provide.
Together, it looks like this:
![](../../assets/docs/governance/economics/virt_cycle.png)
Let’s break it down ⤵️
## Demand for OP blockspace generates revenue
Funding for the OP economy comes from ownership of the Optimism network and the value of its blockspace.
Today, funding comes directly from the centralized sequencer, accruing to The Optimism Foundation for redistribution.
In the future, funding can accrue directly to the protocol by selling the right to participate in Optimism’s decentralized sequencing network.
Simply put: the right to blockspace is the sustainable source of revenue that drives OP’s economic model and grows with the network itself.
## Revenue is distributed to public goods
Communities benefit from all sorts of public goods, from education to city infrastructure to open source software.
But many markets fail to provide adequate funding and support for those public goods.
It’s here that Optimism takes a step forward, by building a sustainable funding source into the mechanisms of the network itself.
Direct or auctioned sequencer revenue is distributed back to the ecosystem primarily through Retroactive Public Goods Funding ([RetroPGF](https://medium.com/ethereum-optimism/retroactive-public-goods-funding-33c9b7d00f0c)).
This creates strong incentives for individuals to build for the public good of the Optimism Collective.
To start, the Citizens’ House will vote quarterly on distributions of funds to individuals, teams, projects, or communities that have provided subjective value over a specified time period.
This directly rewards community members for the positive impact of their work.
RetroPGF also provides possible exit liquidity for public goods projects, which opens up a market for early investment in those projects.
This means builders can:
- Be compensated for their positive contributions without generating direct revenue.
- Raise capital to bootstrap based on the early potential and promise of their project.
In the long-term, the Foundation expects this mechanism to drive a wide range of pro-social downstream effects, which the Collective can capture and expand upon through frequent experimentation and iteration.
## Value from public goods drives demand for blockspace
Funding public goods drives growth — and therefore network revenues — from the ground up.
In our [first round](https://vitalik.ca/general/2021/11/16/retro1.html) of RetroPGF, Optimism funded a set of hugely valuable developer tools and core infrastructure.
The aggregate effect is an ecosystem that is easier to build on, learn about, and connect to, in turn driving application usage and generating more demand for blockspace.
But what value do these public goods provide, and for whom is it valuable?
This is a rich design space.
Optimism’s governance is designed to create conditions for experimentation around this question.
The Foundation draws heavily on the work of Ostrom, Vitalik, and others to make sure funding for public goods is maximally efficient, effective, and safe.
To start, Foundation governance is shared and divided through a two-house system, where network parameters for the amount of funding are controlled by both houses, but the governance of RetroPGF allocation is determined by a set of Citizens with local knowledge and skin in the game.
Thoughtful allocation of public goods funding will create longterm value for builders, users, tokenholders, citizens and the entire Optimism Collective.
---
title: Existing Delegates
lang: en-US
---
::: danger Out of date information
This process is currently under construction for Season 3.
Check back soon for updated information.
:::
Thank you for being active in Optimism Token House Governance.
As a delegate, you should:
- Join the conversation in the below channels in our [Discord](https://discord-gateway.optimism.io/):
- [#gov-general](https://discord.com/channels/667044843901681675/968498307913637919): This channel is for general governance discussions.
- [#new-gov-temp-check](https://discord.com/channels/667044843901681675/1011238484373159956): This channel is where proposers post their proposal for early feedback.
As a delegate you should provide feedback on proposals consistently.
- [#token-house-gov](https://discord.com/channels/667044843901681675/991340698995544176): This announcement channel will help you keep up to date with big events in the governance process, such as when voting starts, meta-governance updates, etc
- [#delegate-discussion](https://discord.com/channels/667044843901681675/989611992295813241): If you are a delegate with more than 0.5% delegated voting power, join the conversation with other larger delegates to discuss proposals & the governance process.
- Provide feedback on draft proposals in the [Proposals Discussion](https://gov.optimism.io/c/proposals/38) section of the Forum
- If you have more than 0.5% of voting supply then you can also approve proposals.
Proposals need at least 2 approvals to move to a vote.
To approve a proposal post this phrase in a forum comment on Discourse:
> **I am an Optimism delegate with sufficient voting power and I believe this proposal is ready to move to a vote.**
- Vote on proposals via [Snapshot](https://snapshot.org/#/opcollective.eth).
Multi-sig support for votes coming soon.
- Post your voting rationale in a [Delegate Communications Thread](https://gov.optimism.io/c/governance/41)
- Join the community calls, which occur every other Tuesday at 1pm ET.
[The governance calendar](https://calendar.google.com/calendar/u/0/r?cid=Y180aHVpNzBpdG0wODllN3Q4cTUwaGVoMWtub0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t) shows which Tuesdays, and how to join the call.
- Stay up to date with voting cycles and general governance updates in the Governance section of the [Forum](https://gov.optimism.io/c/governance/41).
\ No newline at end of file
---
title: Governance Fund Overview
lang: en-US
---
*[To discuss the Governance Fund, head to the Optimism governance forum](https://gov.optimism.io/t/governance-fund-discussion-thread/213)*.
## Overview
5.4% of the total initial token supply (231,928,234 OP) will be distributed to Optimism projects and communities via the Governance Fund.
The goal of the Governance Fund is to empower the OP community to proactively incentivize future growth of projects and communities in the Optimism ecosystem.
You can read more about the total allocation of OP in the [Allocations section](./allocations.md) of our [Governance docs](./README.md).
The purpose of the Governance Fund is to incentivize sustainable growth of projects and communities in the Optimism ecosystem.
This does not mean that all grants must be incentive programs.
The Token House is welcome to consider any and all proposals which would drive growth or address a gap in the Optimism ecosystem, including public goods projects.
Governance funds should come with an expectation of growth-related deliverables.
It is not the intended purpose of the governance fund to retroactively fund public goods without an expectation of future work.
There is [a distinct OP allocation](./allocations.md#retroactive-public-goods-funding) dedicated to this, which will be distributed via the Citizens' House at a later date.
## Phase 1
Phase 1 had begun after Airdrop #1 and distributes the remainder of the Governance Fund (approx. 196,128,233 OP) to projects in the Optimism ecosystem.
Phase 1 will continue until the Governance Fund is exhausted.
You can see how the Governance Fund has been distributed to date in [the Governance Tracker](https://docs.google.com/spreadsheets/d/1eaHOlWB34ij1KGsXdaNyTQg4tt1Pu2JurJsElBb6a8k/edit#gid=0).
Any project on Optimism can [submit a forum proposal](proposals.md) to request any amount of OP tokens.
The proposal must include a plan for how the tokens will incentivize growth on Optimism.
Proposals are reviewed and voted on by the [Token House](token-house.md).
When a project gets a proposal approved, they are still eligible to apply for further proposals.
The Optimism Foundation recommends that projects distribute their initial allocation of tokens before requesting further tokens.
Projects are also encouraged to reference data from the success of their initial distribution to strengthen their case in future proposals.
## Phase 0
Phase 0 was designed to reward existing projects that have driven growth of the Optimism ecosystem.
The amount of funding for each project was determined by a set of on-chain metrics, calculated via a snapshot of the Optimism chain on April 1, 2022 at 12:00am UTC.
To see live tracking on govFund allocations please see the [Public tracker spreadsheet](https://docs.google.com/spreadsheets/d/1eaHOlWB34ij1KGsXdaNyTQg4tt1Pu2JurJsElBb6a8k/edit#gid=0).
\ No newline at end of file
---
title: How to Delegate Your Tokens
lang: en-US
---
### Why Delegate?
Participating in governance of the Optimism Token House can require a serious time commitment.
For this reason, people are able to delegate the voting power of their OP tokens to a community member who has explicitly volunteered to play an active role in Token House governance.
These volunteers are called delegates.
If you do not wish to delegate your voting power to a representative, you will still need to delegate *to yourself* in order to vote.
### How do I delegate my votes to a representative?
1. [Choose a delegate](https://app.optimism.io/delegates).
Take the time to read through delegate statements of interest, choosing your delegate is an important decision!
A healthy governance system is good for Optimism and for all OP holders. Choosing a good delegate is in each OP token holder's best interest.
This delegate will vote on your behalf.
You will not hold any voting power or execute your own votes but you will retain 100% ownership of your tokens, and can use them however you want.
View top delegates by voting weight on [Dune](https://dune.com/optimismfnd/optimism-op-token-house).
1. [Go to the delegates app](https://app.optimism.io/delegates) to see that you’ve delegated your tokens as intended.
Please note that delegation only becomes effective the next time [Snapshot](https://snapshot.org/#/opcollective.eth) measures how many votes each delegate has.
This happens at the start of every voting cycle, which is every three weeks.
1. Monitor how your delegate [has been voting on Snapshot](https://help.optimism.io/hc/en-us/articles/6389519530779-How-do-I-see-how-my-delegate-voted-).
Your delegate should also write up the reasoning behind their votes in a [Delegate Communications Thread](https://gov.optimism.io/c/governance/41).
Delegation is always in your control. You can return to the [delegation page](https://app.optimism.io/delegates) at any time to change your delegate selection, or to re-delegate voting power to yourself (more below).
### How do I delegate to myself?
Would you rather vote yourself?
No problem, but you’ll have to delegate to yourself first!
If you try to vote with your tokens but have not delegated to yourself, you will not be able to vote.
1. [Delegate to yourself](https://help.optimism.io/hc/en-us/articles/6296720540955-How-do-I-delegate-to-myself-).
1. [Go to the delegates app](https://app.optimism.io/delegates) to see that you’ve delegated your tokens to your own address.
Please note that delegation only becomes effective the next time [Snapshot](https://snapshot.org/#/opcollective.eth) measures how many votes each delegate has.
This happens at the start of the voting phase in a cycle, which is the last week of each cycle.
A new cycle starts every 3 weeks.
If you want to become a delegate that others delegate to you need to [follow this process](delegate.md#ready-to-be-a-delegate).
1. Once you’ve been added as a delegate in the next voting cycle, you can start [voting](https://snapshot.org/#/opcollective.eth)!
<!--
## Step 1: Claim or purchase OP tokens
To check your eligibility for Airdrop #1, scroll to the bottom of [this page](https://app.optimism.io/announcement).
If you didn’t qualify for Airdrop #1, don’t worry, there will be more.
Claim your tokens by visiting **[the airdrop app](https://app.optimism.io/airdrop/check).**
It doesn’t cost anything to claim the airdrop, except for gas fees.
You will need to make sure you have some ETH on the Optimism network to pay for gas (0.003 is usually enough).
[Learn here how to deposit ETH to Optimism](https://help.optimism.io/hc/en-us/sections/4413033248795-Deposit).
Didn’t qualify or just want more OP? OP is available to buy on all major exchanges deployed on Optimism.
## Step 2: Delegate your tokens (to someone else or yourself)
Participating in governance of the Optimism Token House will require a serious time commitment.
For this reason, The Optimism Foundation strongly encourages people to delegate the voting power of their OP tokens to a community member who has explicitly volunteered to play an active role in Token House governance.
If you do not wish to delegate your voting power to a representative, you will still need to delegate to yourself in order to vote.
* [Delegate your tokens](https://app.optimism.io/delegates).
[Here are directions if you wish to delegate them to yourself](https://help.optimism.io/hc/en-us/articles/6296720540955-How-do-I-delegate-to-myself-).
* [Delegate guide](delegate.md)
* [Delegate's voting record](https://help.optimism.io/hc/en-us/articles/6389519530779-How-do-I-see-how-my-delegate-voted-)
## Step 3: Join the conversation
Comment in the [Proposal Discussion](proposals.md) section of the [Forum](https://gov.optimism.io/) and provide feedback on draft proposals.
::: tip
Make sure you understand and follow the Forum's [code of conduct](https://gov.optimism.io/t/code-of-conduct/5/4)
:::
## Step 4: Vote (if you are a delegate)
Go to [Snapshot](https://snapshot.org/#/opcollective.eth), connect your wallet, and vote.
There is no minimum OP holding voting requirement, but you will need to have the OP tokens you wish to delegate or vote with in your wallet when the voting snapshot is taken.
Tokens that are staked or LP’d when the snapshot is taken do not carry voting power.
-->
\ No newline at end of file
---
title: Submitting Proposals
lang: en-US
---
::: danger Out of date information
This process is currently under construction for Season 3.
Check back soon for updated information.
:::
## Grant Proposals
::: tip
This information is here for your convenience.
The source of truth for all governance related processes is the [Operating Manual](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md#proposal-process--components-of-a-valid-proposal).
The operating manual is currently in the process of being updated to reflect changes being voted on during Special Voting Cycles.
:::
Projects may submit a Phase 1 proposal to request OP tokens from the Governance Fund.
The purpose of the Governance Fund is to incentivize sustainable growth of projects and communities in the Optimism ecosystem.
This does not mean that all grants must be incentive programs.
The Token House is welcome to consider any and all proposals which would drive growth or address a gap in the Optimism ecosystem, including public goods projects.
However, funding should come with an expectation of growth-related deliverables.
It is not the intended purpose of the governance fund to retroactively fund public goods without an expectation of future work.
There is a distinct OP allocation dedicated to this, which will be distributed via [the Citizens' House](citizens-house.md) at a later date.
When writing your proposal, please adhere to the [grant proposal template](https://gov.optimism.io/t/grant-proposal-template/3233).
The process for submitting a grant proposal is currently undergoing changes.
A Grants Council, which will process grant applications in Season 3 was recently approved.
Stay tuned for more information on how to submit a proposal to the Council shortly.
**You can expect grant proposals to begin being processed again via the Grants Council on January 26th.**
## Other proposal types
There are [other types of proposals](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md#valid-proposal-types) that you can submit:
- Protocol Upgrade
- Inflation Adjustment
- Director Removal
There is no minimum holding requirement for submitting a proposal but your proposal must be approved by a delegate with sufficient voting power to move to a vote (as defined in [the operating manual](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md#valid-proposal-types)).
The process for submitting these proposals is very similar to the one for grants.
Where there are differences, they are noted in the table in the operating manual.
---
title: RetroPGF Round 2
lang: en-US
---
The Optimism Collective’s second round of Retroactive Public Goods Funding (RetroPGF) takes place in Q1 2023.
RetroPGF 2 will allocate 10m OP tokens to **fund public goods that support development and usage of the OP Stack.**
Optimism’s vision is to build a global system where positive impact to the collective is rewarded by profit to the individual.
RetroPGF is an experimental mechanism to realize this goal of **“impact = profit”**.
By funding public goods sustainably, the Collective can create a rich ecosystem and a better economy.
## Timeline
**Nomination window**: Jan 17 - Jan 31 19:00 GMT
**Project opt-in deadline**: Feb 14
**Voting window**: Feb 28 - Mar 14
## Scope of RetroPGF 2
**RetroPGF Round #2 will fund public goods that support development and usage of the OP Stack. This falls into three main categories:**
- **Infrastructure + Dependencies**: Software used to build or deploy the OP Stack; contributions to protocols or standards upon which the OP Stack runs; experiments that support future development of the core OP Stack protocol
- **Tooling + Utilities**: Work that helps builders create applications on Optimism mainnet, build on the OP Stack, interact with governance of the Collective, or use applications built on Optimism
- **Education**: Work to spread awareness and knowledge of how Optimism works, whether technically or socially
Today, the OP Stack refers to the OSS code powering Optimism. Today, this means the Optimism monorepo and its dependencies. Eligible projects **need not** be exclusive to the Optimism ecosystem, but there should be a connection. For example,
- **go-ethereum** is an important dependency of the OP Stack, but is not Optimism-specific.
- **Ethereum L2 explorer pages** which give stats on various L2s provide educational impact for the OP Stack, but are not Optimism-specific
RetroPGF 2 focuses on a narrow, Optimism-specific scope of impact to drive the core engine for ecosystem growth. In future rounds, this scope will expand.
## Nominations
Nominations will be open from **Jan 17 to Jan 31 19:00 GMT**. During this window, anyone can nominate a project for funding.
Here the term “project” can describe work that has been done by both an individual or a group.
Collections, a term used to describe projects without a single person or entity that can be verified via GitHub or Twitter, may only be nominated by the Optimism Foundation.
Nominations will take place on the [Optimism Governance Forum](https://gov.optimism.io/t/nominations-for-retropgf2/4636). Any community member can nominate a project by supplying:
- the project name
- A description of how the project has supported development and usage of the OP Stack
- a link to projects GitHub or Twitter
- (optional) contact info for the project or project lead
### You can nominate projects by category on the below forum posts
- [**Nominations for Infrastructure + Dependencies**](https://gov.optimism.io/t/infrastructure-dependencies-nominations-for-rpgf2/4637)
- [**Nominations for Tooling + Utilities**](https://gov.optimism.io/t/tooling-utilities-nominations-for-rpgf2/4639)
- [**Nominations for Education**](https://gov.optimism.io/t/education-nominations-for-rpgf2/4640)
## Funding Eligibility
Any project that has been nominated for RetroPGF 2 must complete a project profile on the **RetroPGF Application Manager** on the Optimism website in order to be eligible for voting.
The Application Manager will ask for information about your project, including authentication with Twitter or GitHub to prevent impersonations.
The Application Manager will also ask for information about team size, funding amount, impact provided to the Collective.
This information will help voters make choices about how to allocate funding.
After project nominations close, the Optimism Foundation will review completed profile submissions for spam and fraud.
Any project without a correctly verified GitHub or Twitter account, any project impersonating another team, or any project without a complete profile may be hidden from the voting round at the Foundation’s discretion.
For more information and guidance on the nomination and application process for projects, see the [**RetroPGF Project Manual**](https://www.notion.so/oplabs/Optimism-RetroPGF-2-Project-Manual-0a2e741133cd49b0b005ff759934b998).
## Voting Badge distribution
✨ Voting Badges for RetroPGF 2 will be distributed to a set of **90 community members.**
1. **One badge distributed to each voter from RetroPGF Round 1**, excluding full time employees of OP Labs or the Optimism Foundation. (14 badges, [list](https://docs.google.com/spreadsheets/d/1g4ilAByMNQsmlBC8cskQip7Ojd_qK6IhozJCyoVfU9k/edit#gid=0))
2. **One badge given to an individual selected by each of the previous voters in RetroPGF Round 1** (14 badges)
3. **One badge given to 10 Token House delegates, selected by a Token House vote.** (10 badges)
4. **One badge given to an individual selected by each of the badge-holding Token House delegates in (3) above** (10 badges)
5. **Twenty-one badges distributed to unaffiliated community contributors chosen by the Optimism Foundation**. (21 badges)
6. **Twenty-one badges distributed to individuals selected by each badge-holding community contributor in (5) above** (21 badges)
**Notes**
- Holding a voting badge for one round does not guarantee voting rights in subsequent rounds; Citizenship criteria are subject to change going forward
- Voting Badges in RetroPGF 2 are recorded as a simple attestation in the AttestationStation, not as a soulbound token. This approach preserves flexibility for future iterations
- Badgeholders are expected to adhere to the [Optimism Delegate Code of Conduct](https://gov.optimism.io/t/delegate-code-of-conduct/3943)
- An individual does not have to accept the voting badge. If an eligible person declines, the badge will not be distributed to someone else
- Anyone holding a Voting Badge will be able to mint an Optimist NFT – the inception of identity on Optimism
- Badgeholders with any participation or ownership stake in a project up for vote in RetroPGF 2 will be expected to not vote in favor of that project. Rules around conflicts of interest will be itemized in a forthcoming Badgeholder Manual
- Citizens’ House adheres to “one person one vote.” If an individual falls into more than one category above or is nominated more than once, they will still receive only one voting badge
Badgeholders will be added to a public channel on Discord for announcements and discussion.
## Voting
Each badgeholder will be asked to vote during a ten-day window from Feb 28 - Mar 14.
Voters will be able to filter, sort, and search projects.
Projects will be displayed with their answers to the application questions included in the project profile created via the RPGF Application Manager.
Votes will be aggregated as a simple weighted average, not as a quadratic vote.
Votes are submitted via a form and will only be accessible to the Foundation, which means an individual Citizen’s vote will not be public by default.
Once a vote is cast, the Citizen cannot update their vote.
---
title: Token House History
lang: en-US
---
## Seasons and voting cycles
Token House governance operates on a seasonal schedule.
Season two begins on August 25th, 2022, with Voting Cycle Five.
Seasons are separated with a three-week Reflection Period.
During each Season, Token House voting occurs via three-week voting cycles.
Voting Cycles begin on Thursday at 19:00p GMT (12p PST) and end on Wednesday at 19:00 GMT (12p PST).
At the beginning of a Season there may be a two-week voting cycle for policy and document proposals that come out of the previous Reflection Period.
During Reflection Periods, the Optimism Foundation will publish a proposed changelog to the Operating Manual and a set of governance proposals aimed at addressing the feedback received in the previous season.
There will be no active votes during Reflection Periods, so that delegates and the broader community have time to provide critical feedback to improve the next season.
Reflection periods are expected to be followed by two-week Special Voting Cycles during which we vote on proposals to modify the collective's structure.
You can see up to date information about the seasons and voting cycles in [the governance calendar](https://calendar.google.com/calendar/u/0/r?cid=Y180aHVpNzBpdG0wODllN3Q4cTUwaGVoMWtub0Bncm91cC5jYWxlbmRhci5nb29nbGUuY29t).
::: tip At the time of writing we in Season #2: August 25th - Nov 9th, 2022
Followed by:
- Reflection Period #2: Nov 10th - Nov 30th, 2022
- Season #3: Dec 1st, 2022 - Feb 15th, 2023
:::
## History
<!--
### Season #3: Dec 1st, 2022 - Feb 15th, 2023
* Voting system #12 (Jan 26th - Feb 15th)
* Voting system #11 (Jan 5th - Jan 25th)
* Voting system #10 (Dec 15th, 2022 - Jan 4th, 2023)
### Voting Cycle #9: Dec 1st - Dec 14th, 2022
### Reflection Period #2: Nov 10th - Nov 30th, 2022
-->
### Season #2: Aug 25th - Nov 9th, 2022
<!--
* Voting cycle #8 (Oct 20th - Nov 9th)
-->
* Voting cycle #7 (Sep 29th - Oct 19th)
* [Voting cycle #6 (Sep 8th - Sep 28th)](https://gov.optimism.io/t/voting-cycle-6-roundup/3481)
* Voting Cycle #5 (Aug 25th - Sep 7th):
Changes made during the Reflection Period are voted on during two-week Special Voting Cycles.
### Reflection Period #1
The reflection period was a break between season 1 and season 2 where the Optimism foundation, with the help of delegates and community members, updated and improved the governance process.
Document changes:
- [Operating Manual v2](https://gov.optimism.io/t/operating-manual-of-the-optimism-collective-v0-2-0/3370/8)
- [Grant Proposal Template v2](https://gov.optimism.io/t/grant-proposal-template/3233/15)
- [Introducing Governance Committees](https://gov.optimism.io/t/introducing-governance-committees/3238/60)
- [Committee Formation Proposal Template](https://gov.optimism.io/t/phase-1-committee-formation-proposal-template/3281/9)
### Season #1
* [Voting cycle #4](https://gov.optimism.io/t/voting-cycle-4-roundup/3055)
* [Voting cycle #3](https://gov.optimism.io/t/voting-cycle-3-roundup/2923)
* [Voting cycle #2](https://gov.optimism.io/t/voting-cycle-2-roundup/2754)
* [Voting cycle #1](https://gov.optimism.io/t/voting-cycle-1-roundup/2619)
---
title: Governing Documents
lang: en-US
---
[The Working Constitution](https://gov.optimism.io/t/working-constitution-of-the-optimism-collective/55) outlines governing provisions and principles for the Collective.
It will remain in effect no more than four years from the date of its adoption.
After that, authority over governance will be ceded to a permanent Bedrock Constitution that incorporates the lessons of the Collective’s prior governance experiments.
The Collective’s [Operating Manual](https://github.com/ethereum-optimism/OPerating-manual/blob/main/manual.md) describes current governance processes for the Token House.
It will evolve, with the Collective, over time.
The version linked here, from [The Optimism Foundation's github repository](https://github.com/ethereum-optimism/OPerating-manual), is the authoritative one.
---
title: How Optimism works
lang: en-US
---
Here you can see the [design philosophy](design-philosophy.md) for Optimism, as well as the [rollup protocol](rollup-protocol.md).
---
title: The Cannonical Transaction Chain (CTC) Format
lang: en-US
---
Every transaction submitted to Optimism is written to the mainnet Ethereum blockchain as call data, this is how Optimism inherits the availability and integrity guarantees of Ethereum.
This is also the cause of the majority of the cost of Optimism transactions.
At the time of writing it is cheaper to write a kilobytes to storage on Optimism than it is to add one byte to the calldata on Ethereum.
## Initial solution
The initial solution was to write a header with supporting data followed by a list of transactions.
To interpret a transaction, you can search for it on [Etherscan](https://etherscan.io/).
To interpret a CTC transaction you need to **Click to see more** to see the calldata (called "Input Data" by Etherscan):
![Transaction input data](../../assets/docs/protocol/compressed-ctc/input-data.png)
For example, here are the fields and their values for this [initial solution CTC transaction](https://etherscan.io/tx/0xf5a2dd9d0815ad4dcee00063ff8f8f3fd44b3bd8ffc1f7f6c7f7f0b4b086c5a7/advanced):
| Bytes | Field Size | Field | Value | Comments |
| ---------: | ---------: | ------------------| ----- | -------- |
| 0-3 | 4 | Function signature | 0xd0f89344 | [appendSequencerBatch()](https://www.4byte.directory/signatures/?bytes4_signature=0xd0f89344) |
| 4-8 | 5 | Starting tx index | 4025992 | [this transaction](https://explorer.optimism.io/tx/4025992) |
| 9-11 | 3 | Elements to append | 89 |
| 12-14 | 3 | Batch contexts | 15 |
| 15-30 | 14 | **Context 0** (multiple fields) |
| 15-17 | 3 | Transactions sent directly to L2 | 3 |
| 18-20 | 3 | Deposits with this context | 0 |
| 21-25 | 5 | Timestamp | 1646146436 | `block.timestamp` for transactions in this context (Tue Mar 01 2022 14:53:56 UTC)
| 26-30 | 5 | L1 block number | The L1 block number in this context, as obtained by calling [OVM_L1BlockNumber](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts/contracts/L2/predeploys/iOVM_L1BlockNumber.sol). ([14301739](https://etherscan.io/block/14301739)) |
| 31-46 | 14 | **Context 1** |
| 31-33 | 3 | Transactions sent directly to L2 | 8 |
| 34-36 | 3 | Deposits | 0 |
| 37-41 | 5 | Timestamp | 1646146451 | 15 seconds after the previous batch
| 42-47 | 5 | L1 block number | [14301739](https://etherscan.io/block/14301739)
| 16n+15-16n+30 | 14 | **Context n** |
| 16n+15-16n+17 | 3 | Transactions sent directly to L2 |
| 16n+18-16n+20 | 3 | Deposits with this context
| 16n+21-16n+25 | 5 | Timestamp
| 16n+26-16n+30 | 5 | L1 block number
This transaction has 15 batch contexts (numbered 0-14), so the first byte after the last context in this transaction, which starts the transaction list, is `16*15+15=255`.
Transactions are provided as a three byte length followed by the RLP encoded transaction.
Looking at locations 255-257, we see `0x00016e`, so the first transaction is 366 bytes long, at locations 258-623.
The next transaction length starts at byte 624, and the next transaction itself starts at byte 627.
## Additional batch types
The initial solution did not have a batch type.
However, to modify the format (for example, to add compression) a batch type is needed.
The solution is to set the timestamp of the first context to zero.
This does not create ambiguity because a timestamp of zero represents January 1st, 1970 (based on the UNIX convention), which cannot happen.
The block number then represents the transaction type.
## CTC transaction type zero
After the normal header and the first context, which has a timestamp of zero and a block number of zero, the other contexts contain the normal data.
After that the list of transaction lengths and transaction data is compressed using [zlib](https://nodejs.org/api/zlib.html).
<script>
// This redirect is here because search engines still know
// https://community.optimism.io/docs/protocol/sequencing/
// See https://github.com/ethereum-optimism/community-hub/issues/377
export default {
mounted () {
window.location.href="/docs/protocol/#decentralizing-the-sequencer"
}
}
</script>
---
title: SDK
lang: en-US
---
In most ways Optimism is [EVM equivalent](https://medium.com/ethereum-optimism/introducing-evm-equivalence-5c2021deb306).
However, the are [a few differences](../developers/build/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](../developers/build/transaction-fees.md), 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](https://github.com/ethereum-optimism/optimism/tree/develop/packages/contracts/docs).
This is the way your contracts can get Optimism information or services directly.
1. [The JavaScript SDK](js-client.md). For use when you write JavaScript or TypeScript code, either in the client or a Node.js server.
1. [Off chain, using RPC](../developers/build/json-rpc.md). Which is more complicated but usable from any development stack (Python, Rust, etc.).
::: tip 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.
- [Go on our Discord](https://discord-gateway.optimism.io/), and then ask in **#dev-support**.
- Submit an issue on [our Github](https://github.com/ethereum-optimism/optimism/issues).
:::
---
title: Alchemy SDK
lang: en-US
---
In addition to the standard [Ethereum RPC interface](../useful-tools/networks.md), Alchemy makes available an SDK.
- [Quickstart](https://docs.alchemy.com/reference/alchemy-sdk-quickstart/?a=818c11a8da)
- [Examples](https://docs.alchemy.com/reference/optimism-sdk-examples/?a=818c11a8da)
---
title: The Optimism Client SDK
lang: en-US
---
There are a few areas in which the SDK can help you navigate [the differences between Optimism and Ethereum](../developers/build/differences/):
- [Gas costs](../developers/build/transaction-fees.md)
- [Interlayer communication](../developers/bridge/basics.md)
## JavaScript SDK
[Reference](https://sdk.optimism.io/)
Tutorials:
- [Viewing transactions between layers](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/sdk-view-tx)
- [Bridging ETH with the Optimism SDK](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/cross-dom-bridge-eth)
- [Bridging ERC-20 with the Optimism SDK](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/cross-dom-bridge-erc20)
- [Estimate the costs of an Optimistic (L2) transaction](https://github.com/ethereum-optimism/optimism-tutorial/tree/main/sdk-estimate-gas)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment