{"id":17717296,"url":"https://github.com/bwesterb/go-pow","last_synced_at":"2026-02-26T02:20:30.090Z","repository":{"id":57492437,"uuid":"122969495","full_name":"bwesterb/go-pow","owner":"bwesterb","description":"Simple proof-of-work package for Go","archived":false,"fork":false,"pushed_at":"2019-01-24T17:42:37.000Z","size":6,"stargazers_count":22,"open_issues_count":1,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-06-18T18:45:52.384Z","etag":null,"topics":["generalized-birthday-paradox","golang","proof-of-work"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/bwesterb/go-pow","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/bwesterb.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}},"created_at":"2018-02-26T12:52:19.000Z","updated_at":"2024-04-17T02:33:48.000Z","dependencies_parsed_at":"2022-08-28T11:51:22.111Z","dependency_job_id":null,"html_url":"https://github.com/bwesterb/go-pow","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fgo-pow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fgo-pow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fgo-pow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bwesterb%2Fgo-pow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bwesterb","download_url":"https://codeload.github.com/bwesterb/go-pow/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246574864,"owners_count":20799224,"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":["generalized-birthday-paradox","golang","proof-of-work"],"created_at":"2024-10-25T14:19:44.663Z","updated_at":"2026-02-26T02:20:25.065Z","avatar_url":"https://github.com/bwesterb.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"go-pow\n======\n\n`go-pow` is a simple Go package to add (asymmetric) *Proof of Work* to your service.\n\nTo create a Proof-of-Work request (with difficulty 5), use `pow.NewRequest`:\n\n```go\nreq := pow.NewRequest(5, someRandomNonce)\n```\n\nThis returns a string like `sha2bday-5-c29tZSByYW5kb20gbm9uY2U`,\nwhich can be passed on to the client.\nThe client fulfils the proof of work by running `pow.Fulfil`:\n\n```go\nproof, _ := pow.Fulfil(req, []byte(\"some bound data\"))\n```\n\nThe client returns the proof (in this case  `AAAAAAAAAAMAAAAAAAAADgAAAAAAAAAb`)\nto the server, which can check it is indeed a valid proof of work, by running:\n\n\n```\tgo\nok, _ := pow.Check(req, proof, []byte(\"some bound data\"))\n```\n\nNotes\n-----\n1. There should be at least sufficient randomness in either the `nonce` passed to\n   `NewRequest` or the `data` passed to `Fulfil` and `Check`.\n   Thus it is fine to use the same bound `data` for every client, if every client\n   get a different `nonce` in its proof-of-work request.\n   It is also fine to use the same `nonce` in the proof-of-work request,\n   if every client is (by the encapsulating protocol) forced to use\n   different bound `data`.\n2. The work to fulfil a request scales exponentially in the difficulty parameter.\n   The work to check it proof is correct remains constant:\n\n   ```\n   Check on Difficulty=5  \t  500000\t      2544 ns/op\n   Check on Difficulty=10 \t  500000\t      2561 ns/op\n   Check on Difficulty=15 \t  500000\t      2549 ns/op\n   Check on Difficulty=20 \t  500000\t      2525 ns/op\n   Fulfil on Difficulty=5  \t  100000\t     15725 ns/op\n   Fulfil on Difficulty=10 \t   30000\t     46808 ns/op\n   Fulfil on Difficulty=15 \t    2000\t    955606 ns/op\n   Fulfil on Difficulty=20 \t     200\t   6887722 ns/op\n   ```\n\nTo do\n-----\n\n - Support for [equihash](https://www.cryptolux.org/index.php/Equihash) would be nice.\n - Port to Python, Java, Javascript, ...\n - Parallelize.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwesterb%2Fgo-pow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbwesterb%2Fgo-pow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbwesterb%2Fgo-pow/lists"}