What is a Transaction
Another concern I often need to explain is about how Blockchain actually works.
I’ll admit the whole transaction mechanism within a Blockchain was kind of harsh to get at first, in particular back in 2014 when there was not a whole lot of available information about it.
When it comes to these kind of explanations, I think that “putting it simple” usually helps in getting the point straight, so here’s how I picture it.
Transactions are sent from and to electronic “wallets”.
Everyone participating to the network knows about a transaction
and the history of every single transaction can be traced
back to the point where the coins were produced.
You may be surprised to know that Bitcoins (or other digital currencies) don’t exist anywhere.
What does exist, however, are the records of all transactions between different addresses, with balances that change. Every transaction that ever took place is safely stored in a huge public database called, for instance, Blockchain.
If you want to know the balance of any bitcoin address, the information isn’t held at that address but within the Blockchain.
If A sends some Bitcoins to B, that transaction will contain three pieces of information:
• An input: Which BTC address was used to send the Bitcoins to A in the first place (say, C sent them).
• An amount: This is the amount of Bitcoins that A is sending to B.
• An output: This is B's Bitcoin address.
So, in brief, a transaction is a string of numbers and letters which contains the previous information (input, amount and output) together with some other characters which are – to put it simple – randomly generated.
How it Works
To send – or receive – Bitcoins, you basically need two things:
a bitcoin address (a.k.a. a public key) and
a private key.
A Bitcoin address is randomly generated, and is just a sequence of letters and numbers. The private key is another sequence of letters and numbers, but unlike your bitcoin address, this is kept hidden from anybody.
Think of your Bitcoin address as a safe box with a window on the front. Everyone knows what is in it, but only the private key can open it to take things out or put things in.
When A wants to send bitcoins to B, he uses the private key to sign a message with the input (which is the proof he actually has the coins), amount, and output (B’s address).
He then sends these information to the network which verifies it and approves (or blocks) the transaction, this is done by the so-called “miners”.
Since transactions must be verified by these miners, you are sometimes forced to wait until they have finished mining (or validating) the block in which your transaction waits with other transactions for approval.
Each block is set to take roughly 10 minutes to be solved.
Brief Explanation
If I want to send some of my Bitcoin to you, I basically publish my intention and the nodes scan the entire bitcoin network to validate that I
1- have the amount of Bitcoin that I want to send, and
2- haven’t already sent it to another address.
Once that information is confirmed, my transaction gets included in a “block” which gets linked to the previous. Transactions can’t be undone or tampered with, because it would mean re-doing all the blocks that came after.
Full Explanation
As we said, my bitcoin wallet doesn’t actually hold my Bitcoin.
What it does is holding my bitcoin address, which keeps a record of all of my transactions, and thus of my balance.
The address – a string of 34 alphanumeric characters – is also known as my “public key”. The whole world can see this sequence.
However, each public key has a corresponding “private key” which is double its length. This key is private, and it’s crucial that is kept safe. The two keys are related, but there’s no way anyone can figure out a private key from the public one.
This mechanism is extremely important, because any transaction issued from a bitcoin address needs to be “verified” with its specific private key. To do that, both the private key and the transaction details (how many bitcoins I want to send, and to whom) need to be added to the bitcoin software on the computer doing the operation.
With this information, the program generates a “digital signature”, which gets sent out to the network to be validated.
This transaction can only be validated – meaning that it can be confirmed that I own what I am transferring to you, and that I haven’t already sent it to someone else – by inputting both the signature and my public key (which everyone knows) into the bitcoin program.
This is maybe one of the most impressing parts of the Bitcoin protocol: if the signature was made with the private key that truly corresponds to that public key, the program will validate the transaction without actually knowing what the private key is.
Then, the network confirms that I haven’t previously spent that amount by scanning my address history, which is possible as it corresponds to my public key and because all transactions are public on the bitcoin ledger.
A Bit More Technical
As you saw, once a transaction is validated it gets incorporated into a “block”, along with a number of other transactions.
An important thing to know to fully understand how transactions occur within a Blockchain is what an “hash” is.
A hash is basically a 64-character string produced by a “hash function” which is a rather complex formula that reduces any amount of text or data to a string of 64 characters. This process is not random since every time you put in that particular data set using the hash function, you’ll always obtain the same 64-character string.
However, if you change just one single character within the data-set, you’ll get a completely different 64-character string. A whole book can be reduced to a hash, and unless some letters change, it will always produce the same hash. This is an extremely effective way to tell if something has changed, and is the core concept that makes Blockchains work.
For what concerns blocks: every single block includes, as part of its data, a reference to the last block. Therefore, if only one small part of the previous block is altered, the entire current block’s hash would have to change too.
This is, ultimately, what makes Cryptocurrencies like Bitcoins virtually tamper-proof.
Conclusive Thoughts
In this new ultra-connected world we live in, security of digital assets has become a major issue. Being able to control sensible personal information is something that nobody should be overlooking, particularly if data concern money and contracts.
As we discussed, Blockchain not only solves this problem but it also fills the informative gap between parties involved in digital transactions.
In the same way that Bitcoins would be nothing without Blockchain, Blockchain would never exist if it wasn’t able to solve these two major issues.
And it does solve them.
Knowing that you can transact with virtually anybody on the internet without risking to be defrauded is a pretty powerful thing alone. Add to this that your sensible data remain exceptionally safe in the process and you have a tremendously powerful mix, at a VERY low cost.