Post
Topic
Board Beginners & Help
Re: Query regarding BitCoin wallet money
by
Senor.Bla
on 22/03/2017, 08:29:47 UTC
Please pardon me for asking such a basic question.

Who checks that for a particular transaction, your wallet has sufficient money?

If Person A has to send Person B 5 BitCoins, which process validates that Person A wallet has the required amount for the transaction?

Thanks in advance!
That is actually a good question.
Miners verify transactions and put them in a block they try to mine. This means that every confirmed transaction is checked. So how do they check it?
The blockchain is a ledger that contains all transactions. There you can see when a coin was created and if a coin was spend and to which address it was spend. If there is no further address to which the coin was send, then it is still in the current address.
There is also a list of all addresses that hold unspent Bitcoins, so it is easy to check.  

edit: also i think all wallets check if you have sufficient funds.

So basically wallets check whether you have sufficient coins for the transaction or not.

And what miners does is 'validate' the transaction (encrypt the transaction data hash) by calculating crypto-graphic hash functions.

Am I right?
No wallet that i know will make an transaction without checking if you have sufficient funds. You can still create scenarios where a wallet is not up to date or i prepared the transaction a week ago and didn't send it yet (but spend the money otherwise). But this checking is a kind service to the user (so he knows how much he has to spent) not the job of a wallet. The job of a wallet is to create the transaction, to fill out the form so to say. And then tell it to the network. The network and by that i mean the nodes and miners will check it. BTW miners are also nodes. Nodes are basically miners that lave the mining part out. Those nodes and miners job is to check if a transaction is valid or not. They will simply reject your transaction if it is not and you will have your feedback quickly.
So what extra work do miners? They simply take a bunch of those unconfirmed (but verified through the nodes) transactions flying around and put them in a box (confirming them). Once they are in a box they are considered save and all agreed to it.