The math problem being solved while mining for cryptocurrency is actually, "Which number, when tacked on to the end of the blockchain, produces a hash that starts with a whole bunch of zeros?" If you don't know anything about cryptocurrencies, this probably sounds pretty opaque Let's back up a second

With traditional digital media, if I send you a file, there's no guarantee that I didn't keep a copy of the file for myself If you want to send money digitally (that is, actually transfer from one person to another and guarantee I can't re-spend it), what you really need is a trusted party to keep a ledger – a list of balances and transactions between accounts When you receive money from someone, you ask this trusted party to update the ledger, decreasing your balance and increasing someone else's This is essentially how modern banking works There's a problem though, that makes this ledger approach fundamentally different from cash

With cash, I hand you money and you walk away There is no third party necessary to facilitate the transaction Sometimes, we don't want a third party; maybe I'm buying something secret, or private, or illegal Maybe I'm wanted by some scary people who will go after the people I transact with in order to get to me Or maybe the people I transact with have such people after them

Or maybe I'm just privacy-conscious, and the idea of having a bank, clearing house, or exchange track my purchases is jarring So, how can we have a trusted ledger without having a trusted third party? The idea is this: in the spirit of bittorrent, a bunch of nodes connect together, and none have any authority over any other When I want to transact with someone, I cryptographically sign a message that says "I am sending a balance from address A to address B" I broadcast the message to the network, and it gets passed around until everyone has seen it Since I've signed the message using cryptography magic, all nodes can guarantee that the owner of address A consents to this transaction

But how do we know address A actually has the money to spend? Enter the blockchain This is a distributed public ledger that says which accounts (addresses) have what balances All transactions that enter the ledger need to be from addresses that have appropriate balances; if there are invalid transactions, then the nodes will reject it So, every transaction has a complete audit trail leading back to when the coins were first created, so we can guarantee people aren't just inventing coins out of thin air But how do we decide which version of the blockchain (distributed ledger) is the correct one? Couldn't I, as a node equal to all other nodes, present a version of the blockchain where I didn't give away money to someone else, effectively reversing a transaction? This is where "mining" of the cryptocurrency comes in

All of the valid transactions are packaged up into a "block" and all of the nodes in the network try to solve a hard problem, the problem mentioned at the beginning of this video The only way to get a hash that starts with a bunch of zeros is to guess and check many, many times, until I stumble on the correct answer Everyone is racing to find this answer, because the person who finds it gets to writ e a transaction that generates free coins and puts them into an address of their choosing Anyone can stumble on the answer at any time, so the difficulty of the problem is adjusted by the network until a correct answer is found, on average, every ten minutes Now, if I want to rewrite a portion of the blockchain, I invalidate the hash that was found

In order to get the rest of the network to accept it, I need to find a new random number that, when combined with the block, produces a hash that correctly solves the problem But the entire network combined can only find one such answer every ten minutes; for me to do it myself would take years! And by the time I did find an answer, the rest of the network will have found many, many more blocks and tacked them onto the end, and the rest of the world will use the longer blockchain, so all of my work has been wasted So that's basically it; you contribute computing resources towards this problem that, by its very nature, secures the network against attackers trying to double-spend In return, you get to generate money for use on that network