ok.. back to basics
imagine i have a chequebook.. and i wrote out a cheque. i have $500 and i write a cheque to dave for $400
dave holds onto it. and seen i had $500 so it must be good.. right..??
however 2 minutes later i write another cheque to betty for $450
betty also seen my bank balance of $500 so thinks her cheque is good..
.. both cant be right
so a cheque is not cleared until the bank makes the transfer where only one recipients cheque is going to clear. (as it should be)
so.. the mining is replacing the bank clearing house.
different mining groups collect cheques and decide which get to be in their list.
they put them into their own batch making sure there is no:
double payments.
payments using empty accounts
the signature matches the funders ID
the signature is unique to the cheque to ensure the cheque hasnt been edited
this batch of cheques is given a unique ID
the unique ID is made up of a complex calculation of all cheque numbers.
and the previous confirmed batch ID.
now to stop other bank clearing houses making multiple batches in milliseconds declaring them the sole central bank
the batch ID have to go through a lengthy process of of calculations. to get a special batch id with several leading zeros.
the first bank clearing house to get this result. and check that the data and ID correspond. wins
and that batch(block)) is declared the confirmed block. and all the transactions listed within it are declared as confirmed(cleared)
if you edit one cheque in a previous block. it changes the block ID and thus would change the next block ID
so its not possible to make a block ID then change content without that new content invalidating the ID
this is what secures the data from editing. while also ensuring of no double spends
inshort dont accept a payment as final/cleared until its confirmed and in a block