Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: wsxdrfv on March 23, 2018, 11:04:56 AM



Title: What is HardFork, SoftFork?
Post by: wsxdrfv on March 23, 2018, 11:04:56 AM
Exactly what happen when they occur?

Mining stopped?

Coin balance of owners will be transferred to new wallet automatically?


Title: Re: What is HardFork, SoftFork?
Post by: dmonrey002 on March 23, 2018, 11:47:21 AM
as far as i know mining will not stop.
 softfork is a change to the bitcoin protocol wherein only previously valid blocks/transactions are made invalid. Since old nodes will recognize the new blocks as valid, a softfork is backward-compatible. When a majority of miners upgrade to enforce new rules, it is called a miner-activated softfork (MASF). When full nodes coordinate to enforce new rules, without support from miners, it is called a user-activated softfork (UASF).

 A hardfork is a change to the bitcoin protocol that makes previously invalid blocks/transactions valid, and therefore requires all users to upgrade.

Any alteration to bitcoin which changes the block structure (including block hash), difficulty rules, or increases the set of valid transactions is a hardfork. However, some of these changes can be implemented by having the new transaction appear to older clients as a pay-to-anybody transaction (of a special form), and getting the miners to agree to reject blocks including the pay-to-anybody transaction unless the transaction validates under the new rules. This is known as a softfork.

To date, Bitcoin has never deployed a hardfork, but some altcoins have.

SOURCE: bitcoin wiki

hardfork occur  when some people supporting that coin is  not satisfy to the current protocol.



Title: Re: What is HardFork, SoftFork?
Post by: buwaytress on March 23, 2018, 03:19:21 PM
Love the wiki for quickfire and reasonably adequate explanations!

hardfork occur  when some people supporting that coin is  not satisfy to the current protocol.
My added understanding, possibly not incredibly accurate.

That is one of the scenarios for a hardfork, but not the only one. It is possible for a hard fork to occur with consensus, i.e. all current users (nodes in this case) support the fork and everyone upgrades software following new rules, as I understand, usually because of a critical security risk.

A technical hard fork could also happen inadvertently via blockchain reorganisation (client discovers longer chain and abandons shorter one). Unlikely to ever happen again at current network growth but I read that this happened at least once already even with Bitcoin on 12 March 2013... and I see can be common with alts.


Title: Re: What is HardFork, SoftFork?
Post by: Xynerise on March 23, 2018, 04:31:21 PM
Soft fork = backward compatible change to protocol.
Legacy nodes can still (mostly) verify transactions and blocks and do not necessarily need to upgrade immediately.
Used to introduce new features to the code

Hard fork: also used to introduce (of remove ) features to the protocol, but it's not backwards compatible.
Causes a divergence because new rules aren't compatible with the old ones (eg a 2MB block size increase in bitcoin isn't compatible with the current consensus of 1MB block size, so legacy nodes will reject any block greater than 1MB)
If it isn't contentious -- eg, in Monero-- then (almost) all nodes upgrade to the new chain  and the old one dies a chain death.
However, if it is contentious, and not everyone migrates to the new chain then there will be 2 different chains with 2 consensus rules. This is called a chain split.
Quote

Coin balance of owners will be transferred to new wallet automatically?
I assume you're referring to a UTXO fork here where coins (or precisely UTXOs) in the legacy chain are present in the new chain.
Technically all hard forks are UTXO forks as long as it's not just a codebase fork.
Since the 2 chains share the same block height then they'll share the same transaction history and UTXO set.
So, yes, if you make a UTXO fork of a coin, they will be present on the new chain automatically.


Title: Re: What is HardFork, SoftFork?
Post by: danniwide1234 on March 23, 2018, 05:18:34 PM
Soft fork and hardfork have some similarities in that they occur when there is a change to the existing protocols which can occur as a result of situations like risk security issues, general consensus etc.
One major difference however is that in Soft fork there is backward compatible change to the protocol which means user need not upgrade immediately but in Hardfork the reverse is the case. There's is no background compatible change to the protocol and so to avoid glitches, upgrade is more often than not required.



Title: Re: What is HardFork, SoftFork?
Post by: AGAVE on March 23, 2018, 08:57:05 PM
Hard Fork...

https://www.investopedia.com/terms/h/hard-fork.asp

SoftFork....

https://www.investopedia.com/terms/s/soft-fork.asp


Title: Re: What is HardFork, SoftFork?
Post by: Spazzer on March 23, 2018, 09:14:13 PM
Hard Fork...

https://www.investopedia.com/terms/h/hard-fork.asp

SoftFork....

https://www.investopedia.com/terms/s/soft-fork.asp

What is 'Hard Fork'
A hard fork (or sometimes hardfork), as it relates to blockchain technology, is a radical change to the protocol that makes previously invalid blocks/transactions valid (or vice-versa). This requires all nodes or users to upgrade to the latest version of the protocol software. Put differently, a hard fork is a permanent divergence from the previous version of the blockchain, and nodes running previous versions will no longer be accepted by the newest version. This essentially creates a fork in the blockchain: one path follows the new, upgraded blockchain, and the other path continues along the old path. Generally, after a short period of time, those on the old chain will realize that their version of the blockchain is outdated or irrelevant and quickly upgrade to the latest version.

What is 'Soft Fork'
In terms of blockchain technology, a soft fork (or sometimes softfork) is a change to the software protocol where only previously valid blocks/transactions are made invalid. Since old nodes will recognize the new blocks as valid, a softfork is backward-compatible. This kind of fork requires only a majority of the miners upgrading to enforce the new rules, as opposed to a hard fork which requires all nodes to upgrade and agree on the new version.


Title: Re: What is HardFork, SoftFork?
Post by: wsxdrfv on March 23, 2018, 11:26:38 PM
Hard Fork...

https://www.investopedia.com/terms/h/hard-fork.asp

SoftFork....

https://www.investopedia.com/terms/s/soft-fork.asp

What is 'Hard Fork'
A hard fork (or sometimes hardfork), as it relates to blockchain technology, is a radical change to the protocol that makes previously invalid blocks/transactions valid (or vice-versa). This requires all nodes or users to upgrade to the latest version of the protocol software. Put differently, a hard fork is a permanent divergence from the previous version of the blockchain, and nodes running previous versions will no longer be accepted by the newest version. This essentially creates a fork in the blockchain: one path follows the new, upgraded blockchain, and the other path continues along the old path. Generally, after a short period of time, those on the old chain will realize that their version of the blockchain is outdated or irrelevant and quickly upgrade to the latest version.

What is 'Soft Fork'
In terms of blockchain technology, a soft fork (or sometimes softfork) is a change to the software protocol where only previously valid blocks/transactions are made invalid. Since old nodes will recognize the new blocks as valid, a softfork is backward-compatible. This kind of fork requires only a majority of the miners upgrading to enforce the new rules, as opposed to a hard fork which requires all nodes to upgrade and agree on the new version.
Thanks.
So then if I do SoftFork, previously valid blocks/transactions, current wallet's balances all become 0? And should start 0 from softforked block height?


Title: Re: What is HardFork, SoftFork?
Post by: boy130 on March 24, 2018, 12:06:21 AM
In basic terms, a soft fork is an update to the blockchain that rolls out across the current implementation, whereas a hard fork is a major, often controversial change to the architecture that cannot be implemented with a soft fork, this leads to two separate blockchains operating at one, the old, and the forked chains. Both can continue to exist separately.


Title: Re: What is HardFork, SoftFork?
Post by: Fantastic33 on March 24, 2018, 02:23:39 AM
Maybe you can read these links. Hope these can help you.  ;)

http://truebloodlawgroup.com/blog/What-is-the-difference-between-a-Hard-Fork-and-a-Soft-Fork/2524

https://bitcoin.stackexchange.com/questions/30817/what-is-a-soft-fork

https://masterthecrypto.com/guide-to-forks-hard-fork-soft-fork/


Title: Re: What is HardFork, SoftFork?
Post by: Xynerise on March 24, 2018, 07:36:26 AM
Thanks.
So then if I do SoftFork, previously valid blocks/transactions, current wallet's balances all become 0? And should start 0 from softforked block height?
Not true at.
The bit about "previously valid blocks/transactions" becoming invalid has to do with protocol rules, not the UTXO.
For example if there was a soft fork to reduce the block size to 500kb from 1MB, then the old rule of 1MB blocks will become invalid, thus any block created or relayed by the legacy nodes greater than 500kb which was previously valid, would be rejected by the new nodes, however, blocks relayed by legacy nodes that isn't greater than 500kb will still be valid to the new nodes.

The wallet balances do not become 0 in both cases; it's the rules being changed, not the UTXO, so both forks preserve the UTXO set between both forks.


Title: Re: What is HardFork, SoftFork?
Post by: bob123 on March 24, 2018, 11:09:14 AM
For example if there was a soft fork to reduce the block size to 500kb from 1MB, then the old rule of 1MB blocks will become invalid,

A change of the block size can not occur in a soft fork.
A soft fork is defined by being 'compatible' with older nodes.

Bcash, for example, did simply increase the block size to 8mb. This occured in a hard fork.

Bitcoin on the other hand increased the amount which can fit into a block by introducing SegWit.
This happened through a soft fork. This works because transaction structure has changed and the witness data can be stripped off for older nodes (1MB limit).
Therefore no consensus rules get broken 'in the eyes of' older (non-updated) nodes.


Title: Re: What is HardFork, SoftFork?
Post by: AdSkull89 on March 26, 2018, 08:21:46 AM
Exactly what happen when they occur?

Mining stopped?

Coin balance of owners will be transferred to new wallet automatically?

People posted plenty of technical links above me. Here is my ELI5 version:

1. Hard fork - when number of people decide to ignore longest chain an mine on a certain block ignoring everyone else on the network for some reason. One bright example of hard fork is BCash - it is a hard fork of BTC supported by number of people.

2. Soft fork is when everyone agrees to roll back or change rules starting from certain block height and changes become effective from block N, but the actual fork does not happens.


Title: Re: What is HardFork, SoftFork?
Post by: HeRetiK on March 26, 2018, 12:24:44 PM
For example if there was a soft fork to reduce the block size to 500kb from 1MB, then the old rule of 1MB blocks will become invalid,

A change of the block size can not occur in a soft fork.
A soft fork is defined by being 'compatible' with older nodes.

Bcash, for example, did simply increase the block size to 8mb. This occured in a hard fork.

Bitcoin on the other hand increased the amount which can fit into a block by introducing SegWit.
This happened through a soft fork. This works because transaction structure has changed and the witness data can be stripped off for older nodes (1MB limit).
Therefore no consensus rules get broken 'in the eyes of' older (non-updated) nodes.

Reducing the block size from 1MB to 500kb actually is an example of changing the block size using a soft fork. You can't increase the block size without a hard fork, but reducing the block size would actually work.

Why? Because blocks that would be mined under the new transaction rule (ie. blocks can't be larger than 500kb) are still valid on -- ie. compatible with -- older nodes.

That is, this new rule could be enforced without forcing legacy nodes to accept a new rule set. So if miners were to be convinced to mine 500kb blocks only, the legacy nodes would be none the wiser and just go with it. Rolling back to 1MB blocks however, would require hard fork then.


Title: Re: What is HardFork, SoftFork?
Post by: malikusama on March 27, 2018, 05:21:22 AM
You are a beginner so i will try to explain in simple words so you can easily understand.
Fork happened whenever group of miners/developers or all miners/developers on network want up-gradation or change in protocol.

The difference between Soft and hard fork is that Soft fork requires majority of the miners support/nodes for up-gradation of protocol, while hard fork requires support of all miners/nodes present on network.


Title: Re: What is HardFork, SoftFork?
Post by: Colorblind on March 27, 2018, 05:33:38 AM
You are a beginner so i will try to explain in simple words so you can easily understand.
Fork happened whenever group of miners/developers or all miners/developers on network want up-gradation or change in protocol.

The difference between Soft and hard fork is that Soft fork requires majority of the miners support/nodes for up-gradation of protocol, while hard fork requires support of all miners/nodes present on network.

Not always. Forks can (and often) appears naturally, but if there is a persistent consensus, this usually results in orphaning some blocks. This is now rarely happens with Bitcoin, but can happen very often in less difficult networks.


Title: Re: What is HardFork, SoftFork?
Post by: cellard on March 27, 2018, 05:59:41 PM
Im just looking forward to see how further soft-forks will be deployed. Segwit was one of the biggest dramas ever in cryptocurrency, and if im not mistaken, we will go through something similar too when attempts to get privacy at protocol level through soft-forks are brought up again.


Title: Re: What is HardFork, SoftFork?
Post by: bob123 on March 28, 2018, 07:18:06 AM
Im just looking forward to see how further soft-forks will be deployed. Segwit was one of the biggest dramas ever in cryptocurrency, and if im not mistaken, we will go through something similar too when attempts to get privacy at protocol level through soft-forks are brought up again.

What exactly - regarding segwit - was a drama?
I remember the segwit2x drama, where the date for the hardfork was set and then got cancelled. I think a few weeks later there still was a hard fork? I'm not sure about that.
Wasn't bcash also created because of this?

But segwit itself (soft fork) happend pretty smooth i thought? Correct me if im wrong.

I am also looking forward to the next two milestones of BTC which are the faster merkle tree (BIP98 [1]) and schnorr (BIP140 [2]), i think.
Note, that schnorr itself doesn't bring privacy into btc itself. The ability to use coinjoin with schnorr is what will be a privacy feature.


[1] https://github.com/bitcoin/bips/blob/master/bip-0098.mediawiki (https://github.com/bitcoin/bips/blob/master/bip-0098.mediawiki)
[2] https://github.com/bitcoin/bips/blob/master/bip-0140.mediawiki (https://github.com/bitcoin/bips/blob/master/bip-0140.mediawiki)


Title: Re: What is HardFork, SoftFork?
Post by: HeRetiK on March 28, 2018, 08:16:07 AM
What exactly - regarding segwit - was a drama?
I remember the segwit2x drama, where the date for the hardfork was set and then got cancelled. I think a few weeks later there still was a hard fork? I'm not sure about that.
Wasn't bcash also created because of this?

But segwit itself (soft fork) happend pretty smooth i thought? Correct me if im wrong.

Oh there was much drama. Maybe you were lucky enough to have missed most of it, but the whole blocksize debate and the Bitcoin vs Bitcoin Cash rivalry dominated most of 2017.

Just a short recap:

1) r/btc vs r/bitcoin respectively big blockers vs small blockers

2) Bitcoin XT followed by Bitcoin Classic followed by Bitcoin Unlimited ultimately leading to Bitcoin ABC / Bitcoin Cash

3) Accusations against Jihan Wu of Bitmain to blockade SegWit due to alleged usage of covert ASIC boost in their miners

4) Bitcoin Cash deployment drama (shifting dates around, opt-in 2-way replay protection vs full 2-way replay protection, last minute protocol changes leaving wallet developers scrambling)

5) NYA drama that lead to SegWit2x drama (basically r/btc vs r/bitcoin on a corporate level)

6) SegWit2x not implementing 2-way replay protection, false flag nodes, B2X futures trading...

7) "SegWit transactions are not safe because they use anyone-can-spend transactions!!!111one"

8) Hashrate oscillations between Bitcoin and Bitcoin Cash due to Bitcoin Cash's EDA (emergency difficulty adjustment)

9) Alleged spam attacks against Bitcoin leading to increased transaction fees

10) "Lightning Network leads to banking hubs!!111one"

11) Coinbase stating that they won't support Bitcoin Cash and that customers wanting their hard fork coins should withdraw their coins in advance, followed by legal threats by customers that left their coins on Coinbase after all, followed by Coinbase allowing their customers to withdraw their Bitcoin Cash in January

12) Coinbase receiving flak for their delayed SegWit integration

13) I'm sure there was more but I just realized I should get outside more


Now you might say that this was all just stuff happening in the background and has nothing to do with the SegWit soft fork itself. But no! There was this whole UASF vs UAHF thing, Bitcoin Cash moving their hard fork date up as mentioned above, miner signalling being indecisive for most of 2017... it was quite an interesting year.


Title: Re: What is HardFork, SoftFork?
Post by: cellard on March 28, 2018, 02:58:49 PM
Im just looking forward to see how further soft-forks will be deployed. Segwit was one of the biggest dramas ever in cryptocurrency, and if im not mistaken, we will go through something similar too when attempts to get privacy at protocol level through soft-forks are brought up again.

What exactly - regarding segwit - was a drama?
I remember the segwit2x drama, where the date for the hardfork was set and then got cancelled. I think a few weeks later there still was a hard fork? I'm not sure about that.
Wasn't bcash also created because of this?

But segwit itself (soft fork) happend pretty smooth i thought? Correct me if im wrong.

I am also looking forward to the next two milestones of BTC which are the faster merkle tree (BIP98 [1]) and schnorr (BIP140 [2]), i think.
Note, that schnorr itself doesn't bring privacy into btc itself. The ability to use coinjoin with schnorr is what will be a privacy feature.


[1] https://github.com/bitcoin/bips/blob/master/bip-0098.mediawiki (https://github.com/bitcoin/bips/blob/master/bip-0098.mediawiki)
[2] https://github.com/bitcoin/bips/blob/master/bip-0140.mediawiki (https://github.com/bitcoin/bips/blob/master/bip-0140.mediawiki)

Well Heretik summed the drama up pretty much. It even lead up to the BCash fork and that in itself is the manifestation of the ultimate drama, since both Bitcoin and Bcash compete for the same share of SHA256 hashrate.

As far as further soft forks bringing drama, it's clear. If they get for example privacy features proposed, we will have people wanting it, and then we will have many merchants not wanting it because governments may shut down their businesses due potential tax evasion. It's an insanely tricky situation.

Even for things that should not bring drama, you can't expect to reach a super majority. So who knows, maybe we'll have another UASF clusterfuck in the future.


Title: Re: What is HardFork, SoftFork?
Post by: spartacusrex on March 29, 2018, 06:43:06 PM
For either a Soft or Hard fork, the majority of miners need to agree.

But with a soft fork, anyone running software that DOESN'T MINE, doesn't need to update their software or change anything.

The easiest soft-fork to understand is a reduction in the block size. So .. let's say the miners decide to Halve the Block Size.

All the people running validating nodes (not miners) don't have to change their software, as the blocks are still completely valid as far as they are concerned, they are just small.


Title: Re: What is HardFork, SoftFork?
Post by: SixOfFive on March 30, 2018, 09:39:11 PM
Hardfork refers to a software change, which is not compatible with the older versions of the software. So, all the participants have to upgrade their softwares for participating in new transactions. If someone does not upgrade his softwares, he will separate from the blockchain network.
Softfork refers to that software upgrade which is compatible with the older versions. So if a participant does not upgrade his software, he will still be able to verify the transactions.


Title: Re: What is HardFork, SoftFork?
Post by: bob123 on March 30, 2018, 10:35:32 PM
For either a Soft or Hard fork, the majority of miners need to agree.

A fork occurs when nodes (not explicitely miner) disagree on whatever rule and a block is mined which does not fit both 'understandings' of consens rules.
Additionally it does not need a majority to perform a fork. One single node is enough to create a (in this case: very shitty) fork.



Title: Re: What is HardFork, SoftFork?
Post by: reflector on March 31, 2018, 09:00:33 AM
For either a Soft or Hard fork, the majority of miners need to agree.

A fork occurs when nodes (not explicitely miner) disagree on whatever rule and a block is mined which does not fit both 'understandings' of consens rules.
Additionally it does not need a majority to perform a fork. One single node is enough to create a (in this case: very shitty) fork.



Especially in the hard fork time we will find the non upgraded nodes will not be able to validate the block done by the upgraded one. but soft fork divergence in the blockchain has been occured due to non upgraded nodes and mining will be waiting its own time mate.
This is the turn leaves the upgraded node blocks are being accepted as the strongest and faithy chain of events dude.


Title: Re: What is HardFork, SoftFork?
Post by: Tynovten_ on April 02, 2018, 04:34:52 AM
Hard fork : In this type of change, will make a new feature, which was previously considered as invalid, into a block or transaction that valid. That means, in the software of Bitcoin in the previous version, a block or transaction is considered invalid, while in the new version block iconsidered to be valid.

Soft Fork : added validation rules that are strict. By limiting the set of transactions or validation blocks valid. So if on the old version will receive all the blocks, while in the new version, it might will reject some of them.


https://www.google.co.id/amp/s/edukasibitcoin.com/amp/keterbatasan-dan-pengembangan-bitcoin/


Title: Re: What is HardFork, SoftFork?
Post by: JAA37 on April 02, 2018, 03:10:22 PM
So what would be the practical implications of a soft fork then. I know when tokens or coins that i have held forked in the past i generally only hear them described as hard forks and one must have their funds in a wallet with access to the private keys. Now is this any different for the average holder during a soft fork?


Title: Re: What is HardFork, SoftFork?
Post by: HeRetiK on April 02, 2018, 09:59:01 PM
So what would be the practical implications of a soft fork then. I know when tokens or coins that i have held forked in the past i generally only hear them described as hard forks and one must have their funds in a wallet with access to the private keys. Now is this any different for the average holder during a soft fork?

You mean the practical implications of soft forks regarding free alt coins as the result of a chain split?

None.

Unless something goes horribly wrong or weird or both a soft fork will usually not come with what amounts to an airdrop for holders of the original coin. It does, however, usually come with protocol upgrades such as SegWit.