{"id":13418476,"url":"https://github.com/tromp/cuckoo","last_synced_at":"2026-03-10T22:03:56.427Z","repository":{"id":12977483,"uuid":"15656147","full_name":"tromp/cuckoo","owner":"tromp","description":"a memory-bound graph-theoretic proof-of-work system","archived":false,"fork":false,"pushed_at":"2025-05-22T09:34:34.000Z","size":13527,"stargazers_count":846,"open_issues_count":3,"forks_count":175,"subscribers_count":82,"default_branch":"master","last_synced_at":"2026-01-26T21:33:30.142Z","etag":null,"topics":["bounties","cuckoo-cycle","graph","proof-of-work","solver"],"latest_commit_sha":null,"homepage":"","language":"C++","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/tromp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-01-05T18:20:37.000Z","updated_at":"2026-01-25T22:20:13.000Z","dependencies_parsed_at":"2026-01-03T11:10:12.053Z","dependency_job_id":null,"html_url":"https://github.com/tromp/cuckoo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/tromp/cuckoo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tromp%2Fcuckoo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tromp%2Fcuckoo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tromp%2Fcuckoo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tromp%2Fcuckoo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tromp","download_url":"https://codeload.github.com/tromp/cuckoo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tromp%2Fcuckoo/sbom","scorecard":{"id":899377,"data":{"date":"2025-08-11","repo":{"name":"github.com/tromp/cuckoo","commit":"60af1f78c408b5ef9333e295f8c2dc9055d59d50"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"1 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-24T14:57:27.011Z","repository_id":12977483,"created_at":"2025-08-24T14:57:27.011Z","updated_at":"2025-08-24T14:57:27.011Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30357614,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-10T21:41:54.280Z","status":"ssl_error","status_checked_at":"2026-03-10T21:40:59.357Z","response_time":106,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["bounties","cuckoo-cycle","graph","proof-of-work","solver"],"created_at":"2024-07-30T22:01:02.722Z","updated_at":"2026-03-10T22:03:56.416Z","avatar_url":"https://github.com/tromp.png","language":"C++","readme":"Cuck(at)oo Cycle\n================\n\n[Blog article explaining Cuckoo\nCycle](http://cryptorials.io/beyond-hashcash-proof-work-theres-mining-hashing)\n\n[same article archived in case cryptorials is down](\nhttps://web.archive.org/web/20190114062459/http://cryptorials.io/beyond-hashcash-proof-work-theres-mining-hashing/)\n\n[Whitepaper](doc/cuckoo.pdf?raw=true)\n\nMy [Grincon0 talk](https://www.youtube.com/watch?v=OsBsz8bKeN4) on Jan 28, 2019 in San Mateo.\n\nMy [Grin Amsterdam talk](https://www.youtube.com/watch?v=IHNUEOt-W2c\u0026list=PLvgCPbagiHgpJXhrKAJu0Q-mbCVhpqgu7) on Mar 26, 2019 in [Lil' Amsterdam](https://www.youtube.com/watch?v=nm1usRL6N5w) at Central Station.\n\nMy [Grincon1](https://grincon.org/) [talk](https://www.youtube.com/watch?list=PLvgCPbagiHgqYdVUj-ylqhsXOifWrExiq\u0026v=CLiKX0nOsHE) on Nov 22, 2019 in Berlin.\n\nCuckoo Cycle is the first graph-theoretic proof-of-work, and the most memory bound, yet with instant verification.\nUnlike Hashcash, Cuckoo Cycle is immune from quantum speedup by Grover's search algorithm.\nCuckatoo Cycle is a variation of Cuckoo Cycle that aims to simplify ASICs by reducing ternary counters to plain bits.\n\nSimplest known PoW\n------------------\nWith a 42-line [complete specification in C](doc/spec) and a 13-line\n[mathematical description](doc/mathspec), Cuckatoo Cycle is less than half the\nsize of either [SHA256](https://en.wikipedia.org/wiki/SHA-2#Pseudocode),\n[Blake2b](https://en.wikipedia.org/wiki/BLAKE_%28hash_function%29#Blake2b_algorithm), or\n[SHA3 (Keccak)](https://github.com/mjosaarinen/tiny_sha3/blob/master/sha3.c)\nas used in Bitcoin, Equihash and ethash. Simplicity matters.\n\nCuckatoo proofs take the form of a length 42 node-pair-cycle in a bipartite graph with N+N nodes and\nN edges, with N=2^n and n ranging from 10 up to 64.\n\nIn a node-pair-cycle, consecutive edges are not incident on a single node, but on a node-pair,\nthat is, two nodes differing in the last bit only.\nFrom now on, whenever we say cycle, we'll mean a node-pair-cycle.\n\nThe graph is defined by the siphash-2-4 keyed hash function mapping an edge index\nand partition side (0 or 1) to the edge endpoint on that side.\nThis makes verification trivial: hash the header to derive the siphash key,\nthen compute the 42x2 edge endpoints with 84 siphashes,\nand that you come back to the starting edge only after traversing 42 node-pairs.\n\nWhile trivially verifiable, finding a 42-cycle, on the other hand, is far from trivial,\nrequiring considerable resources, and some luck\n(the odds of a random cuckoo graph having an L-cycle are approximately 1 in L).\n\nLean mining\n-----------\nThe memory efficient miner uses 1 bit per edge and 1 bit per node in one partition\n(or 1 bit per 2^k nodes with linear slowdown).\nIt is bottlenecked by accessing node bits completely at random, making it memory latency bound.\nThe core of this miner, where over 99% of time is spent, is also [relatively simple](doc/simplesolve).\n\nMean mining\n-----------\nThe roughly 4x faster latency avoiding miner uses 33 bits per edge\nand is bottlenecked by bucket sorting, making it memory bandwidth bound.\n\nDynamic Sizing\n--------------\nInstead of fixing n, a proof-of-work system could allow miners to work on any graph size they like,\nabove a certain minimum. Cycles in larger graphs are more valued as they take more effort to find.\nWe propose to scale the difficulty for a graph with N=2^n edges by 2^(n+1) * n,\nwhich is the number of bits of siphash output that define the graph.\n\nUpgrade by Soft Fork\n--------------------\nDynamic Sizing allows for increasing the memory required for mining simply by raising the minimum allowed graph size.\nSince this makes new valid blocks a subset of old valid blocks, it is not a hard fork but a soft fork, easily deployed\nwith majority miner support. Miner manufacturers are incentivized to support larger sizes as being more future proof.\n\nAutomatic Upgrades\n------------------\nA raise in minimum graph size could be triggered automatically if over the last so many blocks (on the scale of months), less than a certain fraction (a minority like 1/3 or 1/4) were solved at that minimum size. This locks in a new minimum which then activates within so many blocks (on the scale of weeks).\n\nASIC Friendly\n-------------\nThe more efficient lean mining requires tons of SRAM, which is lacking on CPUs and GPUs, but easily implemented in ASICs,\neither on a single chip, or for even larger graph sizes (cuckatoo33 requires 1 GB of SRAM), on multiple chips.\n\nCycle finding\n--------------\nThe most efficient known way to find cycles in random bipartite graphs is\nto start by eliminating edges that are not part of any cycle (over 99.9% of edges).\nThis preprocessing phase is called edge trimming and actually takes the vast majority of runtime.\n\nThe algorithm implemented in lean_miner.hpp runs in time linear in N.\n(Note that running in sub-linear time is out of the question, as you could\nonly compute a fraction of all edges, and the odds of all 42 edges of a cycle\noccurring in this fraction are astronomically small).\nMemory-wise, it uses an N bit edge bitmap of potential cycle edges,\nand an N bit node bitmap of nodes with incident edges.\n\nThe bandwidth bound algorithm implemented in mean_miner.hpp\nuses (1+\u0026Epsilon;) \u0026times; N words to maintain bucket sorted bins of edges instead of a bitmap,\nand only uses tiny node bitmaps within a bin to trim edges.\n\nAfter edge trimming, an standard backtracking graph traversal\nis run to recognise all cycles, and report those of the right length.\n\nPerformance\n--------------\nThe runtime of a single proof attempt for a 2^29 edge graph on a 4GHz i7-4790K is 10.5 seconds\nwith the single-threaded mean solver, using 2200MB (or 3200MB with faster solution recovery).\nThis reduces to 3.5 seconds with 4 threads (3x speedup).\n\nUsing an order of magnitude less memory (128MB),\nthe lean solver takes 32.8 seconds per proof attempt.\nIts multi-threading performance is less impressive though,\nwith 2 threads still taking 25.6 seconds and 4 taking 20.5 seconds.\n\nI claim that siphash-2-4 is a safe choice of underlying hash function,\nthat these implementations are reasonably optimal,\nthat trading off (less) memory for (more) running time,\nincurs at least one order of magnitude extra slowdown,\nand finally, that mean_miner.cu is a reasonably optimal GPU miner.\nThe latter runs about 10x faster on an NVIDA 1080Ti than mean_miner.cpp on an Intel Core-i7 CPU.\nIn support of these claims, I offer the following bounties:\n\nLinear Time-Memory Trade-Off Bounty\n-----------------------------------\n$10000 for an open source implementation that uses at most N/k bits while finding 42-cycles up to 10 k times slower, for any k\u003e=2.\n\nAll of these bounties require n ranging over {27,29,31} and #threads\nranging over {1,2,4,8}, and further assume a high-end Intel Core i7 or Xeon and\nrecent gcc compiler with regular flags as in my Makefile.\n\nOn April 11, 2025 I received a submission from Stephan Theisgen to claim this bounty,\nproviding me with access to his \u003ca href=\"https://github.com/StephanTheisgen\"\u003esplean\u003c/a\u003e github repo.\nThis contains not only the required implementation, but also an extremely detailed write-up\nof the task, Dave Andersen's sampling suggestion, the solution approach,\npseudo code for all the steps involved,\nan analysis of the amount of number of hashes to be computed, parameter selection,\nmemory requirements and of various data structure candidates and their selection,\ncode testing, and validation. And it came with over a dozen references.\nA wortwhile submission to the Journal of PoW Algorithms, if there were such a publication.\n\nThe code quality matched that of the documentation. After finally gaining access to a high-end\nLinux box, and with Stephan's help in using the appropriate compile-time defines for my desired\nbenching runs, I was able to verify the claimed performance.\n\nMy estimate of memory deficient solvers incurring \"at least one order of magnitude extra slowdown\" turned\nout to be overly pessimistic. It looks to be closer to half an order of magnitude for this well optimized\nsolver.\n\nWhat does this mean for the feasibility of small memory ASICs? As Stephan's analysis showed, a \"tiny\" ASIC with only N/k bits of memory needs to hash each edge roughly (k+1000) times to find the cycle in a graph containing one, while the lean miner needs to hash each edge less than 6 times. That will make the tiny ASIC use far more electricity per solution, quickly wiping out the cost benefit of using negligible memory. Cuckatoo Cycle thus remains a \"Proof of SRAM\".\n\nCongratulations to Stephan for winning the bounty, paid out on April 30.\n\nGPU Cuckatoo32 Speedup Bounty\n------------------\n$10000 for an open source Cuckatoo32 solver that achieves 1.2 gps on an NVIDIA 4070Ti or 1 gps on an AMD RX 6900 XT with minimal cycle-loss.\n\nApple M1 Cuckatoo32 Ultra Bounty\n-----------------\n1 BTC for an open source Mac Studio (M1 Ultra) Cuckatoo32 miner achieving 0.5 gps with minimal cycle-loss.\n\nNicolas Flamel has \u003ca href=\"https://github.com/NicolasFlamel1/Mac-Studio-M1-Ultra-Cuckatoo-Trimmer\"\u003eattempted\u003c/a\u003e this bounty, but found the M1 Ultra GPU topping out at 0.26 gps even while offloading all but the inital trimming round to the CPU.\nHe also generously provided a comprehesive \u003ca href=\"https://github.com/NicolasFlamel1/Cuckatoo-Reference-Miner\"\u003ereference Cuckatoo miner \u003c/a\u003e.\n\nSiphash Bounties\n----------------\nWhile both siphash-2-4 and siphash-1-3 pass the [smhasher](https://github.com/aappleby/smhasher)\ntest suite for non-cryptographic hash functions,\nsiphash-1-2, with 1 compression round and only 2 finalization rounds,\n[fails](doc/SipHash12) quite badly in the Avalanche department.\nWe invite attacks on Cuckoo Cycle's dependence on its underlying hash function by offering\n\n$5000 for an open source implementation that finds 42-cycles in graphs defined by siphash-1-2\ntwice as fast as lean_miner on graphs defined by siphash-2-4, using no more than 1 byte per edge.\n\n$5000 for an open source implementation that finds 42-cycles in graphs defined by siphash-1-2\ntwice as fast as mean_miner on graphs defined by siphash-2-4, regardless of memory use.\n\nThese bounties are not subject to double and/or fractional payouts.\n\nHappy bounty hunting!\n \nHow to build\n--------------\n\u003cpre\u003e\ncd src\nmake\n\u003c/pre\u003e\n\nBounty contributors\n-------------------\n\n* [Zcash Forum](https://forum.z.cash/) participants\n* [Genesis Mining](https://www.genesis-mining.com/)\n* [Simply VC](https://www.simply-vc-co.ltd/?page_id=8)\n* [Claymore](https://bitcointalk.org/index.php?topic=1670733.0)\n* [Aeternity developers](http://www.aeternity.com/)\n\nProjects using Cuckoo Cycle\n--------------\n* [Grin](https://grin.mw/)\n* [æternity - the oracle machine](http://www.aeternity.com/)\n* [CodeChain](https://codechain.io/)\n* [BitCash](https://www.choosebitcash.com/)\n* [Veres One](https://veres.one)\n* [BIP 154: Rate Limiting via peer specified challenges; Bitcoin Peer Services](https://github.com/bitcoin/bips/blob/master/bip-0154.mediawiki)\n* [Raddi // radically decentralized discussion](http://www.raddi.net/)\n* [Cortex // AI on Blockchain](https://www.cortexlabs.ai/)\n\nProjects reconsidering Cuckoo Cycle\n--------------\n* [Handshake](https://handshake.org) found [unreconcilable issues](https://handshake.org/files/handshake.txt)\n\n![](img/logo.png?raw=true)\n","funding_links":[],"categories":["TODO scan for Android support in followings"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftromp%2Fcuckoo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftromp%2Fcuckoo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftromp%2Fcuckoo/lists"}