colinistheman (OP)
|
|
February 04, 2015, 08:05:00 PM Last edit: February 05, 2015, 07:47:19 PM by colinistheman |
|
Hi, I was wondering if anyone can describe what a soft fork is and how it is implemented, in a very easy-to-understand way? I know what a hard fork is. That's where you modify the source code and get more than 50% of the nodes to adopt it. Usually the code is set to begin running at a particular block number. How does this differ from a soft fork? I found the wikipedia entry but didn't quite grasp it. Adam Back and Gregory Maxwell (gmaxwell) are talking about it in this fairly technical video about side chains and I want to understand what he's talking about.
|
|
|
|
unamis76
Legendary
Offline
Activity: 1512
Merit: 1012
|
|
February 04, 2015, 09:13:44 PM |
|
|
|
|
|
gmaxwell
Moderator
Legendary
Online
Activity: 4298
Merit: 8818
|
|
February 04, 2015, 11:00:00 PM |
|
Hi, I was wondering if anyone can describe what a soft fork is and how it is implemented, in a very easy-to-understand way? I know what a hard fork is. That's where you modify the source code and get more than 50% of the nodes to adopt it.
This is incorrect in that a hard fork with just 50% is a system failure, the network would split... and coins could be spent twice (on each new network). A working hardfork needs an overwhelming support of ~all the participants, and everyone else just isn't a participant anymore. How does this differ from a soft fork? Does a soft fork require modifying the bitcoin source code, or only the clients? I'm not sure what you think is the difference between "the bitcoin source code, or only the clients". Bitcoin clients are the network, and they're all software. A soft fork is a change to the rules enforced in the blockchain which is a strict narrowing. Nothing previously invalid becomes permitted, but blocks/transactions which were previously valid may be denied. This is more powerful than you might guess at first blush because Bitcoin was designed to be forward extendable and there are many conditions where you can create transactions which say "do nothing, anyone can spend" but a later soft-fork can carve a new feature out of that. E.g. a whole new script system can be introduced in this way (and we more or less did with BIP16), it just has to look like "anyone can spend" to old nodes. Think those 'anyone can spend' parts as blocks of marble where new features can be chiseled out of them.
|
|
|
|
jl2012
Legendary
Offline
Activity: 1792
Merit: 1111
|
|
February 05, 2015, 04:25:23 AM |
|
Some comparisons: Hardfork is making some invalid transactions valid Softfork is making some valid transactions invalid Hardfork requires the consensus of vast majority of miners, users, and merchants Softfork requires the consensus of vast majority of miners, but not necessarily non-mining users and merchants Hardfork can change any rules in the protocol or implement any new rules Softfork is usually less powerful (with a trick which I call "Aux block", a softfork could also be very powerful: https://bitcointalk.org/index.php?topic=283746.0)
|
Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY) LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC) PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
|
|
|
colinistheman (OP)
|
|
February 05, 2015, 05:24:56 AM Last edit: February 05, 2015, 07:47:59 PM by colinistheman |
|
Hi, I was wondering if anyone can describe what a soft fork is and how it is implemented, in a very easy-to-understand way? I know what a hard fork is. That's where you modify the source code and get more than 50% of the nodes to adopt it.
This is incorrect in that a hard fork with just 50% is a system failure, the network would split... and coins could be spent twice (on each new network). A working hardfork needs an overwhelming support of ~all the participants, and everyone else just isn't a participant anymore. Yes, of course. I did say "more than 50%", not "just 50%". And yes, considerably more than 50% is best/important. How does this differ from a soft fork? Does a soft fork require modifying the bitcoin source code, or only the clients? I'm not sure what you think is the difference between "the bitcoin source code, or only the clients". Bitcoin clients are the network, and they're all software. A soft fork is a change to the rules enforced in the blockchain which is a strict narrowing. Nothing previously invalid becomes permitted, but blocks/transactions which were previously valid may be denied. This is more powerful than you might guess at first blush because Bitcoin was designed to be forward extendable and there are many conditions where you can create transactions which say "do nothing, anyone can spend" but a later soft-fork can carve a new feature out of that. E.g. a whole new script system can be introduced in this way (and we more or less did with BIP16), it just has to look like "anyone can spend" to old nodes. Think those 'anyone can spend' parts as blocks of marble where new features can be chiseled out of them. Thanks. A soft fork is quite a concept to grasp for a new person.
|
|
|
|
colinistheman (OP)
|
|
February 05, 2015, 05:27:04 AM |
|
Some comparisons: Hardfork is making some invalid transactions valid Softfork is making some valid transactions invalid Hardfork requires the consensus of vast majority of miners, users, and merchants Softfork requires the consensus of vast majority of miners, but not necessarily non-mining users and merchants Hardfork can change any rules in the protocol or implement any new rules Softfork is usually less powerful (with a trick which I call "Aux block", a softfork could also be very powerful: https://bitcointalk.org/index.php?topic=283746.0) Thank you for the comparison! This was very helpful. Are a hard fork and soft fork implemented in different ways? Like are you editing the same code in both fork types?
|
|
|
|
Rannasha
|
|
February 05, 2015, 06:24:04 AM |
|
Some comparisons: Hardfork is making some invalid transactions valid Softfork is making some valid transactions invalid Hardfork requires the consensus of vast majority of miners, users, and merchants Softfork requires the consensus of vast majority of miners, but not necessarily non-mining users and merchants Hardfork can change any rules in the protocol or implement any new rules Softfork is usually less powerful (with a trick which I call "Aux block", a softfork could also be very powerful: https://bitcointalk.org/index.php?topic=283746.0) Thank you for the comparison! This was very helpful. Are a hard fork and soft fork implemented in different ways? Like are you editing the same code in both fork types? Every change requires editing the code. What you change to the code will determine whether the new version will force a soft fork, a hard fork or no fork at all. You could edit the maximum allowed block size in the code. Change it to 100 KB and it'll be a soft fork, change it to 100 MB and it'll be a hard fork.
|
|
|
|
jl2012
Legendary
Offline
Activity: 1792
Merit: 1111
|
|
February 05, 2015, 06:28:42 AM |
|
You could edit the maximum allowed block size in the code. Change it to 100 KB and it'll be a soft fork, change it to 100 MB and it'll be a hard fork.
Good example. Changing the max block size from 1MB to 0.1MB is a softfork, because it makes previously valid blocks (0.1MB-1MB) invalid. Changing the max block size from 1MB to 10MB is a hardfork, because it makes previously invalid blocks (1MB-10MB) valid.
|
Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY) LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC) PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
|
|
|
readerbtc
Jr. Member
Offline
Activity: 54
Merit: 1
|
|
February 05, 2015, 06:11:19 PM |
|
You could edit the maximum allowed block size in the code. Change it to 100 KB and it'll be a soft fork, change it to 100 MB and it'll be a hard fork.
Good example. Changing the max block size from 1MB to 0.1MB is a softfork, because it makes previously valid blocks (0.1MB-1MB) invalid. I think changing the max block size from 1MB to 0.1MB is a hard fork, actually. Miners that don't upgrade will generate one 1MB and those won't be accepted but the upgraded clients, forking the blockchain. A soft fork would be changing the max block size one produces from 1MB to 0.1MB, while leaving the max block size one accepts unchanged. Or am I wrong? #sincerequestion
|
|
|
|
swapcoiner
Member
Offline
Activity: 93
Merit: 10
|
|
February 05, 2015, 06:28:06 PM |
|
Soft fork is just a bypass. Such fork is needed but doesn't harm the network.
|
|
|
|
johoe
|
|
February 05, 2015, 10:23:19 PM |
|
Changing the max block size from 1MB to 0.1MB is a softfork, because it makes previously valid blocks (0.1MB-1MB) invalid.
I think changing the max block size from 1MB to 0.1MB is a hard fork, actually. Miners that don't upgrade will generate one 1MB and those won't be accepted but the upgraded clients, forking the blockchain. A soft fork would be changing the max block size one produces from 1MB to 0.1MB, while leaving the max block size one accepts unchanged. Or am I wrong? #sincerequestion Sorry, but you are wrong. Changing max block size to 0.1MB is a soft fork. A soft fork only works if the majority of miners agree, in which case all miners accept the shorter blocks and the minority that produces larger blocks will be ignored. If you do a soft fork only yourself, you are on a short chain and the longest chain will still contain large blocks. It is similar to a hard fork where you are the only one who hasn't upgraded. Changing the max block size you produce from 1MB to 0.1MB is not a fork at all. You still accept the large blocks of other miners and other miners will accept your block.
|
Donations to 1CF62UFWXiKqFUmgQMUby9DpEW5LXjypU3
|
|
|
jl2012
Legendary
Offline
Activity: 1792
Merit: 1111
|
|
February 06, 2015, 04:19:17 AM |
|
You could edit the maximum allowed block size in the code. Change it to 100 KB and it'll be a soft fork, change it to 100 MB and it'll be a hard fork.
Good example. Changing the max block size from 1MB to 0.1MB is a softfork, because it makes previously valid blocks (0.1MB-1MB) invalid. I think changing the max block size from 1MB to 0.1MB is a hard fork, actually. Miners that don't upgrade will generate one 1MB and those won't be accepted but the upgraded clients, forking the blockchain. A soft fork would be changing the max block size one produces from 1MB to 0.1MB, while leaving the max block size one accepts unchanged.Or am I wrong? #sincerequestion People are ALREADY doing this and as johoe explains this is not a fork. A fork, soft or hard, must involve a rule change in the validity of transactions/blocks.
|
Donation address: 374iXxS4BuqFHsEwwxUuH3nvJ69Y7Hqur3 (Bitcoin ONLY) LRDGENPLYrcTRssGoZrsCT1hngaH3BVkM4 (LTC) PGP: D3CC 1772 8600 5BB8 FF67 3294 C524 2A1A B393 6517
|
|
|
readerbtc
Jr. Member
Offline
Activity: 54
Merit: 1
|
|
February 06, 2015, 12:11:07 PM |
|
Thanks.
|
|
|
|
|
|