Author

Topic: Bitcoin Consensus Process (step-by-step). Feedback is welcome. (Read 231 times)

newbie
Activity: 2
Merit: 0
Thanks for all of you HeRetiK, YarkoL and DooMAD. Your comments were very useful.
I updated my first message. I would be grateful if you could review it.

Additional question.
Did Ethereum without Casper have the same consensus process as Bitcoin or it is different?
And did you know how consensus process would work for Ethereum with Casper?
legendary
Activity: 3948
Merit: 3191
Leave no FUD unchallenged
If you're going to expand on point 6, then point 8 might deserve a little bit more detail too.  I'd personally use "validate" in place of "review" for that one.  You'll probably find this page helpful in seeing just how much is involved when it comes to validation of a block.
legendary
Activity: 996
Merit: 1013
As pointed out by HeReTik, there are no balances. The nodes verify that the signed input
is unspent and corresponds to the private key that controls the amount sent.

Also, the steps outlined in 6 come logically before 5, since the set of transactions included
in the candidate block determine the Merkle root in the header, which again is hashed with the
rest of the block header in the process of mining.
legendary
Activity: 3192
Merit: 2248
Top-tier crypto casino and sportsbook
2.   Node checks account balance and accepts or rejects a transaction.

There's no accounts and no account balance in Bitcoin. There's only inputs and outputs. Each node checks whether the inputs used for the outputs are unspent and whether the total sum of inputs is larger than or equal to the total sum of outputs (with the remainder being used as transaction fees).


5.   Nodes are solving a mathematical puzzle (mining) approximately for 10 minutes. This process takes enormous resources of electricity.
6.   Winner Node (miner) or Pool of Nodes (mining pool) who solves the puzzle first. More than 75% of mining power controls 7 mining pools.
      6.1.   Node takes transactions from its memory. Node takes transactions at its discretion, usually transactions that pay the highest fees.
      6.2.   Node puts transactions into order. Node orders transactions at its discretion.
      6.3.   Node creates the block and the time stamp. Node creates the time stamp at its discretion.
      6.4.   Node puts ordered transactions into a newly created block.

From the outside there's no difference between a single miner and a pool of miners. For their peers both look like a single node.

Solving the "mathematical puzzle" is not a separate process from building blocks. The cryptographic hash used as "mathematical puzzle" is used to essentially "seal" a block of transactions and its contents, with the solution being dependent on the contents of each block (which means the transactions need to be added to the block before the hash is applied, otherwise you get an empty block -- which also happens sometimes).

The 10 minute block intervals are achieved by adjusting the difficulty of the "mathematical puzzle" to a level that the whole network needs on average 10 minutes to find the correct solution (ie. an individual node doesn't care how long it mines, it just mines).

The order of transactions within a block is more or less irrelevant -- the hash would look different, but it's the order of the blocks on the blockchain that determines the transaction order.


There's a bit more to it but these are some of the more important points that are commonly misunderstood.
newbie
Activity: 2
Merit: 0
Hello,  Smiley

I am working on step by step Bitcoin Consensus Process and would love to get some feedback on this work Roll Eyes. Thanks in advance for your thoughtful comments Wink.


Update,
Version #2
Bitcoin Consensus Process

1. Wallet sends a transaction to the Node.
2. Nodes validate the transaction.
3. Nodes propagate transaction through the network.
4. Nodes are holding not confirmed transactions in their memory (mempool).
5. Nodes are solving a mathematical puzzle in order to create the block (mining).
6. Node who solves the puzzle first propagates new block through the network.
7. Nodes validate newly received Block.
8. Nodes add a newly received block to their local Blockchain.

Commentary
- To solve the puzzle (mining) takes approximately 10 minutes of computation.
- Mining process uses extensive resources of electricity. Economical factors force miners to concentrate in regions where electricity is cheaper.
- More than 75% of mining power controls 7 mining pools.
- Nodes choose what transactions to add to the block at its discretion. Usually, nodes add only transactions that pay the highest fees.
- Nodes determine transactions order in the block at its discretion.
- Nodes determine the time stamp of the block at its discretion.



Version #1
Bitcoin Consensus Process
1.   Wallet sends a transaction to the Node.
2.   Node checks account balance and accepts or rejects a transaction.
3.   Nodes gossips transaction through the network.
4.   Nodes are holding not confirmed transactions in their memory (mempool).
5.   Nodes are solving a mathematical puzzle (mining) approximately for 10 minutes. This process takes enormous resources of electricity.
6.   Winner Node (miner) or Pool of Nodes (mining pool) who solves the puzzle first. More than 75% of mining power controls 7 mining pools.
      6.1.   Node takes transactions from its memory. Node takes transactions at its discretion, usually transactions that pay the highest fees.
      6.2.   Node puts transactions into order. Node orders transactions at its discretion.
      6.3.   Node creates the block and the time stamp. Node creates the time stamp at its discretion.
      6.4.   Node puts ordered transactions into a newly created block.
7.   Nodes gossips new block through the network.
8.   Nodes review newly received Block and accepts or rejects it.
9.   Nodes add a newly accepted block to their local Blockchain.
Jump to: