Technical details RE: Primecoin mining

Hello, all.

I’m a professional software engineer with much arcane knowledge (stretching from C and CUDA back to ASM and x86-64 architecture). This cryptocurrency stuff has caught my attention and I’d like to begin working on an XPM miner - mainly for the fun of the experience - but I’ve been unable to find any detailed specifications or technical data about how it all works (i.e. block format, network communication protocol/s, etc).

I notice miners are already in existence/development, so the knowledge must be out there somewhere. Is my only option dissecting the main Primecoin source and figuring it out for myself?

Thanks in advance for any input.

Hey Solaire,

Firstly, welcome to the forum :slight_smile:

Great to see a professional software engineer here keen to work on writing new crypto software!! Mainly the infomation you seek is not all in one place, websites are being built / designed, information is trying to be compiled together in sensible places, so a lot is still work in progress. One of those cases where the right questions need to be asked to the right people, and mostly you will need to dig around in the code yourself to find out how it actually works. is primecoins homepage run by Sunyking

Are you completely new to crypto currencies?? have you looked at the bitcoin code at all and seen the miners for that?

to find out how the basics of the blockchain work etc I find to be a useful resource.

From there you should get a good understanding of how pieces of the puzzle fit together… have a look at cgminer and GUI miner for examples of bitcoin miners.

Regarding the differences technically of how Primecoin differs from bitcoin, areas that differ suddenly become more apparent if you are familiar with what you are looking at, and if you have any specific questions on how areas have been changed then SunnyKing the developer behind Primecoin is an active member on this forum and often is in the chatbox on the index page of this forum. is the thread of the developer working on the GPU miner for primecoin

Have a look for jhPrimeminer (unfortunately only link i could find but search for it in the commits on github

hope this helps you get started :slight_smile:


I’m in a similar position to the OP. I’m interested in this problem, finding the primes themselves and so I thought I’d put together my own miner and experiment.

But, I am not sure exactly how it works, and am having trouble finding out online. Currently, I can call getwork via RPC, and get back a response - but I’m stuck for what to do next. I’d really appreciate if anyone can help!

  • After I have the “data” from getwork, as I understand it, this forms the origin for solving for primes. Do I have to run the data through a hash function (like sha256) first to get the origin? If so, can I include a nonce like I can for bitcoin?

  • What are the maximum and minimum values for the primes allowed in the chain?

  • After I’ve found a sequence of primes long enough, I know I have to return the quotient (according to the paper) using getwork again, but it sounds like I have to hash it first? How, and with what exactly?

Thanks for your help!

Yeah I think the community needs to standardize on some API for pool mining and solo mining with external miners. Xolokram’s primeminer currently works with and I haven’t digged through it much but I don’t think it’s a http jsonrpc API.