{"id":34528157,"url":"https://github.com/conflux-chain/conflux-light-contracts","last_synced_at":"2026-05-27T12:05:30.668Z","repository":{"id":172927750,"uuid":"649970868","full_name":"Conflux-Chain/conflux-light-contracts","owner":"Conflux-Chain","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-07T07:13:16.000Z","size":177,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-08-07T10:50:02.014Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/Conflux-Chain.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-06-06T03:40:12.000Z","updated_at":"2024-08-07T07:13:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"ed6208f3-4543-4dce-bf88-044cfe766bd3","html_url":"https://github.com/Conflux-Chain/conflux-light-contracts","commit_stats":null,"previous_names":["conflux-chain/conflux-light-contracts"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Conflux-Chain/conflux-light-contracts","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Conflux-Chain%2Fconflux-light-contracts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Conflux-Chain%2Fconflux-light-contracts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Conflux-Chain%2Fconflux-light-contracts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Conflux-Chain%2Fconflux-light-contracts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Conflux-Chain","download_url":"https://codeload.github.com/Conflux-Chain/conflux-light-contracts/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Conflux-Chain%2Fconflux-light-contracts/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33564963,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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-12-24T05:24:53.152Z","updated_at":"2026-05-27T12:05:30.662Z","avatar_url":"https://github.com/Conflux-Chain.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Conflux Light Node Contracts\n\nConflux light node contracts are used to verify transactions or receipts on other blockchain in manner of zero-knowledge.\n\n## Provable\n\n[Provable](./contracts/Provable.sol) contract is an utility to verify MPT proof of Conflux network.\n\n## LegerInfo\n[LedgerInfo](./contracts/LedgerInfo.sol) contract is an utility to verify BLS signatures of ledger info.\n\n## Light Node\n\n[LightNode](./contracts/LightNode.sol) contract is deployed on any blockchain for Conflux transaction or receipt verification. It could be deployed behind a [LightNodeProxy](./contracts/LightNodeProxy.sol).\n\nFirstly, light node contract should be initialized with any trusted PoS/PoW block. Then, Off-chain service is required to relay **PoS blocks** periodically. However, PoW blocks relay is not mandatory, since receipt proof contains PoW blocks to prove on chain. You could relay as many as PoW blocks whenever the **gas fee** for receipt proof verification is higher than PoW blocks relay.\n\n```solidity\nfunction initialize(\n    address _controller,\n    address _ledgerInfoUtil,\n    address _mptVerify,\n    LedgerInfoLib.LedgerInfoWithSignatures memory ledgerInfo\n) external;\n\nfunction updateLightClient(LedgerInfoLib.LedgerInfoWithSignatures memory ledgerInfo) external;\n\nfunction updateBlockHeader(Types.BlockHeader[] memory headers) external;\n```\n\nTo avoid too many records persisted on chain, relayer could garbage collect stale blocks, e.g. 1 week ago.\n\n```solidity\nfunction removeBlockHeader(uint256 limit) external;\n```\n\nOnce blocks relayed, transaction or receipt proof could be verified cryptographically:\n\n```solidity\nfunction verifyReceiptProof(Types.ReceiptProof memory proof) external view returns (bool success, Types.TxLog[] memory logs);\n\nfunction verifyProofData(bytes memory receiptProof) external view returns (bool success, string memory message, bytes memory rlpLogs);\n```\n\n## Differences from Ethereum\n\n1. **RLP Encoding**: encode `false` into `0x00` instead of `0x80`.\n2. **MPT**: Only `branch node` and `leaf node` in Conflux MPT. Whereas, there is `extension node` in Ethereum.\n3. Conflux use **BLS12-381** algorithm for PoS blocks, but the `hash_to_curve` is different from Ethereum. For more details, please refer to the [implementation](./contracts/lib/BLS.sol).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconflux-chain%2Fconflux-light-contracts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fconflux-chain%2Fconflux-light-contracts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fconflux-chain%2Fconflux-light-contracts/lists"}