If I want to send some of my bitcoin, I will publish my intention and the entire bitcoin network will be scanned to see if:
1. I have the bitcoin I want to send,
2. I did not send it to another person anymore.
Once this information is confirmed, my transaction will be placed in a „block” that will be attached to the previous block – hence the term „blockchain”. The transaction can not be undone or omitted because it would mean re-execution of all blocks that appeared later.
Things are getting more complicated:
My bitcoin wallet does not actually contain my bitcoin. Only his address, which records all my transactions, and thus the balance. This address – a long string of 34 letters and numbers – is also known as my „public key”. It does not bother me that the sequence is displayed to everyone. Each address / public key has a corresponding „private key” consisting of 64 letters and numbers. This one is private. It is important to keep it secret and in a safe place. These two keys are related but there is no way for anyone to find my private key from my public key.
This is important because every transaction I send from my Bitcoin address must be „signed” with my private key. To do this, I put both my private key and transaction details (how many bitcoins I want to send and to whom) to the Bitcoin software on my computer or smartphone.
Thanks to this information, the program will eject a digital signature that will be sent to the network for validation.
This transaction can be approved – that is, I can confirm that I own the bitcoin I send to you and that I have not sent it to anyone else – by attaching the signature and my public key (which is publicly available) to the Bitcoin program. This is one of the genius parts of bitcoin: if the signature was filed using the private key that corresponds to that public key, the program will check the transaction without having to know the private key. Very smart.
The network then confirms that I have not previously issued bitcoin, browsing through my address history, what it can do because it knows my address (= my public key) and all transactions are public in the bitcoin book.
Things get even more complicated:
When my transaction is approved, it will be included in the „block” along with some other transactions.
Let’s jump off the topic for a moment to discuss what is „hashing” because it is important from the point of view of the next paragraph: hashing is created by the „hash function”, which is a complex mathematical equation that reduces any amount of text or data to string 64-character. It is not accidental that each time you enter this particular data set with the hash function, you will receive the same 64 character string. But if you change even a comma, you will receive a completely different 64-character string. The whole article can be reduced to a shortcut, and if I do not change, do not delete or add anything to the text, the same shortcut can be created again and again. This is a very effective way to determine if something has changed, and in this way the blockchain can confirm that the transaction has not been violated.
Return to our blocks: each block contains, as part of its data, the abbreviation of the previous block name. This is what makes it part of the chain, hence the term „blockchain”. So, if one small part of the previous block was violated, the shortcut of the current block would have to change (remember that one small change in the introduction of the hash function changes its result). So if you want to change something in the previous block, you also need to change something (= shortcut) in the current block because the one that is currently attached is no longer valid. It is very difficult, especially that before you reach the middle, probably one more block will be on the current one. Then you would have to change it. And so on.
This is what makes Bitcoin virtually resistant to forgery. I say practically because it is not impossible, it is very, very, very difficult, and therefore unlikely.