Bitcoin Forum
July 16, 2018, 09:01:34 PM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
   Home   Help Search Donate Login Register  
Pages: [1]
Author Topic: Help getting started with Mining and Pools  (Read 772 times)
Full Member
Offline Offline

Activity: 128
Merit: 100

View Profile
June 10, 2011, 11:40:52 AM

Hey all,
I've been lurking here for two weeks or so, and lately I started working on a project similar to, but I seem to miss some very basic ideas in bitcoin mining, and I would love some help if you could.

My idea is to create a simple PHP work distribution app, I am able to connect to bitcoind and poll some data from it, but I don't understand how do I offload data to other clients.

Like so:

require_once 'jsonrpcphp/includes/jsonRPCClient.php';

$bitcoin = new jsonRPCClient('http://eli:isthemaster@');


My understanding of bitcoin mining goes something like this:

  • Connect to bitcoin network
  • Get the latest target
  • Calculate some numbers and hash the result using SHA256 function
  • Compare my result with current target
  • If my result smaller or equal to target, I got the winning hash
  • Send something to bitcoin saying "I have found the somethig"
  • Network then verifies that I did found the correct something and rewards me with some bitcoins

From what I've gathered by reading and re-reading the wiki, this is the process that takes place when mining for bitcoins.

But the problem is that I completelly miss what it is that is being calculated and how it is being calculated.

From playing around with I understand that what it basically does is sending "clients" a starting point and an end point, and those are simply calculating the data, and if their hash is correct, they reply with the correct hash back to and I'm rewarded for the effort.

To my question:
Can you please show a very basic function that does the mining from start to finish? I prefer it to be in PHP, but I'll understand other languages (I hope).

Thanks a bunch!
Pages: [1]
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!