brainactive (OP)
Member
Offline
Activity: 159
Merit: 72
|
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?
|
|
|
|
ranochigo
Legendary
Offline
Activity: 3052
Merit: 4443
Crypto Swap Exchange
|
|
July 26, 2021, 02:35:13 AM |
|
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.md2) 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.
|
|
|
|
brainactive (OP)
Member
Offline
Activity: 159
Merit: 72
|
|
July 26, 2021, 03:58:35 AM |
|
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
Activity: 3668
Merit: 11107
Crypto Swap Exchange
|
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. Is running the node kind of like a voting mechanism?
Somewhat yes. Just trying to understand why someone would run another client.
Additional/different features. Security. Flexibility. For fun! 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.
|
|
|
|
caryoscar
Member
Offline
Activity: 63
Merit: 12
|
|
July 26, 2021, 08:13:45 AM |
|
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
Activity: 159
Merit: 72
|
|
July 26, 2021, 10:00:15 AM |
|
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
Activity: 3052
Merit: 4443
Crypto Swap Exchange
|
|
July 26, 2021, 11:23:00 AM |
|
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.
|
|
|
|
pooya87
Legendary
Offline
Activity: 3668
Merit: 11107
Crypto Swap Exchange
|
|
July 26, 2021, 12:07:34 PM |
|
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.
|
|
|
|
brainactive (OP)
Member
Offline
Activity: 159
Merit: 72
|
|
July 26, 2021, 12:51:05 PM |
|
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
Offline
Activity: 1736
Merit: 8451
Fiatheist
|
|
July 26, 2021, 01:51:53 PM |
|
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.
|
|
|
|
NotATether
Legendary
Offline
Activity: 1820
Merit: 7476
Top Crypto Casino
|
|
July 26, 2021, 02:11:19 PM |
|
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.
|
|
|
|
ranochigo
Legendary
Offline
Activity: 3052
Merit: 4443
Crypto Swap Exchange
|
|
July 26, 2021, 02:50:50 PM Last edit: July 27, 2021, 05:05:47 AM by ranochigo |
|
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.
|
|
|
|
PrimeNumber7
Copper Member
Legendary
Offline
Activity: 1666
Merit: 1901
Amazon Prime Member #7
|
|
July 26, 2021, 05:16:35 PM |
|
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.
|
|
|
|
|
garlonicon
Copper Member
Legendary
Offline
Activity: 938
Merit: 2231
|
|
July 27, 2021, 04:16:13 AM |
|
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.
|
|
|
|
|