Bitcoin Forum
September 27, 2018, 11:17:48 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: higher difficulty acceptance from the node  (Read 613 times)
Mota
Legendary
*
Offline Offline

Activity: 805
Merit: 1002


View Profile
June 02, 2013, 11:36:06 AM
 #1

I searched around and found nothing in the forum, so here it is:

If one artificially raises the difficulty of the block and finds a valid hash for the higher difficulty, would it get accepted by the node?
Also, I can't wrap my head around the lesser difficulty in some mining pools. How are they accepted if they have lesser leading zeroes?

Who wants to be a billionaire? Me!
You could help Wink 1Dvja1RFCqxdnYRgjTntwGvdCeUisU4xp
1538090268
Hero Member
*
Offline Offline

Posts: 1538090268

View Profile Personal Message (Offline)

Ignore
1538090268
Reply with quote  #2

1538090268
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1538090268
Hero Member
*
Offline Offline

Posts: 1538090268

View Profile Personal Message (Offline)

Ignore
1538090268
Reply with quote  #2

1538090268
Report to moderator
1538090268
Hero Member
*
Offline Offline

Posts: 1538090268

View Profile Personal Message (Offline)

Ignore
1538090268
Reply with quote  #2

1538090268
Report to moderator
grau
Hero Member
*****
Offline Offline

Activity: 836
Merit: 1000


bits of proof


View Profile WWW
June 02, 2013, 06:25:57 PM
 #2

difficulty is not number of leading zeros, but a threshold number the block hash has to be less.

A block might satisfy a difficulty higher than currently required, and that would be accepted by others. The difficulty for next block does however not raise with that, its just waste of effort (or luck).
piotr_n
Legendary
*
Offline Offline

Activity: 1932
Merit: 1018


aka tonikt


View Profile WWW
June 02, 2013, 07:04:39 PM
 #3

If one artificially raises the difficulty of the block and finds a valid hash for the higher difficulty, would it get accepted by the node?
No.
It's in AcceptBlock function, in main.cpp

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
Mota
Legendary
*
Offline Offline

Activity: 805
Merit: 1002


View Profile
June 03, 2013, 02:10:17 PM
 #4

Were in AcceptBlock? It seems I can't find a check against it.

Who wants to be a billionaire? Me!
You could help Wink 1Dvja1RFCqxdnYRgjTntwGvdCeUisU4xp
piotr_n
Legendary
*
Offline Offline

Activity: 1932
Merit: 1018


aka tonikt


View Profile WWW
June 03, 2013, 02:16:44 PM
 #5

Were in AcceptBlock? It seems I can't find a check against it.

It's kind of hard to miss it, but well..

Code:
        // Check proof of work
        if (nBits != GetNextWorkRequired(pindexPrev, this))
            return state.DoS(100, error("AcceptBlock() : incorrect proof of work"));

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
Mota
Legendary
*
Offline Offline

Activity: 805
Merit: 1002


View Profile
June 03, 2013, 02:25:33 PM
 #6

I saw that, but then it seems that I understood it wrong. Proof of work means for me that it checks if the target is smaller than the last hash given. If I have a higher difficulty (and more leading zeroes) then it should be smaller than the last hash, or did I miss something?

Who wants to be a billionaire? Me!
You could help Wink 1Dvja1RFCqxdnYRgjTntwGvdCeUisU4xp
piotr_n
Legendary
*
Offline Offline

Activity: 1932
Merit: 1018


aka tonikt


View Profile WWW
June 03, 2013, 02:30:10 PM
 #7

I saw that, but then it seems that I understood it wrong. Proof of work means for me that it checks if the target is smaller than the last hash given. If I have a higher difficulty (and more leading zeroes) then it should be smaller than the last hash, or did I miss something?
Well in such case I think you probably only missed the lesson of C programming, where they were explaining the magic behind != symbol Wink

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
Mota
Legendary
*
Offline Offline

Activity: 805
Merit: 1002


View Profile
June 03, 2013, 02:55:35 PM
 #8

ah. *cough*  I am reading the code from my tv. bad excuse. -.-

Who wants to be a billionaire? Me!
You could help Wink 1Dvja1RFCqxdnYRgjTntwGvdCeUisU4xp
Pages: [1]
  Print  
 
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!