Take the 2-minute tour ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I have heard that mining is for people with ready hardware and blah blah blah... But what exactly is it? Does it operate like real mining? I mean, people talk about it like you are physically mining.

share|improve this question
    
Transaction validation process is called mining. For each block of transactions validated, the successful miner receives bitcoin reward. michaelnielsen.org/ddi/how-the-bitcoin-protocol-actually-works –  RP. Mar 4 at 4:13

7 Answers 7

up vote 112 down vote accepted

David Schwartz's answer is entirely accurate, but all that "bitspeak" might be a little intimidating to the average user. Let me try and put it into more plain language:

The way Bitcoin works is that instead of having one central authority who secures and controls the money supply (like most governments do for their national currencies), this work is spread out all across the network. Most of the heavy lifting for Bitcoin is done by "miners".

Miners collect the transactions on the network (like "Alice pays Karim 10 bitcoins" and "Liam pays Sofia 8.3 bitcoins") into large bundles called blocks. These blocks are strung together into one continuous, authoritative record called the block chain, which doesn't permit any conflicting transactions. This is necessary because without it people would be able to sign the same bitcoins over to two different recipients, like writing cheques for more money than you have in your account. The block chain lets you know for sure exactly which transactions count and can be trusted (so no bad cheques!).

The way Bitcoin makes sure there is only one block chain is by making blocks really hard to produce. So instead of just being able to make blocks at will, miners have to compute a cryptographic hash of the block that meets certain criteria. Bitcoiners refer to this process as "hashing". The only way to find a cryptographic hash that's "good enough to count" is to try computing a whole bunch of them until you get lucky and find one that works. This is the "lottery" that David Schwartz refers to, because miners who successfully create a block are rewarded some bitcoins according to a preset schedule. The difficulty of the criteria for the hash is continually adjusted based on how frequently blocks are appearing, so more competition equals more work needed to find a block. A modern GPU can try hundreds of millions of hashes per second, so to be competitive in this race to find hashes miners need specialised hardware, otherwise they will tend to spend more on electricity than they make in the "lottery".

In addition to the hash criteria, a block needs to contain only valid, non-conflicting transactions. So the other main task for miners is to carefully validate all the transactions that go into their blocks, otherwise they won't get any reward for their work!

Because of all this work, when a Bitcoin client signs on to the network it can trust the block chain that was most difficult to produce (since this is evidently the one that was being worked on by the most miners). If there was a "fake" blockchain competing with the real ones (say, where someone pretends that they didn't actually give Sofia those 8.4 bitcoins and they still have them), the fraudster would have to do as much work as the whole rest of the network to make their block chain look as trustworthy. So essentially, the intense work that goes into finding blocks through hashing secures the network against fraud. There is also, of course, some nifty code that figures out how to choose between conflicting transactions; and what to do if two people find valid blocks at the same time.

One last thing: why is it called mining? In the original analogy, people who performed this essential work were compared to gold miners digging the gold out of the ground so that everyone could use it. But in reality, Bitcoin "miners" are just running computer programs on very specialised hardware that automates the process of securing the network. To sum up, this software

  • Collects transactions from the network
  • Validates them, and doesn't allow conflicting ones
  • Puts them into large bundles called blocks
  • Computes cryptographic hashes over and over until if finds one "good enough to count"
  • Then submits the block to the network, adding it to the block chain and earning a reward in return.

That's mining in a nutshell!

share|improve this answer
11  
+1. Great answer that really answers more than just "What is mining?". –  D.H. Sep 8 '11 at 17:33
    
Great answer. Perhaps just one thing to add - a Transaction being included in a Block constitutes its first Confirmation, and each successive block adds one more Confirmation. –  ypocat Feb 2 at 16:53

mining is doing the work of finding nonce so that sha256(sha256(data+nonce)) < difficulty

where

  • nonce is an integer number the miner chooses freely (this choosing of the nonce and checking if the condition (< difficulty) is met comprises the work
  • data is a hash over the contents of the block (transactions) and the previous blocks hash
  • sha256() is the SHA-256 cryptographic hashing function (wikpedia SHA-2 article)
  • difficulty is a value that is adjusted consensually by the nodes of the bitcoin network to adjust for change in network computation power in order to have one block every 10 minutes found by the network

The resulting nonce is the proof of work: Since it's impossible to find nonce without essentially trying different nonces and calculating the two hash functions, having found a nonce that satisfies the condition is proof this work of searching and calculating has in fact been done.

This is the central idea behind Bitcoin to solve the double spending problem: due to the inclusion of the previous blocks hash in data (this links the blocks to form a chain) and the fact that the honest nodes of the network always to their work on the longest chain of blocks, a double spending attack involves calculating (and later publishing) a forked block chain in secret that is longer than the "honest chain" (containing the transaction that should be undone). Due to the work required to do this, this race can only be won if the attacker has greater computation power than the rest of the network together. Since using such computation power to honestly mine is likely more profitable than pulling a double-spend, the incentive for doing a double-spend attack is low.

share|improve this answer
3  
I think this answer is too terse for the audience. This might be fine on Cryptography.SE, but the typical Bitcoin user might not know what nonce or sha256 means. I suspect the typical Bitcoin user might have heard of something called a "hash" but has no idea that your answer is referring to the application of hash functions. –  Michael McGowan Sep 12 '11 at 21:16
11  
Personally, I think that technical answers might cohabit with non-technical ones. In this case some explanations on what is data and difficulty are needed, otherwise nobody will learn anything. Not even a cryptographer. –  Stéphane Gimenez Sep 12 '11 at 21:23
2  
I like Stéhane Gimenez' idea of explaining stuff (data, nonce, sha256, etc.) after the short and precise definition of mining. I'm new to stackexchange... can I (should I) edit my answer? –  molecular Sep 13 '11 at 7:44
    
ok, I added explanations. Please, if anyone spots inaccuracies or worse, don't hesitate to add a comment, I will correct my answer. –  molecular Sep 13 '11 at 8:07
2  
This actually is more what I was looking for. Once you get the basics, it becomes more difficult to delve deeper. Thanks. –  Kinnard Hockenhull Dec 13 '12 at 17:22

Mining is the process of securing transactions and committing them into the bitcoin public chain. It requires winning a kind of computational lottery where each hash you perform is like buying one ticket. The Bitcoin protocol currently permits the miner who generates a block to claim 50 bitcoins as well as any transaction fees for the transactions that miner chooses to include.

The Bitcoin system uses the mining process to generate coins, secure transactions, and publish transactions.

share|improve this answer
5  
The block reward is now 25 bitcoins. –  David Schwartz Jun 29 '13 at 6:36

Mining is just doing computational work to secure the transaction block chain. A side effect of mining is creation of new coins and earning additional money by signing on transactions.

share|improve this answer

Mining is just running a application on your computer to confirm the transactions of the crypto currency for which you get paid as fees.

I will say mining is the soul of crypto currency, according to today's scenario everyone creating new coin everyday but some of them goes to the moon and some of them just vanish in a couple of weeks, why? because a coin is alive until there are people to mine it. Take a example of a coin which has only 100 miners and you bought 1000 such coins after a few days miners stopped mining that coin, now you cannot sell that coin to anyone even if you have a potential buyer, why? because your transaction will not confirm until there are people mining that coin. The price of coins go up because of mining, why? because as many miners start mining the currency the difficulty increases, with the increase of difficulty mining coins will take more time, more miners more demand less coins. Increment in rates.

share|improve this answer

In more simple terms: Actual mining means, you sweat digging something and then find some useful metals. In bitcoin mining, your computer sweats calculating blocks and in return the bitcoin protocol gives you some bitcoins.

And in actual mining, you find precious metals which doesn't belong to anyone. Similarly, in bitcoin mining, the bitcoin protocol generates new bitcoins (Only upto 21 millions though) (which are not belonged to anybody) and gives you.

So the word "mining" makes perfect sense.

share|improve this answer

The answers in this section all present different, useful perspectives. Another useful, but non-technical perspective is:

Mining is a battle between those who want to see Bitcoin succeed for the greater good, and those who don't care if it is destroyed as long as they achieve some victory, even if only to be part of the destruction (they might not get any BTCs from their destructive efforts).

In other words, Bitcoin is a fascinating attempt to establish an alternate money system. Since the P2P, decentralised architecture is integral to its success it is, by design, open to any participant. The mining process assumes that some participants are evil. It pitches 'good' against 'evil' in the hope that 'good' will continue to succeed and maintain the integrity of the network.

share|improve this answer
    
Why the downvotes? –  Matthias Jul 6 at 16:20

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.