Skip to content

Instantly share code, notes, and snippets.

@supertestnet
Last active April 22, 2026 11:00
Show Gist options
  • Select an option

  • Save supertestnet/a4278a4145dc4afb85867718ff350091 to your computer and use it in GitHub Desktop.

Select an option

Save supertestnet/a4278a4145dc4afb85867718ff350091 to your computer and use it in GitHub Desktop.
BH Market: a protocol for brokerless hashrate markets

The Problem

Recently I got the idea described in this document from @maveth6 on twitter. I know of three hashrate markets: Nicehash, Braiins, and Mining Rig Rentals. I define their niche as a type of broker. They not only play a matchmaking role between asic owners and would-be renters, they also custody the funds of renters while the mining is happening, and release it to asic owners bit by bit if there are no complaints from the renters. Brokers charge a fee for this work, which reduces the efficiency of the market, and, since they have custody of user funds, they are subject to various regulations. Those introduce additional friction: they KYC their users, they run incoming bitcoin through chainalysis software, they potentially seize funds if red flags are thrown, they are a honeypot for thieves, and user funds are at constant risk.

A Solution

My idea is to get rid of the broker. Instead, have people with asics publish an ad on nostr or similar stating how much hashrate they control and a price for renting it. People who want that hashrate contact them and give them a stratum link that points to their own node.

Then, the renter uses lightning micropayments to make near-constant small payments for a near-constant stream of "not winning" valid work from the asic owner. The asic owner basically submits his best work to the renter every minute or so; the renter checks that the block matches his desired template and has the expected amount of proof of work for the time his counterparty spent hashing. If it all checks out, the renter pays for the proof of work submitted so far.

Why this woks

As long as the asic owner keeps supplying valid proofs of work, the renter keeps paying. If at any point the renter stops paying, the asic owner stops mining, so he only loses at most 1 minute's worth of electricity, whereupon he or she can just seek a different counterparty.

I think a hashrate market could use that model and do away with the role of the broker. In fact, there's not really any role left for a centralized party, unless it is just "be a place where asic owners can advertise their equipment and the amount they charge for hashrate."

Getting precise

To be more precise, it is difficult to match a PoW target of sufficient difficulty to be valid on bitcoin mainnet. Let us define that as difficulty 100, whereas matching a PoW with only 2 leading zeros is difficulty 1. Well, for a miner with 5 petahashes, they have almost 0 chance of hitting a PoW of difficulty 100 after only 60 seconds of hashing, but in the "early" range, there are a lot of difficulty values where they have a 99.9% chance of hitting a PoW with a very low difficulty value.

E.g. maybe they have a 99.9% chance of hitting a PoW of difficulty 1---5, even after hashing for only 60 seconds; but as for difficulty 6, that is near their limit, so they only have a 50% chance of hitting that difficulty. So as a payer, you just find the highest difficulty PoW that they still have a 99.9% chance of hitting after 60 seconds, and require them to give you a block header whose hash matches that difficulty -- maybe it's 5.852.

If they submit a header whose hash matches that difficulty, and the header itself matches your template, great! Pay them. If not, don't pay. Then, for the next 60 seconds, you raise your difficulty to what is the highest difficulty PoW they are 99.9% likely to find after 2 minutes of hashing. Maybe it's 5.982 now. So, if they have submitted a matching header by then, keep paying them; if not, stop paying them. Rinse and repeat, ad infinitum.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment