I don't understand the logic of "mining", if bitcoins are a digital currency, why do we need a GPU to "make 'em"?
Why do we mine?
We need to all agree on who owns which coins. If your idea of who owns what is different than mine then how can we trade?
To achieve this, the Bitcoin protocol keeps its ledger of all transactions in a series of blocks, with each block recording a collection of transactions. Since we don't have a central authority to declare which blocks are valid, we run a 'lottery' instead.
Each miner bundles up all the new transactions he knows about, adds in an extra transaction which creates some coins out of thin air and pays them to the miner, mixes in a random number and hashes the whole thing. If he gets a hash less than a certain number, he wins and his block is added to the blockchain. If not, he tries with a different random number, over and over. Everyone else can verify that his random number with his transactions hashes to a low enough number, so they accept his block. The network periodically adjusts what this target "low enough number" is, in an attempt to keep the average speed of block generation at about 10 minutes.
Why do we need a GPU, not a CPU?
You generate coins by calculating hashes. Each hash you calculate has a certain chance of making a block, and earning the associated reward, which is currently 50 coins. The faster you can calculate hashes, the more chance you have of generating 50 coins. It just so happens that ATI GPUs have the right kind of hardware in them to calculate sha256 hashes many times faster than an Intel CPU can do it. That's why people use GPUs instead of CPUs.
The Bitcoin network automatically adjusts the "chance per hash" to try to keep the global rate of generation at one block every ten minutes.
In the beginning, before GPU mining started in earnest and not many people were mining, CPU mining worked just fine. But as more people joined the network and hash rates became faster, the network difficulty increased to keep the blocks coming along every 10 minutes or so. As a result, CPU mining became less rewarding per CPU.
Then when it became more common for miners to use GPU hardware to mine because it is so much faster and more energy efficient than CPU mining, the global network hash rate increased still further eventually making it completely useless to mine with a CPU; the expected rewards are less than the power consumed by the CPU.
Bitcoin blocks have been deliberately made difficult to mine. The point is:
To prevent the network to be flooded with a ton of valid blocks that have to be checked for validity and stored. (The difficulty to mine them is dynamically adjusted so that in average, worldwide, one block is generated every 10 minutes.)
Also, this gives time for newly created blocks to spread across the network. Typical millisecond latencies can then be ignored. If latencies were not negligible, the mining 'game' would be unfair to poorly connected miners.
And to finish answering your question, the purpose of mining is not to distribute coins, but to collectively build a reference transaction history. Coin distribution is just a reward to those who participate. Please refer to How does the mining process support the currency?
The logic behind mining Bitcoins is similar to the one behind all the security features used in all currencies - to prevent people from counterfeiting them.
Traditional money uses special fabric, paint, serial numbers and highly detailed design patterns to prevent people from making their own copies and thus flooding the market. If you'd get rid of all that, anyone could write down "10$" on a piece of paper and use it as currency.
With Bitcoin, the problem is a bit harder - as there is no central authority, mining was chosen to be the way for money to be created and transferred. The cryptographic problem that is being solved with each new block is a proof that someone went through the effort of mining that particular block. The process of legitimately creating Bitcoin takes both time and computing power and counterfeiting Bitcoin takes roughly the same amount of work, encouraging people to be fair.
Without mining we would either need a central authority to manage the amount of created Bitcoins and how they are transferred (which defeats the purpose of a decentralised cryptocurrency), or we would be stuck with worthless bits that anyone could make in any amount.
Bitcoin cleverly combines two functions via mining:
- Ensuring an "equitable" distribution of currency during the (current) generation phase of the Bitcoin economy.
- Providing a secure distributed time-stamping function to provide a trusted ordering of all Bitcoin transactions.
The creator of Bitcoins realized that there would have to be some way to get Bitcoins into circulation. Since it is decentralized, he did not want to issue coins from a central authority. So, he enticed others to "mine" for Bitcoins by exchanging computation power for Bitcoins. The mining process is quite similar to a lottery, where you buy "tickets" by computing hashes; the more hashes you compute, the more likely you are to win 50 Bitcoins.
This scheme has the economic benefit that value is not created out of thin air - Bitcoin miners have to trade one valuable resource (their computing time and energy), in exchange for another (Bitcoins). This helps establish a correlation between a "real world" value, and the value of a Bitcoin.
It just so happens that mining also is used to establish a well defined ordering of Bitcoin transactions; so we kill two birds with one stone, and provide incentives for people to contribute resources to keep the Bitcoin network operating.
Bitcoin mining is the process of adding transaction records to Bitcoin's public ledger of past transactions or blockchain. This ledger of past transactions is called the block chain as it is a chain of blocks.
Bitcoin mining is intentionally designed to be resource-intensive and difficult so that the number of blocks found each day by miners remains steady. Individual blocks must contain a proof of work to be considered valid. This proof of work is verified by other Bitcoin nodes each time they receive a block. Bitcoin uses the hashcash proof-of-work function.
The primary purpose of mining is to allow Bitcoin nodes to reach a secure, tamper-resistant consensus. Mining is also the mechanism used to introduce Bitcoins into the system: Miners are paid any transaction fees as well as a "subsidy" of newly created coins.
Miners do expensive computation to solve puzzle and they broadcast it over the network. It contains a number called nonce which can be used to easily verify that actual work was done. This is called proof of work. The solution takes lot of trials and is computationally difficult but it can be easily verified by other nodes on network. Any evesdropper, if tries to alter any block or transactions, will need to do alter all following blocks in blockchain that will get exponentially difficult. Thus it makes alterations in block impossible and a secure and tamper resistant ledger is created on blockchain.
The term "money doesnt grow on trees" springs to mind. Ask yourself these questions for now.
- Where do we distribute wealth?
- What gives it value?
- How can we stop people making forgeries?
All these problems can be resolved by requiring complex computational algorithms that require you (or your hardware as the case may be) to work out.
Using cryptography we can use a distributed system, give it rarity due to the supply at which they can be created and highly improbable for someone to make a forgery (or double spend a transaction in this case).
These are only a few of the possible scenarios which rely on cryptography to solve problems with Bitcoin.