What is the mining? Who is the miner?

The mining is the process where the data is collected in a block and then the block is appended to the blockchain. This process is done by the miner.

Before digging into the process of mining, I suggest you read the following articles:

Who is the miner? Why does a person decide to start mining?

The miner is a special node in the network that gives its computational power to the network. You could be a miner too, all you need to do is to download a free software and run it.
The miner earns 12.5 bitcoins for each block created (called coinbase) as well as the transaction fee.

If it’s so easy I’ll quit my job and I’m going to be a miner!

Wait! It’s not so easy! In order to secure the data on the blockchain, it has been made intentionally difficult to create a block.
During the mining process, the miner calculates a code which will identify the block within the blockchain. This calculation must comply with the criteria of complexity that increases with the hashing power of the network. This difficult puzzle is called proof-of-work (I will talk about it in the next article).
The miners are racing with each other to solve the puzzle and the winner will earn the coinbase and the transaction fees.
Nowadays, there are miners with warehouses full of special computers that are working 24/7 only for mining; so if you want to start the career as a miner, your nerd computer is not enough!

What is the proof-of-work for? Why do miners spend so much effort on mining?

The proof-of-work is a mechanism for reaching global consensus on the valid blockchain: since all nodes have a copy of the blockchain, each node must agree on the conditions that prove how much effort a node has spent on verifying transactions.
In other words: if the content of the blockchain is easy to change then everyone can tamper with it; instead, if each block is calculated with complex mathematical functions then it takes a lot of effort to tamper with the blockchain.

If everyone can be a miner, is there any risk that someone can create a fake block?

Of course. A bad miner can create an invalid block; but remember that before appending a block to the blockchain, a miner must check if the block is valid. Hence if the block received by the miner is not valid, it will be rejected.
Moreover, the identifier hash code links each block together in a chain (that’s why the name is the blockchain); if I tamper with a block, I will invalidate not only that block, but also all the following blocks!

References

Coinbase value: https://blockchain.info/stats (you can calculate it dividing Bitcoins Mined by Blocks Mined)

Hash: wikipedia or you can wait for the next article!

Difficulty of proof-of-work: https://blockchain.info/it/charts/hash-rate?timespan=all

___________

Read the original article at www.danielefavi.com

Bitcoin transaction: how does it work?

In the previous article we had a quick introduction to the blockchain technology. In this article we are going to see what’s happening behind a bitcoin transaction.

Let’s take a simple example: Robert and his friends went to the Bit&Beer pub where bitcoin payments are accepted. After the whole night of drinking and having fun it’s time to pay the bill!
The waiter takes out a smartphone and shows the QR code to Robert for the payment of the bill. Robert takes out his smartphone as well, opens his bitcon app, scans the QR code, checks if the payment details are correct and presses the PAY button.

The QR code is a kind of a bar code but more complex, it contains several types of information, like:

  • the ewallet of the receiver (in our case Bit&Beer)
  • bitcoin amount to transfer
  • general information (like the name of the receiver)

When Robert presses the PAY button he creates a new transaction which contains the sender’s ewallet (Robert) and the receiver’s ewallet (Bit&Beer) details, the amount of bitcoins and a small fee. The fee however is not mandatory: the sender can decide whether or not to include the fee (transactions with a higher fee have a higher priority).

What is happening behind the scene?

The transaction is propagated in the bitcoin network (phase #1 of the scheme); the waiter of Bit&Beer can see Robert’s payment on his phone almost instantly, the status however is NOT CONFIRMED.

Who decides whether a transaction is valid or not?

The transaction is considered valid when special nodes in the network (called Miner) will append this transaction into a block in the blockchain.
This process is called Mining (phase #2 of the chart) and it has the following purposes:

  • to validate the transaction (referring to consensus protocol) or to reject an invalid transaction.
  • to create new bitcoins.

The process of Mining is the essential phase where the transactions are stored in the blockchain. In this step the transaction is being included inside a new block and this block is appended to the blockchain.
It is not simple at all to create a new block. Mining a block requires complex operations using a lot of computational power; this operation is called proof-of-work and it verifies the data on the blockchain and makes it immutable.

Miners are racing with each other to create a block: the first one that creates a block which satisfies the requirements earns some bitcoins and the fee within the transactions (phase #3 of the chart).

A new block is propagated on the network (phase #4 of the chart); other miners which received a new block, are going to check if the block is valid first and then include the new block in the blockchain.
Finally, the waiter of Bit&Beer can see in his ewallet that the payment has been confirmed. All this process is about 10 minutes long.

___________

Read the original at www.danielefavi.com

Blockchain for Dummies! A gentle introduction.

This article is one of several articles in which I explain in a very simple way what a blockchain is.

What is the difference between Bitcoin and Blockchain?

Blockchain is the technology behind bitcoin: bitcoin cannot exist without a blockchain. It is like Internet and Facebook: Facebook cannot exist without Internet.

What is a blockchain?

A Blockchain is a kind of database: while a normal database is located on a server, a blockchain is distributed among the software users.
For example, the Facebook’s database is located on a protected server and no one can access the information. The Bitcoin’s blockchain instead is located on servers and computers (called nodes) of all the Bitcoin users.

All the transactions that occur between ewallets are stored on the bitcoin’s blockchain. All the servers and the computers that are using bitcoin have the same copy of the blockchain stored on their hard disk.

There are many kinds of blockchain with different features, like Ethereum, Hyperledger, Ripple. Some of them are more suitable to handle currency, others are used to transfer the ownership of assets (eg supply chain).

You don’t need to download all the blockchain to your computer in order to use Bitcoin (or any other blockchain technology) as the current size of Bitcoin’s blockchain is over 160 GB and it can easily drain the resources of your computer. To avoid this issue there are different types of e-wallets (we will talk about them later).

If the bitcoin’s blockchain is on my computer, can I add 1 million of bitcoins in my ewallet?

The blockchain is famous for its security: once the data is there it is impossible to modify it.

The blockchain consists of a chain of blocks, where every block contains data (for instance a money transactions, documents or personal data).
When a new block is to be added to the chain, it has to be verified by the network of nodes first, and once this is done, the transaction can be inserted in the blockchain. There are mining and a consensus protocol standing behind this phase (click here to read more).
The blocks are connected with each other in a way that if I edit the content of one block I must edit all the following blocks, moreover to edit a block you need the consensus of other nodes.
Hence the more people are using a blockchain, the longer it is and the more secure the system is.

At present there are over 9000 nodes in the Bitcoin system.

Are you telling me that the blockchain has no flaws?

Technically it is possible to break into the blockchain but you will need more than half of the computational power of the whole world (so basically it is impossible).

Experts are worried that blockchain cannot resists a quantum attack. A quantum computer is a next generation computer with a huge computational power, it is being developed in Google’s laboratory. It can come out in 10 or 20 years but by that time also the blockchain technology will evolve. For instance Iota is a new kind of blockchain with a different structure and it can resists a quantum attack.

Why don’t we continue using a normal database as we did so far?

The blockchain is shaking many industries but it cannot be used everywhere. For example there is no sense in using blockchain to store the data of this website. But it makes a big difference when the third party is involved.
If you have to transfer money, the bank is the third party that takes the money from you and transfers it to the recipient.

In the Bitcoin system there is no one between you and the recipient, the transfer is direct, and it takes around 10 minutes.

The blockchain technology is applied in many industries such as music, real estate and energy. The company where I work uses the blockchain technology in the notary industry.

Thanks! You convinced me! Now I’ll buy 1000000€ in Bitcoin!!!

Wait a moment! The blockchain world is wonderful but risky. There are legal and technical details that you have to understand.

In several countries Bitcoin is not regulated.
For instance if I steal from you 10000€ you can sue me. If I steal from you 100 bitcoins and you go to the police, the policemen will tell you that the Bitcoin has no value. From the legal point of view, to steal the bitcoins is like to steal the air! You cannot sue me for stealing something without value.
Keep yourself updated with regards to the cryptocurrency laws of the country you live in.

The blockchain is a technology that is still evolving, some technical problems can arise with its development as well. For example in 2016 a bug in the Ethereum cryptocurrency system resulted into a loss of 50 million dollars suffered by many users.

On the other hand, many investors took the risks and became rich. It’s important to be updated, rely on tested technology, use safe systems for money deposits and not to search for easy ways to make money.

___________

Read the original at www.danielefavi.com