Pages:
Author

Topic: [XRM] So... How we extract the new primes from the Primecoin Blockchain? (Read 2815 times)

full member
Activity: 167
Merit: 100
what is prime calculation good for?
legendary
Activity: 2198
Merit: 1014
Franko is Freedom
sr. member
Activity: 378
Merit: 255
hero member
Activity: 630
Merit: 502
I think I have it working as it should in Block Crawler now:

http://primeblock.kicks-ass.net/block_crawler.php

hero member
Activity: 630
Merit: 502
1CC is the chain below center numbers, 2CC is the chain above center numbers.

So you should substract 1 from the center numbers (keep doubling from origin) for 1CC.

OK got it, I was going in the wrong direction. Wink

legendary
Activity: 1205
Merit: 1010
1CC is the chain below center numbers, 2CC is the chain above center numbers.

So you should substract 1 from the center numbers (keep doubling from origin) for 1CC.

http://en.wikipedia.org/wiki/Cunningham_chain

If I'm reading this correctly its actually the other way around.

Cunningham Chain of the first type:



Yes, but that's not contradictory.

(n-1) * 2 + 1 = (2n - 1)

From center number you substract one.
From previous prime number you double and add one.
sr. member
Activity: 378
Merit: 255
1CC is the chain below center numbers, 2CC is the chain above center numbers.

So you should substract 1 from the center numbers (keep doubling from origin) for 1CC.

http://en.wikipedia.org/wiki/Cunningham_chain

If I'm reading this correctly its actually the other way around.

Cunningham Chain of the first type:

legendary
Activity: 1205
Merit: 1010
1CC is the chain below center numbers, 2CC is the chain above center numbers.

So you should substract 1 from the center numbers (keep doubling from origin) for 1CC.
hero member
Activity: 630
Merit: 502
yeah ive got all that in my block explorer

just gotta figure out how to convert it into a prime number

EDIT:Anyone willing to provide me the code to convert those into a prime number for the block explorer, will get their name listed on the page for donations

This is a bitwin chain. Both n-1 and n+1 are prime, as well as 2n-1 and 2n+1.

This chain is 6 long, so if I understand correctly:
p === primeorigin
p1 = p + 1
p2 = p - 1
p3 = p * 2 + 1
p4 = p * 2 - 1
p5 = p * 4 + 1
p6 = p * 4 - 1

and so on.

In python:

Code:
def primeChain(origin, length):
  primes = []
  for i in range(length / 2):
    primes.append(p * pow(2,i) + 1)
    primes.append(p * pow(2, i) - 1)
  return primes

primeChain(8965952996020407064364391577136065268670542909213664815741310568010946895662880601479081230, 6)

Or as a list comprehension:

Code:
primes = [[p * pow(2,i/2) + 1, p * pow(2,i/2) - 1] for i in range(length)]

Gives:

  • 8965952996020407064364391577136065268670542909213664815741310568010946895662880 601479081231
  • 8965952996020407064364391577136065268670542909213664815741310568010946895662880 601479081229
  • 1793190599204081412872878315427213053734108581842732963148262113602189379132576 1202958162461
  • 1793190599204081412872878315427213053734108581842732963148262113602189379132576 1202958162459
  • 3586381198408162825745756630854426107468217163685465926296524227204378758265152 2405916324921
  • 3586381198408162825745756630854426107468217163685465926296524227204378758265152 2405916324919

See for yourself! And happy priming, I still haven't found a block :/

EDIT: added code snippet

EDIT: helpful or interesting? send primecoins ASxa5AHJFHnpr47BMwKEZ4zksK57AJT6FT

Any idea how this works in relation to the 1CC and 2CC versions. It's my understanding that 1CC should use:
((previous number * 2) + 1)

And 2CC should use:
((previous number * 2) - 1)

But it doesn't seem to work. Take for example block 2003:

Prime Chain: 1CC08.339b77
Prime Origin: 9615572543071231184837168360004814554467140239322370722813195196221920358459324 7487894105484172550

Code:
    [0] => Array
        (
            [number] => 192311450861424623696743367200096291089342804786447414456263903924438407169186494975788210968345101
            [score] => 0
        )

    [1] => Array
        (
            [number] => 384622901722849247393486734400192582178685609572894828912527807848876814338372989951576421936690203
            [score] => 0
        )

    [2] => Array
        (
            [number] => 769245803445698494786973468800385164357371219145789657825055615697753628676745979903152843873380407
            [score] => 0
        )

    [3] => Array
        (
            [number] => 1538491606891396989573946937600770328714742438291579315650111231395507257353491959806305687746760815
            [score] => 0
        )

    [4] => Array
        (
            [number] => 3076983213782793979147893875201540657429484876583158631300222462791014514706983919612611375493521631
            [score] => 0
        )

    [5] => Array
        (
            [number] => 6153966427565587958295787750403081314858969753166317262600444925582029029413967839225222750987043263
            [score] => 0
        )

    [6] => Array
        (
            [number] => 12307932855131175916591575500806162629717939506332634525200889851164058058827935678450445501974086527
            [score] => 0
        )

    [7] => Array
        (
            [number] => 24615865710262351833183151001612325259435879012665269050401779702328116117655871356900891003948173055
            [score] => 0
        )

NOTE: score is the result of the php function gmp_prob_prime() which seems to be pretty reliable for outputting 1 for the correct numbers in the bitwin results. This can be important when there are an odd number of primes in the chain. Wink

Any idea where I'm going wrong here?
full member
Activity: 196
Merit: 100

just gotta figure out how to convert it into a prime number


There is no "prime number". It appears the proof of work certificate is evidence that you identified a "prime chain" of acceptable type which is divisible by the block header hash.

How we extract the new primes from the Primecoin Blockchain?

Someone understands how this research the coin does can be obtained, it's not clear for me from the Primecoin whitepaper.

This is not research.  It's just busy work.


I hope Sunny is releasing soon an updated whitepaper or more details, I don't understand why so much silence.

The real explanation for this coin is on the PPCoin forums ...

Quote from: Sunny King
In a few years that chart would have many different types of proof-of-work, bitcoin's mining share would be further reduced. This means the relative security against 51% attack is  going to be weakened for each pure proof-of-work cryptocurrency.

Primecoin may help speed up this process, taking a significant piece of mining market while attracting a larger user base to both primecoin and ppcoin. I believe it could strengthen our positioning against litecoin and other potential competitions.

http://www.ppcointalk.org/index.php?topic=288.msg1557#msg1557

The confusion surrounding the coin is very helpful to the goal, I think. Acting mysterious doesn't hurt any either.

If there was scientific value to it he would be proud and careful to explain it clearly...
sr. member
Activity: 378
Merit: 255
as far as I can tell the generation of prime numbers is just a replacement for the proof of work, it is not meant to try and generate new prime numbers that have yet to be discovered.  

It is conjectured that there are arbitrarily long prime chains. Primecoin is exploring this territory.
hero member
Activity: 518
Merit: 500
as far as I can tell the generation of prime numbers is just a replacement for the proof of work, it is not meant to try and generate new prime numbers that have yet to be discovered.  
sr. member
Activity: 378
Merit: 255
yeah ive got all that in my block explorer

just gotta figure out how to convert it into a prime number

EDIT:Anyone willing to provide me the code to convert those into a prime number for the block explorer, will get their name listed on the page for donations

This is a bitwin chain. Both n-1 and n+1 are prime, as well as 2n-1 and 2n+1.

This chain is 6 long, so if I understand correctly:
p === primeorigin
p1 = p + 1
p2 = p - 1
p3 = p * 2 + 1
p4 = p * 2 - 1
p5 = p * 4 + 1
p6 = p * 4 - 1

and so on.

In python:

Code:
def primeChain(origin, length):
  primes = []
  for i in range(length / 2):
    primes.append(p * pow(2,i) + 1)
    primes.append(p * pow(2, i) - 1)
  return primes

primeChain(8965952996020407064364391577136065268670542909213664815741310568010946895662880601479081230, 6)

Or as a list comprehension:

Code:
primes = [[p * pow(2,i/2) + 1, p * pow(2,i/2) - 1] for i in range(length)]

Gives:

  • 8965952996020407064364391577136065268670542909213664815741310568010946895662880 601479081231
  • 8965952996020407064364391577136065268670542909213664815741310568010946895662880 601479081229
  • 1793190599204081412872878315427213053734108581842732963148262113602189379132576 1202958162461
  • 1793190599204081412872878315427213053734108581842732963148262113602189379132576 1202958162459
  • 3586381198408162825745756630854426107468217163685465926296524227204378758265152 2405916324921
  • 3586381198408162825745756630854426107468217163685465926296524227204378758265152 2405916324919

See for yourself! And happy priming, I still haven't found a block :/

EDIT: added code snippet

EDIT: helpful or interesting? send primecoins ASxa5AHJFHnpr47BMwKEZ4zksK57AJT6FT
legendary
Activity: 1205
Merit: 1010
origin is explained in design paper  Wink
hero member
Activity: 784
Merit: 500
Quoted from primecoin genesis block:

Code:
    "primechain" : "TWN06.e0d80e",
    "primeorigin" : "8965952996020407064364391577136065268670542909213664815741310568010946895662880601479081230"

"primeorigin" clearly isn't a prime.

yeah ive got all that in my block explorer

just gotta figure out how to convert it into a prime number

EDIT:Anyone willing to provide me the code to convert those into a prime number for the block explorer, will get their name listed on the page for donations

I hope Sunny is releasing soon an updated whitepaper or more details, I don't understand why so much silence.
hero member
Activity: 784
Merit: 500
Quoted from primecoin genesis block:

Code:
    "primechain" : "TWN06.e0d80e",
    "primeorigin" : "8965952996020407064364391577136065268670542909213664815741310568010946895662880601479081230"

"primeorigin" clearly isn't a prime.

yeah ive got all that in my block explorer

just gotta figure out how to convert it into a prime number

EDIT:Anyone willing to provide me the code to convert those into a prime number for the block explorer, will get their name listed on the page for donations

I hope Sunny is releasing soon and updated whitepaper or more details, I don't understand why so much silence.
hero member
Activity: 518
Merit: 500
Bitrated user: ahmedbodi.
yeah ive got all that in my block explorer

just gotta figure out how to convert it into a prime number

EDIT:Anyone willing to provide me the code to convert those into a prime number for the block explorer, will get their name listed on the page for donations
sr. member
Activity: 378
Merit: 255
Quoted from primecoin genesis block:

Code:
    "primechain" : "TWN06.e0d80e",
    "primeorigin" : "8965952996020407064364391577136065268670542909213664815741310568010946895662880601479081230"
legendary
Activity: 1205
Merit: 1010
Quoted from my tutorial in main thread

Primes Tutorial

To understand the primes stored in block chain, one should read my design paper regarding prime chains.

In the 'getblock' output, there is a 'primeorigin' field. This is the origin of prime chain described in design paper, from which you can derive the prime numbers in the chain.

Another field 'primechain' describe this primechain type and length:

1CC -> Cunningham chain of 1st kind
2CC -> Cunningham chain of 2nd kind
TWN -> bi-twin chain

The length part consists of an integral length and a fractional length. The integral length is what we understand normally about chain length, the fractional part is a score system assigned to the prime chain in order to make difficulty adjustment continuous.

hero member
Activity: 518
Merit: 500
Bitrated user: ahmedbodi.
right ive talked to him, the 2 prime boxes that are on my explorer are used to calculate it
Pages:
Jump to: