[Research] A clockless vardiff strands a slowing miner

Posted by ajtowns

Jul 22, 2026/02:40 UTC

In managing variable difficulty (vardiff) for mining proxies, several operational strategies are essential to optimize performance and maintain efficiency. Proxies must dynamically adjust the vardiff based on various factors related to the mining activity observed. For instance, if a proxy directs a connection to reduce its hashrate, the corresponding adjustment in vardiff should be proportional to the change in hashrate, effectively scaling the difficulty by the ratio of the new hashrate to the original. Additionally, if a connection submits shares too frequently, indicating an easier than expected challenge, the vardiff should be increased to make mining more challenging.

Conversely, if no shares are found within a 30-second window, it indicates that the current difficulty might be too high, thus necessitating a reduction in vardiff by half to foster more frequent share discovery. Moreover, there is a need for consistency between the sum of inbound connections’ vardiffs and the upstream vardiff. If the calculated upstream vardiff, represented as k times the sum of inbound vardiffs where k>2, deviates significantly, a request should be submitted to adjust the upstream vardiff accordingly to align with the sum of inbound vardiffs.

The protocols for requesting changes in vardiff differ between Stratum V2 and V1. In Stratum V2, the appropriate action is to use the UpdateChannel message (UpdateChannel) when any downstream channel changes occur due to aggregation activities typically seen in proxies. For Stratum V1, the protocol specifies using "mining.suggest_difficulty" (mining.suggest_difficulty), or alternatively "suggest_target," to suggest adjustments in mining difficulty.

In scenarios where Datum technology is involved, the approach towards handling vardiff differs significantly. The datum-gateway autonomously selects a vardiff and integrates it directly into the coinbase, which allows the server to acknowledge and credit shares at their complete value immediately upon receipt. This method bypasses the need for prior negotiations regarding difficulty adjustments, relying instead on a pre-agreed encoding of difficulty within the coinbase itself. This streamlined process enhances efficiency by reducing the communication overhead typically associated with vardiff adjustments.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback