How a transaction is verified into any previous or old block before it is added as a new transaction in recent block
You don’t have to re-verify a transaction in previous blocks, since the new transaction wasn’t there yet.
While new transactions are grabbed from mempools. Once they are confirmed and the new block gets added. The “new” transactions are removed from the mempool.
This is all because of hashing functions, that create a unique output
heccak256(input) = output. This simply means, you cannot change sth input, without changing the output.
Also it might happen that the same mempool got verified twice, and the blockchain will split, causing a fork. Then simply the blockchain “battle” starts, and the chain that gets 5-6 blocks faster “wins” and all the transactions from the other blocks go back to the mempool.
So… to answer your question:
To check if the transaction is verified you have to check if it’s in a mempool and wait for 5-6 confirmations.
Hi JJ - thanks for the reply - I just started learning on Moralis Academy and enjoying.
What I wanted to ask is that suppose I had USD 1,000 balance which was recorded in say a previous Block No. 20 and this block is fully completed now presently Block No. 70 is under progress/addition - so suppose I want to spend say USD 500 - then it means my previous balance which is recorded in Block 20 need to be verified before my spend of USD 500 is added into ongoing block no. 70 which will also record my balance as USD 500 and spend as USD 500 - so how my verification of USD 1,000 is done while miners are working on Block 70
Bitcoin use UTXO model and it allows Bitcoin nodes to efficiently verify every transaction on the blockchain. When a node receives a transaction, either in the mempool or as part of a block, it can verify whether the UTXOs being spent are valid and unspent. Let say you have 1 btc and want to transfer to a friend 0.5 btc, when you made a transaction then node the receive the transaction to validate it by checking if your UTXO is valid and unspent in the database they have for every bitcoin transaction.
Hey @deejay_academic. I don’t want to be this guy on the internet, that tell people to do their homework before posting a question
But I think you’re rather early in this course. And maybe you even haven’t done any BTC transaction before. Don’t worry, we’ve all been there before.
Just follow along the course and you will understand it at some point. BTC transactions are more confusing than ETH because of UTXOs - which means you don’t have any balance on your account, but just a sum of all UTXOs available for you.
Thanks Maki for your reply
Thanks Jozef for your reply - Regards