Bitcoin Forum
May 03, 2024, 05:22:44 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Hard Fork Explanation...  (Read 2761 times)
vn10vn (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 23, 2014, 11:08:48 AM
Last edit: May 23, 2014, 11:20:08 AM by vn10vn
 #1

Can someone please explain to me exactly what is a hard fork? I said fork, f o r k.
1714756964
Hero Member
*
Offline Offline

Posts: 1714756964

View Profile Personal Message (Offline)

Ignore
1714756964
Reply with quote  #2

1714756964
Report to moderator
1714756964
Hero Member
*
Offline Offline

Posts: 1714756964

View Profile Personal Message (Offline)

Ignore
1714756964
Reply with quote  #2

1714756964
Report to moderator
The trust scores you see are subjective; they will change depending on who you have in your trust list.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714756964
Hero Member
*
Offline Offline

Posts: 1714756964

View Profile Personal Message (Offline)

Ignore
1714756964
Reply with quote  #2

1714756964
Report to moderator
MaxDZ8
Hero Member
*****
Offline Offline

Activity: 672
Merit: 500



View Profile
May 23, 2014, 02:33:27 PM
 #2

That leaves me confused.
My understanding follows - I would appreciate if somebody could confirm.

To understand what an hard fork is, we must describe how the blockchain works.

As people use BTC, transactions get generated. Those transactions get encoded in a block of data. The miners look at this data and try to figure out the nonce which will match the block header.
When a miner finds a nonce, the block has been found and it is added on top of the blockchain.
However, a set of miners might produce an incorrect nonce - perhaps maliciously - and propose it as a block solution - you might have heard of 51% attacks - this mismatching nonce creates a fork in the blockchain ("soft") as soon as the later nonce is found for the same block.
In real world, chains have a single end. When a chain is forked, it is not a proper chain. As miners keep hashing, they will add blocks on top of the previous. Some miners might get stuck on the "good" end, while some others will keep going on the "bad" end. Because of subtle details, one of those ends will eventually dominate and the other will be "orphaned" and considering invalid.

With an hard-fork, we decide a new way of doing things. So we voluntarily generate another path to follow. BUT both ends are technically correct. One is correct by the old standard, the other by the new standard. Since they are both correct, everyone not upgrading will continue working on the "old" end. You will understand this is not a good thing, and that's the reason for which hardforks are approached with care.
They are "hard" because they don't come from normal operation but rather a decision we make in upgrading the miners to the new protocol/hashing/whatever.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
May 23, 2014, 04:40:45 PM
 #3

That leaves me confused.
My understanding follows - I would appreciate if somebody could confirm.

To understand what an hard fork is, we must describe how the blockchain works.

As people use BTC, transactions get generated. Those transactions get encoded in a block of data. The miners look at this data and try to figure out the nonce which will match the block header.
When a miner finds a nonce, the block has been found and it is added on top of the blockchain.
However, a set of miners might produce an incorrect nonce - perhaps maliciously - and propose it as a block solution - you might have heard of 51% attacks - this mismatching nonce creates a fork in the blockchain ("soft") as soon as the later nonce is found for the same block.
In real world, chains have a single end. When a chain is forked, it is not a proper chain. As miners keep hashing, they will add blocks on top of the previous. Some miners might get stuck on the "good" end, while some others will keep going on the "bad" end. Because of subtle details, one of those ends will eventually dominate and the other will be "orphaned" and considering invalid.

With an hard-fork, we decide a new way of doing things. So we voluntarily generate another path to follow. BUT both ends are technically correct. One is correct by the old standard, the other by the new standard. Since they are both correct, everyone not upgrading will continue working on the "old" end. You will understand this is not a good thing, and that's the reason for which hardforks are approached with care.
They are "hard" because they don't come from normal operation but rather a decision we make in upgrading the miners to the new protocol/hashing/whatever.

You are pretty close.  You have a few of the details slightly wrong though.

An incorrect nonce will not be accepted by any peers (regardless of how much hash power you have).  Therefore a "mismatching nonce" does not create a fork.

This has nothing to do with a 51% attack. A 51% attack is when someone has so much hash power that they can solve blocks faster than the entire combined rest of the network.

A fork can occur any time nodes disagree on which block is the next block on the blockchain.

As an example, two different miners (or mining pools) can both solve a valid block at almost the same time.  Each solution is a bit different, but they are both completely valid.  The miners each relay their block to the peers that they are connected to.  This means some of the network first hears about the block from one miner, and the rest of the network hears about the block from the other miner.  There is no reliable way for any peer to know which block was solved first.  One thing any node can be sure about is which block "they" heard about first.  So, each node assumes that the block they heard about first is the winning block.  The network has now forked, with some nodes accepting one block onto their blockchain, and other nodes accepting the other block.  Eventually a miner will solve a block on top of one of these two blocks.  When that happens, their chain becomes longer, and the rest of the network accepts that they have the wrong block.  The entire network switches over to the longer chain, and the block from the shorter chain is abandoned (you'll often hear this referred to as "orphaned").  Orphans happen all the time, and are a natural part of the consensus building process that bitcoin is built around.

As you pointed out, a hard fork occurs if a change is made to the protocol such that blocks that are considered valid by one version of the software are not considered valid by another version.  In particular a hard fork occurs when something that is accepted as valid in the new software, wasn't previously accepted as valid in the old software.  This means that blocks from the new software will not be recognized as valid by the old software.  The chain will split if anyone is still running the old software. Depending on how long it takes people to notice that their old software isn't matching the rest of the network, it can create quite a mess for individuals who upgrade and suddenly find that transactions they thought were valid and completed suddenly don't exist.

This is often talked about in discussions about intentional changes to the protocol, but hard forks can occur accidentally as well.  It is possible for an unnoticed bug in a new version of the software to result in a fork.  Even though there is no "decision we make" to intentionally create the fork, the result is the same (a hard fork).

A soft fork is similar to a hard fork, but not quite as disruptive.  With a soft fork, something that is now invalid in the new software was not considered to be invalid by the old software.  With a soft fork, blocks that are created by the new software are still recognized as valid by users that haven't upgraded. If you aren't aware, and don't upgrade right away, you'll still see the same blockchain as the rest of the network.  If you are a miner your blocks will be more likely to be orphaned since much of the network won't accept your blocks, but for the average user, they won't experience much of an inconvenience from a soft fork.


cr1776
Legendary
*
Offline Offline

Activity: 4032
Merit: 1299


View Profile
May 23, 2014, 07:35:05 PM
 #4


...  It is possible for an unnoticed bug in a new version of the software to result in a fork.  Even though there is no "decision we make" to intentionally create the fork, the result is the same (a hard fork).
...


Great explanation - and for an example of the unnoticed bug, see March 2013.  Fixed quite quickly.
vn10vn (OP)
Newbie
*
Offline Offline

Activity: 14
Merit: 0


View Profile
May 23, 2014, 09:38:42 PM
 #5

It's a good but complicated explanation, I was hoping more for a layman's explanation. I guess what I really I want to know is what and how do I upgrade? Upgrade my wallet?
DannyHamilton
Legendary
*
Offline Offline

Activity: 3388
Merit: 4615



View Profile
May 23, 2014, 09:45:48 PM
 #6

It's a good but complicated explanation, I was hoping more for a layman's explanation. I guess what I really I want to know is what and how do I upgrade? Upgrade my wallet?

Sorry, when you said "What exactly is a hard fork?" We thought you were looking for a technical explanation.

In layman's terms:

A hard fork is when different versions of software accept different transaction histories as being the "correct" "official" transaction history.  At best, it results in transactions not being compatible between the versions of software.  At worst, it creates a disaster where nobody can be certain any longer whether the transactions that they believe they've received or sent are recognized by the rest of the system.

As for "What" you upgrade, that would be your wallet software if you are running a full node or a SPV wallet.  If you are using a hosted wallet (such as Coinbase, blockchain.info, BitStamp, localbitcoins, etc.) then all you can do is hope that they handle the situation appropriately.

As for "How" you upgrade, that would depend on what wallet software you are using.  Generally it involves downloading and installing the most recently released version of the wallet software.
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1129


View Profile
May 24, 2014, 06:06:05 PM
 #7

Bitcoin blocks have rules.  If a block follows the rules your client knows, your client accepts it as valid.  If it doesn't, then your client will look for some block which does follow the rules it knows and accept that as valid. 

A hard fork happens when there are different clients out there on the network with different opinions as to what the rules are.  The blockchain reaches a point where there's a block that follows one version of the rules but not the other, and all the clients that follow that version of the rules will build on that block while all the clients that follow the other version of the rules won't. 

The usual reason why there is a hard fork is because of a software revision.  If that's the case, you want to get the new version immediately - even before the hard fork happens, the new version and the hard fork will be announced, so if you're staying up to date there is plenty of time to get it. 

Hard forks can also be caused by bugs, whenever those bugs cause the same code to have a different effect depending on compiler, hardware, operating system, or whatever.  If that's the case, it's an emergency.  In an emergency, if you don't know what's going on, you should shut down your client and wait for the emergency to pass.

Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1129


View Profile
May 24, 2014, 07:01:59 PM
 #8

Does this mean I need to update my wallet if its updating ok (ie. downloading block chain)

Cheers!

If your wallet is the old version, it will cheerfully go on downloading blocks created in the old-rules fork, even though there is a new-rules fork whose blocks it is refusing.  And the new-rules fork is the one that's actually going to continue.

So, yes, if there's a hard fork, be sure you have the latest wallet, REGARDLESS of whether you're still getting blocks.



gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
May 24, 2014, 08:16:21 PM
Last edit: May 24, 2014, 09:35:26 PM by gmaxwell
 #9

Also im guessing it is a bitcoin fork we are talking about here?
I get so involved in alt coins now I rarely pay attention to what goes on in the bitcoin world
Is the fork related to the problems the network has been having (double withdrawels etc)
Then please don't post in this subforum if you're not interested in Bitcoin. My tolerance for seeming market manipulation is pretty low today, and spreading FUD about issues that don't exist and then professing ignorance is not my idea of a useful contribution to the discussion.

Someone was asking for a definition of a term, thats all.
There are no problems occurring right now in the Bitcoin network.

[Edit: I'm locking this thread because the question has been answered and its gathering offtopic posts. If the original author has any more questions let me know and I'll unlock!]
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!