Bitcoin Forum
May 10, 2024, 05:10:07 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: How new code changes are made to the Bitcoin protocol  (Read 231 times)
brainactive (OP)
Member
**
Offline Offline

Activity: 159
Merit: 72


View Profile
July 26, 2021, 02:24:01 AM
Merited by ABCbits (1), BlackHatCoiner (1)
 #1

My high-level understanding is that if one person decides to make a malicious change to the Bitcoin software code, then others in the network will reject it.

1) How exactly does this process work? How do I submit or propose a code change?
2) And does every node need to agree with the code change for it to pass or just the majority?
1715361007
Hero Member
*
Offline Offline

Posts: 1715361007

View Profile Personal Message (Offline)

Ignore
1715361007
Reply with quote  #2

1715361007
Report to moderator
1715361007
Hero Member
*
Offline Offline

Posts: 1715361007

View Profile Personal Message (Offline)

Ignore
1715361007
Reply with quote  #2

1715361007
Report to moderator
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715361007
Hero Member
*
Offline Offline

Posts: 1715361007

View Profile Personal Message (Offline)

Ignore
1715361007
Reply with quote  #2

1715361007
Report to moderator
1715361007
Hero Member
*
Offline Offline

Posts: 1715361007

View Profile Personal Message (Offline)

Ignore
1715361007
Reply with quote  #2

1715361007
Report to moderator
1715361007
Hero Member
*
Offline Offline

Posts: 1715361007

View Profile Personal Message (Offline)

Ignore
1715361007
Reply with quote  #2

1715361007
Report to moderator
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
July 26, 2021, 02:35:13 AM
Merited by pooya87 (3), ABCbits (2), BlackHatCoiner (2)
 #2

My high-level understanding is that if one person decides to make a malicious change to the Bitcoin software code, then others in the network will reject it.
Each node in the network runs their own specific set of rules. If someone runs a node that doesn't follow those set of rules, the other nodes would consider those transactions/blocks,etc violating their set of rules and will not. Majority of the network runs the reference client (Bitcoin Core), for which the rules are defined in the client.
1) How exactly does this process work? How do I submit or propose a code change?
Most high level changes involves quite a bit of discussion either on the IRC or the mailing list. The procedure is outlined in the link below.

https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md
2) And does every node need to agree with the code change for it to pass or just the majority?
Neither. Each node runs their own set of rules. If a new protocol code change that affects compatibility with older clients is implemented, then the older clients wouldn't recognize the new rules and simply wouldn't follow them, ie. a hard fork.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

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

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

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

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

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











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
brainactive (OP)
Member
**
Offline Offline

Activity: 159
Merit: 72


View Profile
July 26, 2021, 03:58:35 AM
 #3

Majority of the network runs the reference client (Bitcoin Core), for which the rules are defined in the client.
If someone doesn't run the reference client, doesn't that make their node is useless to the network since it won't be accepted? Is running the node kind of like a voting mechanism? Just trying to understand why someone would run another client.

But miners would all run the reference client right? Otherwise they wouldn't be able to get any rewards?
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
July 26, 2021, 04:12:35 AM
Merited by ABCbits (2), BlackHatCoiner (2)
 #4

If someone doesn't run the reference client, doesn't that make their node is useless to the network since it won't be accepted?
Nodes are supposed to be enforcing Bitcoin rules not their own rules and their usefulness is about their contribution to the bitcoin network.

Quote
Is running the node kind of like a voting mechanism?
Somewhat yes.

Quote
Just trying to understand why someone would run another client.
Additional/different features.
Security.
Flexibility.
For fun!

Quote
But miners would all run the reference client right? Otherwise they wouldn't be able to get any rewards?
No and no.
Most miners run a modified version of the reference implementation to satisfy their needs. And I strongly believe some of them run multiple software to avoid running into issues such as these [1] [2], that's the "security" reason I mentioned above.
As for the reward, miner will get the reward if their block is valid, it doesn't matter how they mined it.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
caryoscar
Member
**
Offline Offline

Activity: 63
Merit: 12


View Profile
July 26, 2021, 08:13:45 AM
Merited by Symmetrick (3), PrimeNumber7 (1)
 #5


1.As far as I know, if the Bitcoin protocol is changed through the code, a fork will be formed. It is a very complicated project from idea proposal, to community discussion, to code design, to publicity and promotion, to deployment by miners and users. Very difficult.

2.Bitcoin's code is open source, and GITHUP will be released. High-level programmers saw this bitcoin code repository, copied it to form a branch, added the features they wanted to the branch, and submitted an application to the main code manager (Pull request). The programmer applied to merge his modified part into the main code repository. If it passes, he will merge this part of the code into the main code base (merge)

3.Finally, after everyone’s discussion and unanimous approval, everyone can install a version of the Bitcoin software or install a compatible version. Then the Bitcoin fork is successfully completed, and the Bitcoin network will be upgraded to the new version.


This is my simple understanding of the Bitcoin protocol change. I don't know if it is accurate. Because I am not a technical talent, I can only describe it to you in simple words. I hope it will be helpful to you. I know that every fork is a heated debate. Bitcoin itself is a great experiment.

brainactive (OP)
Member
**
Offline Offline

Activity: 159
Merit: 72


View Profile
July 26, 2021, 10:00:15 AM
 #6

If someone doesn't run the reference client, doesn't that make their node is useless to the network since it won't be accepted?
Nodes are supposed to be enforcing Bitcoin rules not their own rules and their usefulness is about their contribution to the bitcoin network.
Say for example, the network only has 3 nodes (A, B and C).

A and B are running reference client and C is running some other client.

If the next block comes in and the rules based on the reference client accepts the block (A and B accept), but the other client rejects the block (C rejects), then what happens to the block? And what happens to nodes A, B and C? 
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
July 26, 2021, 11:23:00 AM
Merited by pooya87 (2)
 #7

If the next block comes in and the rules based on the reference client accepts the block (A and B accept), but the other client rejects the block (C rejects), then what happens to the block? And what happens to nodes A, B and C? 
Nodes A and B continues on the chain that includes that block.

Node C does not accept that block and treats it as invalid. It is thus -1 block Nodes A and B. Node C will not continue until a new block that is compliant with their rule continues on that height in their chain. Even if subsequent blocks built ontop of the rejected block were somehow compliant with the rules of node A, B and C, only Nodes A and B will accept that block for obvious reasons, a continuation of the block that is deemed invalid by C.

A more relevant example would be to think of realistic hard forks. In a hypothetical scenario that we were to increase the raw block size to 8MB today, assuming nodes A and B upgrades and are aware of the new rules. If an 8MB block were to be mined, nodes A and B accepts it because they know that 8MB blocks are valid while node C doesn't. Node A and B expects an additional block that references that 8MB block while node C awaits for a block at that height which isn't more than 8MB.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

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

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

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

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

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











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
July 26, 2021, 12:07:34 PM
 #8

Say for example, the network only has 3 nodes (A, B and C).

A and B are running reference client and C is running some other client.

If the next block comes in and the rules based on the reference client accepts the block (A and B accept), but the other client rejects the block (C rejects), then what happens to the block? And what happens to nodes A, B and C? 
This is tricky to answer because it doesn't clarify why node C rejected that block and more importantly was the rejected block valid or not?

For example if we had a node of type C back in 2010 (the overflow case I posted above) that would have meant detection of the chain split right away by anyone running both client types (such as a miner) and they could have potentially avoided building on top of the invalid chain in first place. More importantly someone could build a valid chain while nodes A and B continued building on an invalid chain.

And @ranochigo covered the rest.

The reference client (Bitcoin Core) no longer have feature to perform mining.
It does have mining capabilities, in fact it makes no sense for a "full" node to not have such a feature. Also without it testnet and regtest would not be possible.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
brainactive (OP)
Member
**
Offline Offline

Activity: 159
Merit: 72


View Profile
July 26, 2021, 12:51:05 PM
 #9

If the next block comes in and the rules based on the reference client accepts the block (A and B accept), but the other client rejects the block (C rejects), then what happens to the block? And what happens to nodes A, B and C?  
Nodes A and B continues on the chain that includes that block.

Node C does not accept that block and treats it as invalid. It is thus -1 block Nodes A and B. Node C will not continue until a new block that is compliant with their rule continues on that height in their chain. Even if subsequent blocks built ontop of the rejected block were somehow compliant with the rules of node A, B and C, only Nodes A and B will accept that block for obvious reasons, a continuation of the block that is deemed invalid by
Doesn't that mean potentially all nodes on the network have their own chains (in the simplified example A and B have different chains to C)? I thought the idea of Bitcoin is every node shares the same ledger of transactions?
BlackHatCoiner
Legendary
*
Online Online

Activity: 1512
Merit: 7359


Farewell, Leo


View Profile
July 26, 2021, 01:51:53 PM
 #10

I thought the idea of Bitcoin is every node shares the same ledger of transactions?
The idea of Bitcoin is to verify the ledger you keep which is made up from others' work, who made their own decisions, but they each make the same decisions as one another. In the example above, the nodes run make different decisions which means that there's no consensus.

The C node would consider the overflow incident block valid, while the other two wouldn't. It'd require a hard fork to finalize what they'll agree upon.

The reference client (Bitcoin Core) no longer have feature to perform mining.
What? My generatetoaddress works fine.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

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

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

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

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

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











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether
Legendary
*
Offline Offline

Activity: 1596
Merit: 6735


bitcoincleanup.com / bitmixlist.org


View Profile WWW
July 26, 2021, 02:11:19 PM
 #11

The reference client (Bitcoin Core) no longer have feature to perform mining.
What? My generatetoaddress works fine.

The generatetoaddress RPC call is still there but it's completely useless on mainnet or testnet since it's hashrate is very tiny, you can only really use it on regtest which has a very small difficulty.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
ranochigo
Legendary
*
Offline Offline

Activity: 2968
Merit: 4177



View Profile
July 26, 2021, 02:50:50 PM
Last edit: July 27, 2021, 05:05:47 AM by ranochigo
 #12

The generatetoaddress RPC call is still there but it's completely useless on mainnet or testnet since it's hashrate is very tiny, you can only really use it on regtest which has a very small difficulty.
Generatetoaddress does not work on mainnet or testnet at all, not just useless.

The mining component has been deprecated for quite a while now.


Corrected below. I might've remembered wrongly but I thought they completely removed the mining logic related to mainnet and testnet in 0.13.0. Anyways, the max tries has to be changed to get any hash with a decent difficulty.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

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

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

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

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

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











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
July 26, 2021, 05:16:35 PM
 #13

If the next block comes in and the rules based on the reference client accepts the block (A and B accept), but the other client rejects the block (C rejects), then what happens to the block? And what happens to nodes A, B and C? 
Nodes A and B continues on the chain that includes that block.

Node C does not accept that block and treats it as invalid. It is thus -1 block Nodes A and B. Node C will not continue until a new block that is compliant with their rule continues on that height in their chain. Even if subsequent blocks built ontop of the rejected block were somehow compliant with the rules of node A, B and C, only Nodes A and B will accept that block for obvious reasons, a continuation of the block that is deemed invalid by
Doesn't that mean potentially all nodes on the network have their own chains (in the simplified example A and B have different chains to C)? I thought the idea of Bitcoin is every node shares the same ledger of transactions?
Bitcoin uses consensus to determine which rules to follow, which also tells nodes which chain to follow, what transactions and blocks to accept. As long as your node is following consensus rules, and has the ability to communicate with other nodes that follow the same consensus rules, it will be on the same blockchain as the rest of the network. 
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10558



View Profile
July 27, 2021, 02:06:58 AM
Merited by ABCbits (1)
 #14

I know there's mining feature on both testnet and regtest, but i'm talking about mainnet.
To be honest I haven't checked it myself but I'm referring to this reply from Pieter Wuille saying generatetoaddress can still work for mining mainnet blocks. https://bitcoin.stackexchange.com/questions/106537/is-it-possible-not-feasible-to-mine-bitcoins-with-bitcoin-core-v0-21-1

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
garlonicon
Hero Member
*****
Offline Offline

Activity: 804
Merit: 1932


View Profile
July 27, 2021, 04:16:13 AM
 #15

Quote
generatetoaddress can still work for mining mainnet blocks
Yes, it still can, even in the newest Bitcoin Core. You can still run some node offline, don't synchronize it, and mine some blocks after the Genesis Block to see how it works.
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!