Bitcoin Forum
July 08, 2024, 10:56:54 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Testing my own hashing code (continued). on: May 26, 2019, 08:28:45 AM
(Edit) Reply to the last post of my previous topic from May 25, #5145912.0, "Testing my own hashing code".  I wound up accidentally creating a new topic here.

(Edit) Change 2x to 3x speed improvement.

Yes, I assumed that Bitcoin Core was an application that used external mining hardware.  That must be some other application that I was thinking of.
Looks like Bitcoin Core is more or less the original Satoshi reference implementation, and it does the hash within the program in software.
I appreciate the pointer to the sha256.cpp.  It's interesting reading.
I see that it has different versions for various x86 instruction sets, including the SHA instructions.  I can just replace the SHA version with my own.  I'm running on a Ryzen, which has the SHA instructions.

I'm curious about interfacing with a rig.  Can you tell me if the rigs being sold these days interface directly to the bitcoin network or whether they interface with a computer which interfaces with the bitcoin network.  In the latter case, what software is available to run on the computer, and is the interface between the computer and the rig standardized, or does the software need to be customized for each model of rig out there?

By the way, I believe my own software can do hashes more than three times as fast as that which comes with Bitcoin Core, because I've written it in assembler and taken care with the order of the instructions.  On the Ryzen, the latency of the SHA256RNDS2 instruction limits the time of a double hash to 192 cycles (3 64-byte blocks with 64 cycles each).  However, I've worked out a way to do multiple hashes in 64 cycles per hash, and that's the factor of 3 I referred to.  When I get around to it, I'll run a speed test on the sha256_shani code and post the results here.

Would there be any serious interest in publishing my code as part of Bitcoin Core, and would it be possible to license this particular module, or perhaps publish it as shareware, and earn a little money from it?  Obviously nobody would pay for the program to do mining for serious profit, because the power to speed ratio is hundreds of times too high.  But would anyone pay a little money for a 2x speedup to Bitcoin Core or any other product that does hashing in software?  I'd welcome any opinions about this.
2  Bitcoin / Development & Technical Discussion / How does a mining rig communicate? on: May 25, 2019, 09:05:59 PM
A program like Bitcoin Core assumes there's an external rig somewhere, and so there must be some sort of communications protocol, by which the app (Bitcoin Core) sends blocks and receives hash results.
I haven't been able to find any reference online about any protocols for this, but I'm sure there must be a standard that the rig manufacturers follow.

Can someone please point me to this standard.

This way, I can write some software that will follow this standard and then employ my own hashing code.
3  Bitcoin / Development & Technical Discussion / Testing my own hashing code on: May 22, 2019, 02:20:13 AM
I'm writing my own software to do the double SHA-256 hashing on my Windows 10 system.
I want to test it on real data, i.e., testnet.

My code can be called from C++, Python, or run as an executable from a command line.
It will take a message header as an input, and try to find a hash that satisfies the level of difficulty.

I expect that my code will be invoked with many such headers before it succeeds, even on testnet.  If I understand it correctly, the nodes on the network each receive different versions of the current block (with the extra nonce varying).

So I'm looking for a program that will get current data from the network, feed the message header to my program, try again if not successful, and post the success when successful.  I'd like to see that eventually, I will have successfully mined something.

Alternatively, I'd like to access an older block on the network to see if I can duplicate the successful hashing of that block, using the version of the message that was actually solved by the miner.  That way, I know that my program should succeed.

Can I get access to test cases which have a known result?

Is there a way I can estimate how many hashing attempt it would take, on average, to solve a hashing problem?  I know this will vary over time because of the adjustments to the level of difficulty, but I'd be interested in a ball-park answer for the testnet.  If the answer is in days (given the hashing speed of my software), then I might want to abandon attempts to successfully mine with live data and try some other approach.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!