{"id":19147824,"url":"https://github.com/refcell/op-challenger","last_synced_at":"2025-05-07T03:04:15.533Z","repository":{"id":157763520,"uuid":"622597467","full_name":"refcell/op-challenger","owner":"refcell","description":"A multi-mode op-stack challenge agent for dispute games written in golang.","archived":false,"fork":false,"pushed_at":"2023-04-06T14:33:55.000Z","size":27844,"stargazers_count":30,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T03:02:52.047Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://challenger.refcell.org","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/refcell.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-04-02T15:27:04.000Z","updated_at":"2024-05-31T15:50:22.000Z","dependencies_parsed_at":null,"dependency_job_id":"8daac752-29ca-4f65-99b5-f939856968bd","html_url":"https://github.com/refcell/op-challenger","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fop-challenger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fop-challenger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fop-challenger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/refcell%2Fop-challenger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/refcell","download_url":"https://codeload.github.com/refcell/op-challenger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252804206,"owners_count":21806769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T07:52:28.087Z","updated_at":"2025-05-07T03:04:15.512Z","avatar_url":"https://github.com/refcell.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg align=\"right\" width=\"200\" height=\"180\" top=\"100\" src=\"./public/op-gopher.png\"\u003e\n\n# op-challenger • [![ci](https://github.com/refcell/op-challenger/actions/workflows/ci.yml/badge.svg?label=ci)](https://github.com/refcell/op-challenger/actions/workflows/ci.yml) ![license](https://img.shields.io/badge/License-MIT-green.svg?label=license) ![maintainer](https://img.shields.io/badge/maintainer-refcell-orange.svg?label=maintainer)\n\nA modular [op-stack](https://stack.optimism.io/) challenge agent for attestation (fault and validity soon™) dispute games written in golang. Please note this is a proof of concept not intended for production use. The authors of this repository expressely recommond following the [rust-based op-challenger](https://github.com/clabby/op-challenger) for performance.\n\n## Quickstart\n\nFirst, clone the [Optimism Monorepo](https://github.com/ethereum-optimism/optimism) and set the `MONOREPO_DIR` environment variable to the path of that directory in a `.env` file as shown in `.env.example`.\n\nThen, you can simply run `make`, which will compile all solidity + golang sources, bring up the Optimism [devnet](https://github.com/ethereum-optimism/optimism/blob/develop/ops-bedrock/devnet-up.sh) while also deploying the [mock dispute game contracts](./contracts), and then run the `op-challenger`.\n\nAlternatively, you can build the `op-challenger` binary locally using the pre-configured makefile target by running `make build`, and then running `./op-challenger --help` to see the available options.\n\nIn the future, we intend to support downloading the `op-challenger` binary from [challenger.refcell.org](https://challenger.refcell.org) using `curl -s https://challenger.refcell.org | sh`\n\n## Usage\n\n`op-challenger` is configurable via command line flags and environment variables. The help menu shows the available config options and can be accessed by running `./op-challenger --help`.\n\nNote that there are many global options, but the most important ones are:\n\n- `OP_CHALLENGER_L1_ETH_RPC`: An L1 Ethereum RPC URL\n- `OP_CHALLENGER_ROLLUP_RPC`: A Rollup Node RPC URL\n- `OP_CHALLENGER_L2OO_ADDRESS`: The L2OutputOracle Contract Address\n- `OP_CHALLENGER_DGF_ADDRESS`: Dispute Game Factory Contract Address\n- `OP_CHALLENGER_PRIVATE_KEY`: The Private Key of the account that will be used to send challenge transactions\n- `OP_CHALLENGER_L2_CHAIN_ID`: The chain id of the L2 network\n\nHere is a reduced output from running `./op-challenger --help`:\n\n```bash\nNAME:\n   op-challenger - Modular Challenger Agent\n\nUSAGE:\n   main [global options] command [command options] [arguments...]\n\nVERSION:\n   1.0.0\n\nDESCRIPTION:\n   A modular op-stack challenge agent for output dispute games written in golang.\n\nCOMMANDS:\n   help, h  Shows a list of commands or help for one command\n\nGLOBAL OPTIONS:\n   --l1-eth-rpc value                      HTTP provider URL for L1. [$OP_CHALLENGER_L1_ETH_RPC]\n   --rollup-rpc value                      HTTP provider URL for the rollup node. [$OP_CHALLENGER_ROLLUP_RPC]\n   --l2oo-address value                    Address of the L2OutputOracle contract. [$OP_CHALLENGER_L2OO_ADDRESS]\n   --dgf-address value                     Address of the DisputeGameFactory contract. [$OP_CHALLENGER_DGF_ADDRESS]\n   --private-key value                     The private key to use with the service. Must not be used with mnemonic. [$OP_CHALLENGER_PRIVATE_KEY]\n   ...\n   --help, -h                              show help\n   --version, -v                           print the version\n```\n\n\n## Inner Workings\n\nThe op-challenger is a challenge agent for the output dispute game. It is responsible for challenging output roots.\n\nThis implementation is loosely based off the `op-proposer`, a proposer agent that is responsible for proposing new outputs to the `L2OutputOracle`. And this should make sense; where the `op-proposer` _posts_ `output`s to the `L2OutputOracle`, the `op-challenger` validates these outputs and disputes them if invalid. The primary functional difference the `op-challenger` must implement is the ability to challenge invalid outputs.\n\nThe naive challenge agent will be an attestation challenger which is a permissioned set of actors running the `op-challenger`. Below we illustrate how the challenger agent interacts with the [op-stack](https://stack.optimism.io/)'s permissionless output proposal system.\n\n\u003cimg src=\"./public/op-challenger.png\" /\u003e\n\nThe next iteration of the challenge agent will use fault proofs to challenge invalid outputs. This will involve a more complex dispute game which will allow for permissionless challengers by attaching bonds to each level of the dispute game. A future iteration could allow for validity (zero-knowledge) proofs.\n\n\n## Contributing\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md)\n\n\n## License\n\n[MIT](./LICENSE.md), forever and always.\n\n\n## Acknowledgements\n\n- [op-challenger](https://github.com/clabby/op-challenger): a rust challenge agent 🦀\n- [optimism](https://github.com/ethereum-optimism/optimism): the optimism monorepo 🚀\n- [op-stack](https://stack.optimism.io/): the op-stack 🥳\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fop-challenger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frefcell%2Fop-challenger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frefcell%2Fop-challenger/lists"}