Deprecating "midstate" in getwork? [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2011-10-02T07:52:56+00:00


Summary:

In a discussion about implementing SHA2 in Bitcoin, there are differing opinions on whether to use large libraries like OpenSSL or implement it locally. One person argues that the SHA2 algorithm can be easily implemented without OpenSSL, citing the original CPU miner for Bitcoin as an example. However, another person points out that Bitcoin already depends on OpenSSL for other functionalities such as ecdsa, bignum, and SSL for RPC.The conversation also touches upon the use of OpenSSL in BitcoinJS to calculate midstate, which is considered redundant and can be calculated from the blockheader. Nils Schneider proposes simplifying the internal reference miner by removing all dependencies on cryptopp, which is only used to calculate midstate. A pull request has been made to mark midstate as deprecated, resulting in cleaner code. However, there are concerns about losing compatibility with miners.Schneider raises the question of where such a change should be announced so that all miners can be upgraded. The mailing list exchange provides a link to a pull request for marking midstate as deprecated. It also includes an ad for Splunk, a tool for analyzing IT infrastructure data.In September 2011, Schneider proposed removing dependencies on cryptopp in the internal reference miner and relying solely on OpenSSL. This was prompted by the redundancy of the getwork "midstate" field, which could be calculated from the blockheader. Some expressed concern about losing compatibility with miners, but others agreed that deprecating midstate would result in cleaner code. A pull request for this change was submitted.The proposal to simplify the internal reference miner by removing all dependencies on cryptopp is motivated by its single use and the availability of alternatives like OpenSSL. The redundant getwork "midstate" field can be calculated from the blockheader, making cryptopp unnecessary. The author seeks suggestions on how to announce these changes to ensure all miners can upgrade.Overall, the discussion revolves around implementing SHA2 in Bitcoin and the use of libraries like OpenSSL versus local implementation. The focus is on removing dependencies on cryptopp and deprecating the redundant midstate field, with concerns about compatibility and the need to announce the changes to miners.


Updated on: 2023-08-01T02:30:47.664411+00:00