{"id":15452374,"url":"https://github.com/wondertan/cocage","last_synced_at":"2025-05-08T03:55:09.855Z","repository":{"id":198858048,"uuid":"700767901","full_name":"Wondertan/cocage","owner":"Wondertan","description":"Cocage is DA/DP module for Cosmos","archived":false,"fork":false,"pushed_at":"2023-12-10T14:32:34.000Z","size":202,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-08T03:55:03.495Z","etag":null,"topics":["abci","blockchains","celestia","comet","cosmos","da","tendermint"],"latest_commit_sha":null,"homepage":"https://imgur.com/5WettPc","language":"Go","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/Wondertan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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-10-05T08:58:25.000Z","updated_at":"2024-07-09T10:31:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"4a3b6db2-9e7a-4d55-addf-6182a33a349a","html_url":"https://github.com/Wondertan/cocage","commit_stats":{"total_commits":45,"total_committers":2,"mean_commits":22.5,"dds":0.4,"last_synced_commit":"7ea7dc8f76eee17bcb5888e8e05b379d0774656a"},"previous_names":["wondertan/cocage"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wondertan%2Fcocage","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wondertan%2Fcocage/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wondertan%2Fcocage/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Wondertan%2Fcocage/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Wondertan","download_url":"https://codeload.github.com/Wondertan/cocage/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252996331,"owners_count":21837620,"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":["abci","blockchains","celestia","comet","cosmos","da","tendermint"],"created_at":"2024-10-01T21:42:25.785Z","updated_at":"2025-05-08T03:55:09.812Z","avatar_url":"https://github.com/Wondertan.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# CoCage\n\n\u003e This name is a placeholder and will be changed in the future. Currently, it's [a meme ref](https://x.com/jon_charb/status/1672086508637937664?s=20) and answer\n\u003e to [the question](https://x.com/nickwh8te/status/1682779788350566402?s=20).\n\n\u003e This project won a Cosmoverse Hackmos 2023 hackathon!\n\nCoCage is a lightweight Cosmos SDK Data Publication* (DP) Module. This enables on-chain verification of \npublished data by an external network such as Celestia. Validators continually run a side-car process(light client) \nthat samples the published blocks on the external network. They then employ vote extensions to attest to data \ncommitments (merkle roots) over the data published by the external network.\n\n**Data Publication is more commonly known as Data Availability although the term publication more accurately represents the problem.*\n\n## Motivation\n\nCoCage is a foundational component for **trust minimized proof-based IBC bridging** (as opposed to committee based). In order for Cosmos to be able to bridge to other chains \nand Rollups in trust minimized way, it needs to be able to verify the data published by those chains. The goal of CoCage\nis to provide a reusable module that enables data publication verification for a variety of publication networks.\n\nThe original design was inspired by a collaboration between [Neutron](https://neutron.org/) and [Celestia](httsp://celestia.org). CoCage builds on top of Neutron's design and simplifies\nit substantially.\n\n## Use Case\n\n![user flow](./flow.svg)\n\nTo explain the utility of the system, it's best to explain the user flow of sending messages between a rollup and Cosmos SDK based chain. IBC relies on the ability to verify that a message has been correctly executed on a counterparty chain. For committee based chains this concretely means a quorum of validators signing over the `AppHash`. For rollups this means proof that the data was published as well as proof that the `AppHash` is valid (either a fraud proof or validity proof). An example of the flow is as follows:\n\n- User submits a tx to the rollup sequencer. The sequencer includes the tx in the rollup block as well as a header with the app hash showing the tx successfully executed.\n- The sequencer submits the rollup block to a DP Network like Celestia\n- Celestia published the rollup block in one if its block\n- The Cosmos SDK chain runs a DP light node that samples the block, validating that it has been published and is available\n- While voting, the validator of that app includes as a vote extension the latest successfully sampled height\n- The proposer for the following block uses the vote extensions to know what heights the other validators have sampled. If there are new blocks that aren't yet attested to, the proposer proposes them by including the data root of the Celestia block.\n- Validators vote on the proposal. They reject it if they have not sampled the same heights or have different data roots. They accept it otherwise\n- The block is committed and the new data roots are stored in the da module for the ibc module to access.\n- A rollup relayer submits an IBC transaction including the rollups header (with the `AppHash`)\n- The rollup relayer or another relayer includes either a validity proof or fraud proof. If there are no fraud proofs within a window, the chain trusts the rollups `AppHash`\n- The transfer module can now use the `AppHash` to verify the part of the state that it is interested in.\n\n## Design\n\n### Vote Extensions\n\nOn every new block, validators check if their DP Light Node sampled any new DP network heights and if so they submit a vote\nextension with the latest DP height sampled. We don't use VerifyVoteExtension, and we verify submitted heights in\nPrepareProposal.\n\n### Prepare Proposal\n\nProposer checks for vote extensions from previous height. If so, they find the latest\nsubmitted DP height with +2/3 votes, get the data commitments for the heights sampled from their DP Light Node and \npropose them as a TX.\n\n### Process Proposal\n\nProcessProposal then verifies the data commitments from against the DP network and if they are valid, it updates \nthe state of Keeper.\n\n### Keeper\n\nKeeper stores the mapping between DP heights and respective data commitments, so that future modules and IBC client\ncan verify proofs against the commitments.\n\n## Future Work\n\n* Abstract the DP network interface, so that we can support multiple DP networks.\n* Add support for IBC client to verify proofs against the DP network commitments.\n* Pruning expired commitments\n\n## Supported Networks\n\n### Celestia\n\nThe first external network supported by CoCage is [Celestia](https://celestia.network/). Celestia is a first modular\nDA/DP (Data Availability/Publication) network that provides a decentralized data availability layer for blockchains.\n\nWe use Rollkit's [Celestia OpenRPC API](https://github.com/rollkit/celestia-openrpc/) to query and sample data from the\nCelestia's Light Node. We cannot depend on celestia-node's API directly, and we cannot embed LN in Validator process,\ndue to conflicting SDK versions/forks.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwondertan%2Fcocage","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwondertan%2Fcocage","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwondertan%2Fcocage/lists"}