I just need a little clarity on the mempool transactions. If a transaction is already verified wouldn't it be automatically added to the previously hashed block what other confirmation is actually needed if the nodes on the network has already verified the transaction I got confused with the concept so I decided to do a share here to get more clearity. Who else is responsible for the confirmation since the nodes has done the verification already?
Verification and confirmation solve 2 different problems in a decentralized distributed system.
Problem 1: What if someone tries to create a transaction that doesn't follow the rules? (Rules such as "You can't spend bitcoins that you don't own"). VERIFICATION solves this problem. As o_e_l_e_o explained, EVERY node on the network will refuse to accept and/or relay any transaction that does not follow the rules. ALL nodes refuse to trust ANY transaction they receive no matter who has verified it or how many times it has been verified. It's a quick and simple process to verify that a transaction hasn't broken rules, so when ANY node receives ANY transaction, it verifies. In this way, transactions that are obviously invalid never go anywhere and the majority of the network never even sees them. Problem 1 solved.
Problem 2: What if someone creates 2 different transactions that are each valid by themselves, but are not valid together? For example, let's imagine that I have exactly 1.0 BTC. Now let's imagine that I create a transaction that spends 0.7 of that bitcoin (and I don't share it with anyone yet), and I ALSO create a different transaction that spends 0.6 of that exact same bitcoin. Then I connect to 2 different miners and I simultaneously send one of them the first transaction, and send the other the second transaction. The first miner will "verify" the transaction that he receives, and it will be valid (because he doesn't know about the second transaction yet). He'll add it to his "mempool". The second miner will "verify" the transaction that he receives, and it will be valid (because he doesn't know about the first transaction yet). He'll add it to his "mempool". You can see that this is a problem, becuase I've now "spent" more than the 1.0 bitcoin that I control! How will these two miners (or ANYONE else in the entire system) determine which transaction is the "real" transaction? CONFIRMATION solves this problem.
The first miner will relay the first transaction to the nodes he is connected to. Some of the network will start to hear about that transaction and add it to their mempools. The second miner will relay the second transaction to the nodes he is connected to. Some of the network will start to hear about that transaction and add it to their mempools. Eventually, someone that already has the first transaction in their mempool will receive the second transaction from a node they are connected to. Since they already have the first transaction, the second transaction will appear invalid to them and they will reject it. Eventually, someone that already has the second transaction in their mempool will hear about the first transaction from a node they are connected to. Since they already have the second transaction, the first transaction will appear invalid to them and they will reject it. We now have a situation where some portion of the entire bitcoin network believes that I sent 0.7 BTC, and the remainder of the bitcoin network believes that I only sent 0.6 BTC.
Those miners that received the 0.7 BTC transaction first will eventually
attempt to add that to the block that they are working on. Those miners that received the 0.6 BTC transaction first will eventually attempt to add that to the block they are working on. Once a block is solved with one of the two transactions, that block will be relayed throughout the entire bitcoin network.
Anyone that had previously received and accepted into their mempool the same transaction that was also included in the block will simply see that the transaction in their mempool is now confirmed. They'll verify that the block is valid then they'll accept the block into their copy of the blockchain. After that, they'll remove the transaction from their mempool. They'll also search their entire mempool and determine if any of the remaining transactions in their mempool are no longer valid since (according to the rules of bitcoin) transactions in a block "happen" before transactions in a mempool.
Anyone that had previously received and accepted into their mempool the competing transaction that was not included in the block will see that the transaction in their mempool is no longer valid confirmed. They'll verify that the block is valid then they'll accept the block into their copy of the blockchain. After that, they'll remove all transactions from their mempool that are identical to transactions in the block. Then they'll also search their entire mempool and determine if any of the remaining transactions in their mempool are no longer valid since (according to the rules of bitcoin) transactions in a block "happen" before transactions in a mempool. They'll see that they have a transaction that can't be valid anymore since it spends bitcoins that are no longer available to the person trying to spend them. They'll then reject that transaction from their mempool.
Once the block has propogated throughout the entire bitcoin network, everyone will be in agreement on which of the two transactions actually happened (the one in the block). Problem 2 solved.