@okzx@mikaelh - thanks guys for your continued support. apologies to be a bit of pain but I still have some queries -
Please could you clarify on how does does one mine(which i guess is equivalent to finding new chains) when the origin is dependent on a variable which keeps changing by the minute ? Does it mean that one has to find these chains within the period of 1 minute before the hash changes again…which would seem like a very little time to find such a chain ?
Also how does one include a transaction into the block or where do I get one if hypothetically I manage to find a chain which satisfies the criteria mentioned above.
Short answer. Yes. But that is by design. We want to have block times of one minute. That means that the difficulty level will be set so that using the combined computing power of the network that on average only one Cunningham chain that meets the requirements to be submitted as a block is found.
I believe the transactions are stored in the block data as well as included in the hash for that block.
Well, you need to design your algorithm so that you get fast results. The reference client finds a bunch chain candidates and tests in less than one second.
If you’re using the getwork protocol, the daemon picks the transactions and makes the block. If you’re using getblocktemplate, you need to construct your own block (see libblkmaker).
In Primecoin mining the origin is composed like this:
origin = headerHash * primorial * candidateMultiplier
The header hash is an intermediate hash calculated from the block header (it is NOT the final block hash). It’s a 256-bit number that is required to be greater than 2^255.
What he is referring to is commonly called the “block header hash”. Which is documented:
Well, the header hash can be defined like this:
blockHeaderHash = HASH(nVersion, hashPrevBlock, hashMerkleRoot, nTime, nBits, nNonce)