Bitcoin Forum
April 23, 2024, 08:12:42 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What is a Bitcoin soft fork? (in laymen's terms)  (Read 1730 times)
colinistheman (OP)
Hero Member
*****
Offline Offline

Activity: 872
Merit: 1003



View Profile
February 04, 2015, 08:05:00 PM
Last edit: February 05, 2015, 07:47:19 PM by colinistheman
 #1

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.




.
.BIG WINNER!.
[15.00000000 BTC]


▄████████████████████▄
██████████████████████
██████████▀▀██████████
█████████░░░░█████████
██████████▄▄██████████
███████▀▀████▀▀███████
██████░░░░██░░░░██████
███████▄▄████▄▄███████
████▀▀████▀▀████▀▀████
███░░░░██░░░░██░░░░███
████▄▄████▄▄████▄▄████
██████████████████████

▀████████████████████▀
▄████████████████████▄
██████████████████████
█████▀▀█▀▀▀▀▀▀██▀▀████
█████░░░░░░░░░░░░░████
█████░░░░░░░░░░░░▄████
█████░░▄███▄░░░░██████
█████▄▄███▀░░░░▄██████
█████████░░░░░░███████
████████░░░░░░░███████
███████░░░░░░░░███████
███████▄▄▄▄▄▄▄▄███████

██████████████████████
▀████████████████████▀
▄████████████████████▄
███████████████▀▀▀▀▀▀▀
███████████▀▀▄▄█░░░░░█
█████████▀░░█████░░░░█
███████▀░░░░░████▀░░░▀
██████░░░░░░░░▀▄▄█████
█████░▄░░░░░▄██████▀▀█
████░████▄░███████░░░░
███░█████░█████████░░█
███░░░▀█░██████████░░█
███░░░░░░████▀▀██▀░░░░
███░░░░░░███░░░░░░░░░░

██░▄▄▄▄░████▄▄██▄░░░░
████████████▀▀▀▀▀▀▀██
█████████████░█▀▀▀█░███
██████████▀▀░█▀░░░▀█░▀▀
███████▀░▄▄█░█░░░░░█░█▄
████▀░▄▄████░▀█░░░█▀░██
███░▄████▀▀░▄░▀█░█▀░▄░▀
█▀░███▀▀▀░░███░▀█▀░███░
▀░███▀░░░░░████▄░▄████░
░███▀░░░░░░░█████████░░
░███░░░░░░░░░███████░░░
███▀░██░░░░░░▀░▄▄▄░▀░░░
███░██████▄▄░▄█████▄░▄▄

██░████████░███████░█
▄████████████████████▄
████████▀▀░░░▀▀███████
███▀▀░░░░░▄▄▄░░░░▀▀▀██
██░▀▀▄▄░░░▀▀▀░░░▄▄▀▀██
██░▄▄░░▀▀▄▄░▄▄▀▀░░░░██
██░▀▀░░░░░░█░░░░░██░██
██░░░▄▄░░░░█░██░░░░░██
██░░░▀▀░░░░█░░░░░░░░██
██░░░░░▄▄░░█░░░░░██░██
██▄░░░░▀▀░░█░██░░░░░██
█████▄▄░░░░█░░░░▄▄████
█████████▄▄█▄▄████████

▀████████████████████▀




Rainbot
Daily Quests
Faucet
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1713859962
Hero Member
*
Offline Offline

Posts: 1713859962

View Profile Personal Message (Offline)

Ignore
1713859962
Reply with quote  #2

1713859962
Report to moderator
1713859962
Hero Member
*
Offline Offline

Posts: 1713859962

View Profile Personal Message (Offline)

Ignore
1713859962
Reply with quote  #2

1713859962
Report to moderator
unamis76
Legendary
*
Offline Offline

Activity: 1512
Merit: 1005


View Profile
February 04, 2015, 09:13:44 PM
 #2

Soft forks are used to restrict block rules, so to speak... Smiley This is better explained here https://en.bitcoin.it/wiki/Softfork and here http://bitcoin.stackexchange.com/questions/30817/what-is-a-soft-fork Smiley
gmaxwell
Moderator
Legendary
*
expert
Offline Offline

Activity: 4158
Merit: 8382



View Profile WWW
February 04, 2015, 11:00:00 PM
 #3

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.

Quote
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 Offline

Activity: 1792
Merit: 1092


View Profile
February 05, 2015, 04:25:23 AM
 #4

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)
Hero Member
*****
Offline Offline

Activity: 872
Merit: 1003



View Profile
February 05, 2015, 05:24:56 AM
Last edit: February 05, 2015, 07:47:59 PM by colinistheman
 #5

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.


Quote
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.



.
.BIG WINNER!.
[15.00000000 BTC]


▄████████████████████▄
██████████████████████
██████████▀▀██████████
█████████░░░░█████████
██████████▄▄██████████
███████▀▀████▀▀███████
██████░░░░██░░░░██████
███████▄▄████▄▄███████
████▀▀████▀▀████▀▀████
███░░░░██░░░░██░░░░███
████▄▄████▄▄████▄▄████
██████████████████████

▀████████████████████▀
▄████████████████████▄
██████████████████████
█████▀▀█▀▀▀▀▀▀██▀▀████
█████░░░░░░░░░░░░░████
█████░░░░░░░░░░░░▄████
█████░░▄███▄░░░░██████
█████▄▄███▀░░░░▄██████
█████████░░░░░░███████
████████░░░░░░░███████
███████░░░░░░░░███████
███████▄▄▄▄▄▄▄▄███████

██████████████████████
▀████████████████████▀
▄████████████████████▄
███████████████▀▀▀▀▀▀▀
███████████▀▀▄▄█░░░░░█
█████████▀░░█████░░░░█
███████▀░░░░░████▀░░░▀
██████░░░░░░░░▀▄▄█████
█████░▄░░░░░▄██████▀▀█
████░████▄░███████░░░░
███░█████░█████████░░█
███░░░▀█░██████████░░█
███░░░░░░████▀▀██▀░░░░
███░░░░░░███░░░░░░░░░░

██░▄▄▄▄░████▄▄██▄░░░░
████████████▀▀▀▀▀▀▀██
█████████████░█▀▀▀█░███
██████████▀▀░█▀░░░▀█░▀▀
███████▀░▄▄█░█░░░░░█░█▄
████▀░▄▄████░▀█░░░█▀░██
███░▄████▀▀░▄░▀█░█▀░▄░▀
█▀░███▀▀▀░░███░▀█▀░███░
▀░███▀░░░░░████▄░▄████░
░███▀░░░░░░░█████████░░
░███░░░░░░░░░███████░░░
███▀░██░░░░░░▀░▄▄▄░▀░░░
███░██████▄▄░▄█████▄░▄▄

██░████████░███████░█
▄████████████████████▄
████████▀▀░░░▀▀███████
███▀▀░░░░░▄▄▄░░░░▀▀▀██
██░▀▀▄▄░░░▀▀▀░░░▄▄▀▀██
██░▄▄░░▀▀▄▄░▄▄▀▀░░░░██
██░▀▀░░░░░░█░░░░░██░██
██░░░▄▄░░░░█░██░░░░░██
██░░░▀▀░░░░█░░░░░░░░██
██░░░░░▄▄░░█░░░░░██░██
██▄░░░░▀▀░░█░██░░░░░██
█████▄▄░░░░█░░░░▄▄████
█████████▄▄█▄▄████████

▀████████████████████▀




Rainbot
Daily Quests
Faucet
colinistheman (OP)
Hero Member
*****
Offline Offline

Activity: 872
Merit: 1003



View Profile
February 05, 2015, 05:27:04 AM
 #6

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?



.
.BIG WINNER!.
[15.00000000 BTC]


▄████████████████████▄
██████████████████████
██████████▀▀██████████
█████████░░░░█████████
██████████▄▄██████████
███████▀▀████▀▀███████
██████░░░░██░░░░██████
███████▄▄████▄▄███████
████▀▀████▀▀████▀▀████
███░░░░██░░░░██░░░░███
████▄▄████▄▄████▄▄████
██████████████████████

▀████████████████████▀
▄████████████████████▄
██████████████████████
█████▀▀█▀▀▀▀▀▀██▀▀████
█████░░░░░░░░░░░░░████
█████░░░░░░░░░░░░▄████
█████░░▄███▄░░░░██████
█████▄▄███▀░░░░▄██████
█████████░░░░░░███████
████████░░░░░░░███████
███████░░░░░░░░███████
███████▄▄▄▄▄▄▄▄███████

██████████████████████
▀████████████████████▀
▄████████████████████▄
███████████████▀▀▀▀▀▀▀
███████████▀▀▄▄█░░░░░█
█████████▀░░█████░░░░█
███████▀░░░░░████▀░░░▀
██████░░░░░░░░▀▄▄█████
█████░▄░░░░░▄██████▀▀█
████░████▄░███████░░░░
███░█████░█████████░░█
███░░░▀█░██████████░░█
███░░░░░░████▀▀██▀░░░░
███░░░░░░███░░░░░░░░░░

██░▄▄▄▄░████▄▄██▄░░░░
████████████▀▀▀▀▀▀▀██
█████████████░█▀▀▀█░███
██████████▀▀░█▀░░░▀█░▀▀
███████▀░▄▄█░█░░░░░█░█▄
████▀░▄▄████░▀█░░░█▀░██
███░▄████▀▀░▄░▀█░█▀░▄░▀
█▀░███▀▀▀░░███░▀█▀░███░
▀░███▀░░░░░████▄░▄████░
░███▀░░░░░░░█████████░░
░███░░░░░░░░░███████░░░
███▀░██░░░░░░▀░▄▄▄░▀░░░
███░██████▄▄░▄█████▄░▄▄

██░████████░███████░█
▄████████████████████▄
████████▀▀░░░▀▀███████
███▀▀░░░░░▄▄▄░░░░▀▀▀██
██░▀▀▄▄░░░▀▀▀░░░▄▄▀▀██
██░▄▄░░▀▀▄▄░▄▄▀▀░░░░██
██░▀▀░░░░░░█░░░░░██░██
██░░░▄▄░░░░█░██░░░░░██
██░░░▀▀░░░░█░░░░░░░░██
██░░░░░▄▄░░█░░░░░██░██
██▄░░░░▀▀░░█░██░░░░░██
█████▄▄░░░░█░░░░▄▄████
█████████▄▄█▄▄████████

▀████████████████████▀




Rainbot
Daily Quests
Faucet
Rannasha
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


View Profile
February 05, 2015, 06:24:04 AM
 #7

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 Offline

Activity: 1792
Merit: 1092


View Profile
February 05, 2015, 06:28:42 AM
 #8


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 Offline

Activity: 54
Merit: 1


View Profile
February 05, 2015, 06:11:19 PM
 #9


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 Offline

Activity: 93
Merit: 10


View Profile
February 05, 2015, 06:28:06 PM
 #10

Soft fork is just a bypass. Such fork is needed but doesn't harm the network.
johoe
Full Member
***
Offline Offline

Activity: 217
Merit: 238


View Profile
February 05, 2015, 10:23:19 PM
 #11

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 Offline

Activity: 1792
Merit: 1092


View Profile
February 06, 2015, 04:19:17 AM
 #12


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 Offline

Activity: 54
Merit: 1


View Profile
February 06, 2015, 12:11:07 PM
 #13

Thanks.
instagibbs
Member
**
Offline Offline

Activity: 114
Merit: 12


View Profile
February 06, 2015, 02:06:50 PM
 #14

https://bitcoin.org/en/developer-guide#consensus-rule-changes 

bitcoin.org documentation explains it quite nicely.

I am also writing up a blog post Soon^TM to rephrase and give some history.
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!