Title: primecoin- deciphering the block to get the origin Post by: zeta_r_123 on January 13, 2014, 05:19:00 AM I am new to primecoins (and more generally crypto currencies) and have a few questions:
A) I am trying to understand how to get the block header hash from a given primecoin block. For example, using primecoind, I can get block info: ./primecoind getblock b56ce048d64313380d2a947cbb99bda97825646d89c6fd4222d154fc7f145bdd { "hash" : "b56ce048d64313380d2a947cbb99bda97825646d89c6fd4222d154fc7f145bdd", "confirmations" : 347122, "size" : 198, "height" : 10000, "version" : 2, "merkleroot" : "478aa31ca6011384884c60a5a3c864475640dfa546be26631f1cc58366b3d2ad", "tx" : [ "478aa31ca6011384884c60a5a3c864475640dfa546be26631f1cc58366b3d2ad" ], "time" : 1373505507, "nonce" : 627, "bits" : "07a62bc2", "difficulty" : 7.64910519, "transition" : 7.97894430, "primechain" : "TWN07.ecf7e1", "primeorigin" : "3137429839290119515389894171750697301735643977360059424820833454775626872284966 6432245972690", "previousblockhash" : "835228e99c1617650f8d72a3167fc92a8a3cf4bebcf60860a645d5b5309f8f87", "nextblockhash" : "54d6ec1f98ba10f897f7d8ea0991a042438f38b066702fc53fa05b52f93c3525" } My understanding (?) is that the primeorigin should be divisible by the `block header hash' of the previous block. But how do I determine the block header hash? I don't think it is the " "previousblockhash" which, in this example, is "835228e99c1617650f8d72a3167fc92a8a3cf4bebcf60860a645d5b5309f8f87" because when I convert this hex string to decimal I don't get a number that divides the given primeorigin. B) I am also after a more detailed description of the primecoin specs. Sunny King's paper is very broad and not at the level that describes the particulars of implementation. For example, for the Cunningham prime chains, would the primecoin network accept any prime chains where the origin is *any* multiple of the block header hash (so long as the other requirements such as difficulty, size of primes etc are satisfied)? I noticed that primorials are built into the multiple in primecoind's search for prime chains, but I am guessing that it is not an actual requirement. C) Also, I am trying to reverse engineer how primecoind searches for Cunningham chains. Can anyone point me to documentation or a description of the actual implementation. D) Finally, what precisely do primespersec and chainsperday refer to here: ./primecoind getmininginfo { "blocks" : 357131, "chainspermin" : 5, "chainsperday" : 0.02283714, "currentblocksize" : 4614, "currentblocktx" : 5, "difficulty" : 10.38302714, "errors" : "", "generate" : true, "genproclimit" : -1, "primespersec" : 854, "pooledtx" : 5, "sieveextensions" : 9, "sievepercentage" : 10, "sievesize" : 1000000, "testnet" : false } Thanks in advance for your help. Title: Re: primecoin- deciphering the block to get the origin Post by: primefan on January 13, 2014, 07:45:44 AM Can someone please respond to this question???? I tried the same thing, the prime origin is not divisible by the block hash (current or previous).
I have spend a whole day trying to figure this out! Apparently the "header hash" is not the same as the "block hash" from getblock. But it's not clear how to generate "header hash" from any primecoind outputs. Title: Re: primecoin- deciphering the block to get the origin Post by: jackjack on January 13, 2014, 07:48:47 AM http://www.peercointalk.org
Title: Re: primecoin- deciphering the block to get the origin Post by: chinacoinbase on January 13, 2014, 07:51:06 AM u can access the www.primecoin.org to get useful information. i also love primecoin
Title: Re: primecoin- deciphering the block to get the origin Post by: brtzsnr on January 14, 2014, 10:39:36 AM I sent a PM yesterday, but now I can reply for the public:
Here is the Go source to compute Header hash: Code: type BlockHeader struct { Get the values of the fields from the block: http://primecoin.21stcenturymoneytalk.org/index.php?block_hash=963d17ba4dc753138078a2f56afb3af9674e2546822badff26837db9a0152106 To get an integer from the hash you need to do: Code: // hashToBig converts a hash number to an integer Hope it helps, I can give more examples if still unclear when I have time. Title: Re: primecoin- deciphering the block to get the origin Post by: dredger on February 05, 2014, 12:32:01 PM What am I doing wrong?
I've implemented the GO code but I'm unable to find a header hash that divides the origin. This is the first time I have used GO, so perhaps you can spot the problem with my code? Can someone please give me the header hash for block 383313? My code looks like this: Code: package main Output: Code: Header hash byte[]: Title: Re: primecoin- deciphering the block to get the origin Post by: primecole on May 18, 2014, 10:26:42 AM Bump for interest. Were you able to solve the problem and successfully calculate the block header hash?
|