{"id":25579022,"url":"https://github.com/cffls/pos-consensus-proof","last_synced_at":"2026-03-30T00:30:21.899Z","repository":{"id":264993663,"uuid":"867811296","full_name":"cffls/pos-consensus-proof","owner":"cffls","description":"Generate consensus proof for Polygon PoS using SP1","archived":false,"fork":false,"pushed_at":"2024-10-04T19:10:03.000Z","size":748,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-02-13T08:08:31.099Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":false,"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/cffls.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":"2024-10-04T19:09:30.000Z","updated_at":"2024-10-04T19:10:07.000Z","dependencies_parsed_at":"2024-11-28T13:30:25.573Z","dependency_job_id":null,"html_url":"https://github.com/cffls/pos-consensus-proof","commit_stats":null,"previous_names":["cffls/pos-consensus-proof"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cffls%2Fpos-consensus-proof","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cffls%2Fpos-consensus-proof/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cffls%2Fpos-consensus-proof/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cffls%2Fpos-consensus-proof/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cffls","download_url":"https://codeload.github.com/cffls/pos-consensus-proof/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239952604,"owners_count":19723922,"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":"2025-02-21T03:45:22.325Z","updated_at":"2026-03-30T00:30:21.851Z","avatar_url":"https://github.com/cffls.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pos-consensus-proof\nGenerate consensus proof for Polygon PoS using SP1\n\nThis is an extended version of [polygon-pos-light](https://github.com/paulgoleary/polygon-pos-light) by [Paul](https://github.com/paulgoleary).\n\n\u003e [!WARNING]\n\u003e This work is experimental and should not be used in production.\n\n### Background\n\nPolygon PoS contains 2 layers -- heimdall and bor. Bor (a fork of geth) is the block producing layer and heimdall is the consensus layer based on tendermint and maintains governs the validator set and bridging. In order to do settlement on Ethereum and bridging, heimdall submits `Checkpoints` on regular intervals. A checkpoint is nothing but the root hash of a range of bor blocks signed by all validators. With [PIP-11](https://github.com/maticnetwork/Polygon-Improvement-Proposals/blob/main/PIPs/PIP-11.md), a new structure for `Milestones` has been introduced which are meta checkpoints used as a finality gadget for bor. The only difference lies in it's structure and the fact that they're not submitted on Ethereum and are much more frequent.\n\n### Proving consensus\n\nWith the PoS chain moving towards being zkPoS and connecting with [AggLayer](https://github.com/agglayer), the first step is attach to AggLayer is to have the ability to generate proof. As generating full execution proofs is very expensive and time consuming as of now, it's not feasible to generate them with a 2s block time. Instead we rely on a consensus proof which is a zk proof which asserts that majority (2/3+1) of the validators signed a particular checkpoint/milestone. This in-directly proves the state of the underlying chain (i.e. bor). While there are multiple ways to achieve this, a generic zk proof seems much simple, efficient and easy to generate with general purpose zkVMs like [SP1](https://github.com/succinctlabs/sp1).\n\n### Requirements\n\n- [Rust](https://rustup.rs/)\n- [SP1](https://succinctlabs.github.io/sp1/getting-started/install.html)\n\n### Standard Proof Generation\n\n\u003e [!WARNING]\n\u003e You will need at least 16GB RAM to generate the default proof.\n\nGenerate the proof for your program using the standard prover.\n\n```sh\ncd script\nRUST_LOG=info cargo run --bin prove --release\n```\n\n### EVM-Compatible Proof Generation \u0026 Verification\n\n\u003e [!WARNING]\n\u003e You will need at least 128GB RAM to generate the PLONK proof.\n\nGenerate the proof that is small enough to be verified on-chain and verifiable by the EVM. This command also generates a fixture that can be used to test the verification of SP1 zkVM proofs inside Solidity.\n\n```sh\ncd script\nRUST_LOG=info cargo run --bin prove --release -- --evm\n```\n\n### Using the Prover Network\n\nMake a copy of the example environment file:\n\n```sh\ncp .env.example .env\n```\n\nThen, set the `SP1_PROVER` environment variable to `network` and set the `SP1_PRIVATE_KEY` environment variable to your whitelisted private key. For more information, see the [setup guide](https://docs.succinct.xyz/prover-network/setup.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcffls%2Fpos-consensus-proof","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcffls%2Fpos-consensus-proof","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcffls%2Fpos-consensus-proof/lists"}