{"id":17278277,"url":"https://github.com/kulpreet/stratum-miners-time-lost","last_synced_at":"2025-10-05T19:34:09.721Z","repository":{"id":146435155,"uuid":"291761662","full_name":"kulpreet/stratum-miners-time-lost","owner":"kulpreet","description":"Time lost by miners validating blocks that they spend mining an empty block.","archived":false,"fork":false,"pushed_at":"2020-09-02T05:47:36.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-26T14:26:51.342Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/kulpreet.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":"2020-08-31T16:04:23.000Z","updated_at":"2020-10-10T13:33:26.000Z","dependencies_parsed_at":null,"dependency_job_id":"a6042f47-5cbd-4a7d-bdeb-e1ec107d0a3b","html_url":"https://github.com/kulpreet/stratum-miners-time-lost","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kulpreet/stratum-miners-time-lost","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Fstratum-miners-time-lost","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Fstratum-miners-time-lost/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Fstratum-miners-time-lost/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Fstratum-miners-time-lost/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kulpreet","download_url":"https://codeload.github.com/kulpreet/stratum-miners-time-lost/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kulpreet%2Fstratum-miners-time-lost/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263291303,"owners_count":23443733,"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":"2024-10-15T09:11:16.748Z","updated_at":"2025-10-05T19:34:04.690Z","avatar_url":"https://github.com/kulpreet.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stratum Listener \n\nI want to listen to various mining pool messages to figure out\nhow long do mining pools mine empty blocks or wait to build a\nblock that they can start mining.\n\n## How\n\nThis repo has a small python client to listen to stratum messages\nfrom various mining pools.\n\n## Stratum Messages\n\nStratum sends `mining.notify` messages that include previous block.\n\nWe want to decipher two pieces of timing information from these messages:\n\n1. What is the delay between a block mined by a pool and other pools switching to mining the next block?\n2. How long do miners potentially mine empty blocks?\n\nThe first information is hard to figure as the timestamp in the block header has a little bit of leeway.\n\nHowever, if miners switch to an empty block and then a block non-empty merkle_branch, then we know we know\nhow long miners mined an empty block for.\n\nHere is an example of an empty block being mined:\n\n```\n{\"id\":null,\"method\":\"mining.notify\",\"params\":[\"68fccbf2e\",\"95b10b5d6288d7c7f568c65400c3c75a1b8ba130000236510000000000000000\",\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4b030bdc09fabe6d6dd7f73a7f69e03ae8d0203261d252a511b2031b5df90054b3bb6751a325dedad20100000000000000\",\"2ebfcc8f062f736c7573682f0000000004e756622a000000001976a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac00000000000000002c6a4c2952534b424c4f434b3a9889bced22e7d99657b7c94939de0e322e7655f4b990fe55ac6da31600289aff0000000000000000296a4c266a24b9e11b6d122e0ce89b16dc8548767d326ed2d0407eb91a6ce00f1ae51d499038402765f70000000000000000266a24aa21a9ed80646cf543d0097c56587cd886dc98c7504163952f62fca2527bb8e70c2a5ec300000000\",[\"6005a73586a1fd538946fa987f6d12e239513aa0df9d27f096aa2b57f3e1cb04\",\"b40aea844402ce67c59d54c57d968f2ce6b606d9e783e6c36c7c12ec21deca2f\",\"06f4dc3f74fdd6e9d369e6bf6f6313e28b807e7f19b1a4323465fd871b630943\",\"8672bac49ce3c75a9adb02d654ef3720b779a675409547c95e579f394370d47c\",\"7eb01380eb24b05296b2c5d280178df077391c93795e50d631b3955b8e185b71\",\"2cf2ff3bf187e0ade21c09734e9e54480cbab9e035ef1f519aaf616b0b149748\",\"f2746aede98d05f5c874ca4d388675c58e54ee97d3a7847a3e873c1250f8bc74\",\"dbc2411a6e67a7d1f1bfe26d330f33d654078759422644da07ea767754a8b578\",\"bf05558030e051e92b2430450e22bb07f22dd60dc8eebcf58ff4778c5ad6fafe\",\"86b7e15229f447a59e61c81a82bb31051e39f42edc42ba9a198454d625de24c6\",\"7cf2fdb6160bdf21f172ef07283a4ad651f79ccaeb8a5c7\nd5e39e0e1e10c61f8\",\"bcef309f00ed16fbdab45de88a8175a7f04cf6782864f92fbf115eb7ec898c0e\"],\"20000000\",\"171007ea\",\"5f4d0e3c\",false]}\n\n{\"id\":null,\"method\":\"mining.notify\",\"params\":[\"68fcf6663\",\"49b258dd5a6ffef89ee39a7eff359c12e3f452200005c0e20000000000000000\",\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff1f030cdc09\",\"6366cf8f062f736c7573682f000000000240be4025000000001976a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac0000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf900000000\",[],\"20000000\",\"171007ea\",\"5f4d0e4d\",true]}\n\n{\"id\":null,\"method\":\"mining.notify\",\"params\":[\"68fcf98af\",\"49b258dd5a6ffef89ee39a7eff359c12e3f452200005c0e20000000000000000\",\"01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4b030cdc09fabe6d6dd7f73a7f69e03ae8d0203261d252a511b2031b5df90054b3bb6751a325dedad20100000000000000\",\"af98cf8f062f736c7573682f000000000438dccb28000000001976a9147c154ed1dc59609e3d26abb2df2ea3d587cd8c4188ac00000000000000002c6a4c2952534b424c4f434b3a777309413bd20a5b09b7c6758491df8b24761e8fb990fe55ac6da31700289b000000000000000000296a4c266a24b9e11b6d122e0ce89b16dc8548767d326ed2d0407eb91a6ce00f1ae51d499038402765f70000000000000000266a24aa21a9eda40a1aec067bca0321cb917954a2771569a30312cac6b0ca5d49769471fc0ba300000000\",[\"6005a73586a1fd538946fa987f6d12e239513aa0df9d27f096aa2b57f3e1cb04\",\"590a30526148160920b996df85fba5143749fdd3fe5b99e26aa6269a7966f8c2\",\"447653419b2a8705022064f8a8d49047972db7cfe1ac33aa5232fe6d0c900400\",\"6933c9b00a10fb02049eac8ebcd19377f45060527da4f5511daf929c036f654f\",\"a6eaa911f16bcade6f6888a2f78f04586db50c2657127af14fa951cacc5ab483\",\"188e63773cb867baa6b84d186fbd6cc560f5edb140a040c2ed40920d129f6249\",\"54d4d5d2d7f3ff70647da36bd4f56d5339866ba41cb9141418ee76626b3a9ffb\",\"51bf062e37625a623584103026968ae0a2ead11764871361b725cd06662895d7\",\"5cdd465c2ff01d824166d74446bf70a103b5103debe99ece0413a5070fc49022\",\"5f59f94dba67b680db2c5047e5414effc3f5d0c02de8c1a75335bfe070bf0dec\",\"7303769d61a0be2110991ae113572fba6a8cf7bbb25f4acba3394905949473d7\",\"e2c3d364c98c8b65b2d1ed9c199b6fafb8414a0731833d6bc7013eaf1fea0e72\"],\"20000000\",\"171007ea\",\"5f4d0e4f\",false]}\n```\n\n\nThis message is sent so that miners can construct their own block hash\nthat they can mine for.\n\nIf we receive messages from a pool X at timestamp ti, then we know that\nthe pool started mining a block on top of xxxb at ti minus some latency.\n\nAlso, from the block header timestamp we know at what time the block\nwas successfully mined.\n\n```\nt0, xxxa\nt0, xxxa\nt0, xxxa\n.\n.\n.\nti_1, xxxa\nti, xxxb\nti+1, xxxb\n.\n.\n.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpreet%2Fstratum-miners-time-lost","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkulpreet%2Fstratum-miners-time-lost","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkulpreet%2Fstratum-miners-time-lost/lists"}