What is a Blockchain
Recently (mid 2017) I got some messages on Linkedin about „how does mining work“, or – „How does the blockchain work in detail“ and it seems there are a lot of people out there who want to know more about that topic.
[Actually if you want to deepdive into the topic, I highly recommend reading „Ethereum[…]“ by Henning Dietrich.]
The blockchain is just like a „decentralized“ database, meaning that -> it stores data, but it does that not only on one computer, but on all computers that are „full-nodes“ on the network.
A blockchain can be trusted without a third party. It replaces banks and notaries and works as a distributed ledger.
That means that if you send money to your friend „Tom“, the other members of the bitcoin network check if your transaction is valid (you have sufficient money in your wallet) and then the global database will integrate the changes in form of „transactions“ (mostly) by a miner as soon as he finds a new block.
Tom’s Balance will be increased.
Your Balance will be decreased.
And now Tom has the money 🙂
That works for quite a big bunch of things wherever you want to replace a trusted third party. Such as:
- Buy internet bill instantly byte by byte
- Buy electricity directly from solarpark owner
- Blockchain insurance peer to peer!
- Self-Register your rights for a song (as an Artist)
- Get coins for playing games!
- (Actually there are more, Rhian Lewis has an awesome summary)
What is a Block
A block contains of transactions that have been done. Blocks are arranged in a linear chain, the Blockchain.
Each Block consists of basically a header with the so called „nonce“ and a list of transactions.
In Detail it looks about like this:
- Blocksize (size of block in Bytes)
- Blockheader (protocol version, hash of previous block, timestamp, version, nonce..)
- Transaction Counter (# of transactions)
What is Proof of Work
Whenever a miner finds a block, he can add a transaction into the block and send himself a certain amount of coins. (e. g. 5 coins in Ethereum).
Searching for the block takes a lot of time and electricity power as the computer has to try again and again to find a matching combination of numbers to finalize the almost finished new block.
If he finds the proper „nonce“ that is smaller than the „difficulty“, he can finalize the block and we can be sure, that he spent a lot of energy on finding that block.
So he „deserves“ the newly generated coins. This Coin generation is called „Coinbase Transaction“
This is what we call Mining.
How does a Miner look like
The Computers that do that mining (in Ethereum world) are called rigs and are basically home computers just without a normal case and with six graphic cards or more instead of one
(graphic cards can be used to compute data! They are a lot faster than a normal processor).
As Bitcoinmining has been developed for some time now, they use so called Asics for mining. So they refined special „graphic cards“ that only serve one purpose -> hashing new Bitcoins.
And they are really super fast in that!
Here are some of my 2016 Ethereum rigs on my balcony:
How to find a Block
A block is found, when the Hash of the entire Block is smaller than a certain number that is called „difficulty“. this „difficulty“- number can be changed from time to time in Order to change the blocktime.
Bitcoin for example uses SHA256.
http://hashgenerator.de/ or use this:
The hash of a block can not be predicted. so if you hash the number
„1“ the result of the hashfunction is:
„2“ has a result of:
the text „hi“ results in:
as you can see, the results are totally different.
The current difficulty of Bitcoin (2017-04) is:
521974519553 in decimal, which is around 79881B1701 in hexadezimal (written: 0x79881B1701)
so the hash has to be smaller than 0x79881B1701 at the moment.
It is really hard to get a number, that is smaller than:
Man! Do you see how many zeros that number has?
Did you try to get a number that is smaller than this in the editor that I showed you above? almost impossible, right?
The whole Bitcoin network in the entire world needs more than 9.5 Minutes until one of all of those computers finds only ONE matching input that has the right output.
Btw. this 9.5 Minutes are called „blocktime“
What is Proof of Stake
Proof of Stake is another approach, where there are no miners at all.
Instead the coins behave like living cells and simply grow more 🙂
so the rich people get rich faster and the poor people don’t get anything, just like in the real world
well but it is not that bad, it is actually a good thing as saving money really pays off.
Ethereum wants to change to Proof of stake sooner or later which is a very good chance for Ethereum once again 🙂
What are the differences between blockchains and databases
Databases are actually centralized, they live on a server and can be accessed from everywhere.
As an admin, you can edit it, drop the database (delete it), add some data etc. So big companies (like banks) hide and protect their databases from attackers that might want to drop it!
Blockchains are different. An Explanation of what blocks are might be useful here.
Where can I buy Bitcoin /Ether/SiaCoin
For now the best ways are via an exchange, I prefer Coinbase, Poloniex, Kraken…
I would recommend to NOT trust people from like Italy or Spain who ask you on Xing and Linkedin like „I want to buy 500 BTC in Cash (counterfeited money(?!)) Let’s meet!“
(I added Siacoin to the list as I think they are on a brilliant path for now and quite hidden champeons )
What else can I buy
Initial Coin offers (ICOs) for example. These coins are basically coupons for a service that might be programmed in the future. Sometimes there are lots of programmers who really create content.
That could be a indicator that the coin might be worth something in the future.
The idea behind ICOs is quite insane I think, as you have not a single right and sometimes the ICO founders take the money and run..
But on the other hand did you see how the Ether price went on… You never know what is insane in Bitcoin world 🙂
How can I store the Coins safely
You have to download the Client, create a Wallet there and send your money from the exchange to the wallet safely.
Be aware that you read more about that first as it is quite tricky..
Ethereum MIST Wallet (the software where you can load you Ether coins to in order to store them on a local computer)