{"id":19460161,"url":"https://github.com/offchainlabs/bold","last_synced_at":"2025-04-05T01:05:27.768Z","repository":{"id":185900784,"uuid":"560929050","full_name":"OffchainLabs/bold","owner":"OffchainLabs","description":"Efficient, all-vs-all dispute protocol for Optimistic Rollups","archived":false,"fork":false,"pushed_at":"2025-03-24T18:10:47.000Z","size":37659,"stargazers_count":117,"open_issues_count":10,"forks_count":28,"subscribers_count":24,"default_branch":"main","last_synced_at":"2025-04-02T05:04:41.853Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OffchainLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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":"2022-11-02T15:14:45.000Z","updated_at":"2025-03-24T18:10:50.000Z","dependencies_parsed_at":"2023-09-05T03:40:25.763Z","dependency_job_id":"db410120-ca6b-4527-b01a-81f79da4de5d","html_url":"https://github.com/OffchainLabs/bold","commit_stats":null,"previous_names":["offchainlabs/bold","offchainlabs/challenge-protocol-v2"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fbold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fbold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fbold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OffchainLabs%2Fbold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OffchainLabs","download_url":"https://codeload.github.com/OffchainLabs/bold/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271522,"owners_count":20911587,"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-10T17:35:47.426Z","updated_at":"2025-04-05T01:05:27.753Z","avatar_url":"https://github.com/OffchainLabs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# BOLD\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/OffchainLabs/bold)](https://goreportcard.com/report/github.com/OffchainLabs/bold)\n[![codecov](https://codecov.io/gh/OffchainLabs/bold/branch/main/graph/badge.svg)](https://codecov.io/gh/OffchainLabs/bold)\n\nThis repository implements Offchain Labs' BOLD (Bounded Liquidity Delay) Protocol: a dispute system to enable permissionless validation of Arbitrum chains. It is an efficient, all-vs-all challenge protocol that enables anyone on Ethereum to challenge invalid rollup state transitions. \n\nBOLD provides a fixed, upper-bound on challenge confirmations for Arbitrum chains.\n\nGiven state transitions are deterministic, this guarantees only one correct result for any given assertion. An **honest participant** will always win against malicious entities when challenging assertions posted to the settlement chain. \n\n## Repository Structure\n\nFor our research specification of BOLD, see [BOLDChallengeProtocol.pdf](docs/research-specs/BOLDChallengeProtocol.pdf).\n\nFor our technical deep dive into BOLD, see [TechnicalDeepDive.pdf](docs/research-specs/TechnicalDeepDive.pdf)\n\nFor documentation on the economics of BOLD, see [Economics.pdf](docs/research-specs/Economics.pdf)\n\nFor detailed information on how our code is architected, see [ARCHITECTURE.md](docs/ARCHITECTURE.md).\n\n```\napi/ \n    API for monitoring and visualizing challenges\nassertions/\n    Logic for scanning and posting assertions\nchain-abstraction/\n    High-level wrappers around Solidity bindings for the Rollup contracts\nchallenge-manager/\n    All logic related to challenging, managing challenges\ncontainers/\n    Data structures used in the repository, including FSMs\ncontracts/\n    All Rollup / challenge smart contracts\ndocs/\n    Diagrams and architecture\nlayer2-state-provider/\n    Interface to request state and proofs from an L2 backend\nmath/\n    Utilities for challenge calculations\nruntime/\n    Tools for managing function lifecycles\nstate-commitments/\n    Proofs, history commitments, and Merkleizations\ntesting/\n    All non-production code\nthird_party/\n    Build artifacts for dependencies\ntime/\n    Abstract time utilities\n```\n\n## Research Specification\n\nBOLD has an accompanying research specification that outlines the foundations of the protocol in more detail, found under [docs/research-specs/BOLDChallengeProtocol.pdf](./docs/research-specs/BOLDChallengeProtocol.pdf).\n\n## Using BOLD\n\nBOLD is meant to be imported as a dependency in Arbitrum chains' validator software as follows:\n\n```go\nimport (\n    \"github.com/OffchainLabs/bold/challenge-manager\"\n)\n\n...\n\nmanager, err := challengemanager.New(\n    ctx,\n    chain, // Bindings to the challenge manager contracts.\n    client, // Ethereum chain client.\n    stateManager, // L2 state provider.\n    rollupAddress, // Address of the RollupCore contract.\n    challengemanager.WithMode(types.WatchtowerMode), // Validation mode.\n)\nif err != nil {\n    return nil, err\n}\ngo manager.Start(ctx)\n```\n\nWhen provided with an L2 state provider, such as an Arbitrum Nitro validator, the challenge manager\nfrom BOLD can be started as a background routine that is in charge of asserting states on Ethereum,\ninitiating challenges on malicious assertions, confirming assertions, and winning challenges against\nmalicious parties.\n\n## Building\n\n### Go Code\n\nInstall [Go v1.20](https://go.dev/doc/install). Then:\n\n```\ngit clone https://github.com/OffchainLabs/bold.git \u0026\u0026 cd bold\n```\n\nThe project can be built with either the Go tool or the Bazel build system. We use [Bazel](https://bazel.build) internally because it provides a hermetic, deterministic environment for building our project and gives us access to many tools including a suite of **static analysis checks**, and a great dependency management approach.\n\n##### With Go\n\nTo build, simply do:\n\n``` \ngo build ./...\n```\n\n##### With Bazel\n\nWe recommend getting the [Bazelisk](https://github.com/bazelbuild/bazelisk) tool to install the Bazel build system. Bazelisk can be installed globally using the Go tool:\n\n```\ngo install github.com/bazelbuild/bazelisk@latest\n```\n\nThen, we recommend aliasing the `bazel` command to `bazelisk`\n\n```\nalias bazel=bazelisk\n```\n\nTo build with Bazel, \n```\nbazel build //...\n```\n\nTo build a specific target, do\n\n```\nbazel build //util/prefix-proofs:go_default_library\n```\n\nMore documentation on common Bazel commands can be found [here](https://bazel.build/reference/command-line-reference)\n\nThe project can also be ordinarily built with the Go tool\n\n## Testing\n\n### Running Go Tests\n\nInstall [Foundry](https://book.getfoundry.sh/getting-started/installation) to get the `anvil` command locally, which allows setting up a local Ethereum chain for testing purposes. Next:\n\n```\ngo test ./...\n```\n\nAlternatively, tests can be run with Bazel as follows:\n\n```\nbazel test //...\n```\n\nTo run a specific target, do:\n\n```\nbazel test //util/prefix-proofs:go_default_library\n```\n\nTo see outputs, run the test multiple times, or pass in specific arguments to the Go test:\n\n```\nbazel test //util/prefix-proofs:go_default_test --runs_per_test=10 --test_filter=\u003cTEST_NAME_HERE\u003e --test_output=streamed\n```\n\n### Running Solidity Tests\n\nSolidity tests can be run using hardhat, but we recommend using [Foundry](https://book.getfoundry.sh/getting-started/installation) as the tool of choice\n\nIn the contracts folder, run:\n\n```\nforge test\n```\n\nOutput:\n\n```\nTest result: ok. 42 passed; 0 failed; finished in 1.60s\n```\n\n## Generating Solidity Bindings\n\nWith node version 14 and npm, install `yarn`\n\n```\nnpm i -g yarn\n```\n\nThen install Node dependencies\n\n```\ncd contracts \u0026\u0026 yarn install\n```\n\nBuilding the contracts can be done with:\n\n```\nyarn --cwd contracts build\n```\n\nTo generate the Go bindings to the contracts, at the **top-level directory**, run:\n\n```\ngo run ./solgen/main.go\n```\n\nYou should now have Go bindings inside of `solgen/go`\n\n## Documentation\n\nGo doc reference is available at [pkg.go.dev](https://pkg.go.dev/github.com/OffchainLabs/bold), and all documentation about the codebase can be found under `docs/`\n\n## Security Audit\n\nBOLD has been audited by [Trail of Bits](https://www.trailofbits.com/) as of commit [60f97068c12cca73c45117a05ba1922f949fd6ae](https://github.com/OffchainLabs/bold/commit/60f97068c12cca73c45117a05ba1922f949fd6ae), and a more updated audit is being completed, to be finalized in the coming few weeks.\n\nThe audit report can be found under [docs/audits/TrailOfBitsAudit](./docs/audits/TrailOfBitsAudit.pdf).\n\n## License\n\nBOLD uses [Business Source License 1.1](./LICENSE.md)\n\n## Credits\n\nHuge credits on this project go to those who created BOLD and were involved in its implementation: Ed Felten, Yafah Edelman, Chris Buckland, Harry Ng, Lee Bousfield, Terence Tsao, Mario Alvarez, Preston Van Loon, Mahimna Kelkar, Aman Sanghi, Daniel Goldman, Raul Jordan, Henry Arneson, Derek Lee, Victor Shoup\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffchainlabs%2Fbold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foffchainlabs%2Fbold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foffchainlabs%2Fbold/lists"}