Bitcoin mining is competitive and the goal is that you want to solve or “find” a block before anyone else’s miner does. Then you will get the block reward and transaction fees from the block. During the last several years we have seen an incredible amount of hashrate coming online which made it harder to have enough hashrate personally (individually) to solve a block, thus getting the payout reward. To compensate for this pool mining was developed.
As soon as a miner finds a solution and a majority of other miners confirm it, this winning block is accepted by the network as the “official” block for those particular transactions. The official block is then added to previous blocks, creating an ever-lengthening chain of blocks, called the “blockchain,” that serves as a master ledger for all bitcoin transactions. (Most cryptocurrencies have their own blockchain.) And, importantly, the winning miner is rewarded with brand-new bitcoins (when Carlson got started, in mid-2012, the reward was 50 bitcoins) and all the processing fees. The network then moves on to the next batch of payments and the process repeats—and, in theory, will keep repeating, once every 10 minutes or so, until miners mine all 21 million of the bitcoins programmed into the system.
Based in Austin, TX, Steven is the Executive Editor at CoinCentral. He’s interviewed industry heavyweights such as Wanchain President Dustin Byington, TechCrunch Editor-in-Chief Josh Constine, IOST CEO Jimmy Zhong, Celsius Network CEO Alex Mashinsky, and ICON co-founder Min Kim among others. Outside of his role at CoinCentral, Steven is a co-founder and CEO of Coin Clear, a mobile app that automates cryptocurrency investments. You can follow him on Twitter @TheRealBucci to read his “clever insights on the crypto industry.” His words, not ours.
In front of me are nine warehouses with bright blue roofs, each emblazoned with the logo for Bitmain, a Chinese firm headquartered in Beijing that is arguably the most important company in the Bitcoin industry. Bitmain sells Bitcoin mining rigs—the specialized computers that keep the cryptocurrency running and that produce, or “mine,” new bitcoins for their owners. It also uses its own rigs to stock facilities that it owns or co-owns and operates. Bitmain owns about 20 percent of this one.
As more and more miners competed for the limited supply of blocks, individuals found that they were working for months without finding a block and receiving any reward for their mining efforts. This made mining something of a gamble. To address the variance in their income miners started organizing themselves into pools so that they could share rewards more evenly. See Pooled mining and Comparison of mining pools.
Bitcoin mining is a peer-to-peer process of adding data into Bitcoin’s public ledger in order to verify and secure a contract. Groups of recorded transactions are gathered in blocks and then added into the Bitcoin blockchain. Bitcoin mining requires a lot of resources to protect the network from the possibility of altering past transaction data by making all attempts in changing blocks inefficient for the intruder. Bitcoin mining is rewarded by the network through transaction fees and subsidies of new coins to encourage miners to spend their resources on mining new Bitcoin blocks. As Bitcoin mining is increasingly difficult, it has become impossible to attempt mining as an individual. As a result, most Bitcoin mining is being done by mining pools, which include several participants sharing their reward. Bitcoin mining is controversial, as it is a great tool for securing transactions but complicating the scaling of the network. 
Full clients verify transactions directly by downloading a full copy of the blockchain (over 150 GB As of January 2018).[90] They are the most secure and reliable way of using the network, as trust in external parties is not required. Full clients check the validity of mined blocks, preventing them from transacting on a chain that breaks or alters network rules.[91] Because of its size and complexity, downloading and verifying the entire blockchain is not suitable for all computing devices.
Transactions are defined using a Forth-like scripting language.[3]:ch. 5 Transactions consist of one or more inputs and one or more outputs. When a user sends bitcoins, the user designates each address and the amount of bitcoin being sent to that address in an output. To prevent double spending, each input must refer to a previous unspent output in the blockchain.[67] The use of multiple inputs corresponds to the use of multiple coins in a cash transaction. Since transactions can have multiple outputs, users can send bitcoins to multiple recipients in one transaction. As in a cash transaction, the sum of inputs (coins used to pay) can exceed the intended sum of payments. In such a case, an additional output is used, returning the change back to the payer.[67] Any input satoshis not accounted for in the transaction outputs become the transaction fee.[67]

Mining a block is difficult because the SHA-256 hash of a block's header must be lower than or equal to the target in order for the block to be accepted by the network. This problem can be simplified for explanation purposes: The hash of a block must start with a certain number of zeros. The probability of calculating a hash that starts with many zeros is very low, therefore many attempts must be made. In order to generate a new hash each round, a nonce is incremented. See Proof of work for more information.

Satoshi Nakamoto is credited with designing Bitcoin. Nakamoto claims to be a man living in Japan born on April 5th, 1975 but there are speculations that he is actually either an individual programmer or group of programmers with a penchant for computer science and cryptography scattered around the United States or Europe. Nakamoto is believed to have created the first blockchain database and have been the first to solve the double spending problem other digital currency failed to. While Bitcoin’s creator is shrouded in mystery, his Wizard of Oz status hasn’t stopped the digital currency from becoming increasingly popular with individuals, businesses, and even governments.
A CMU researcher estimated that in 2012, 4.5% to 9% of all transactions on all exchanges in the world were for drug trades on a single dark web drugs market, Silk Road.[30] Child pornography,[31] murder-for-hire services,[32] and weapons[33] are also allegedly available on black market sites that sell in bitcoin. Due to the anonymous nature and the lack of central control on these markets, it is hard to know whether the services are real or just trying to take the bitcoins.[34]
Desktop wallets are installed on a desktop computer and provide the user with complete control over the wallet. Desktop wallets enable the user to create a Bitcoin address for sending and receiving the Bitcoins. They also allow the user to store a private key. A few known desktop wallets are Bitcoin Core, MultiBit, Armory, Hive OS X, Electrum, etc.

A “wallet” is basically the Bitcoin equivalent of a bank account. It allows you to receive bitcoins, store them, then send them to others. There are two main types of wallets, software and web. A software wallet is one that you install on your own computer or mobile device. You are in complete control over the security of your coins, but such wallets can sometimes be tricky to install and maintain.A web wallet, or hosted wallet, is one that is hosted by a third party. These are often much easier to use, but you have to trust the provider (host) to maintain high levels of security to protect your coins.

For all the peril, others here see the bitcoin boom as a kind of necessary opportunity. They argue that the era of cheap local power was coming to an end even before bitcoin arrived. One big reason: The region’s hydropower is no longer as prized by outside markets. In California, which has historically paid handsomely for the basin’s “green” hydropower, demand has fallen especially dramatically thanks to rapid growth in the Golden State’s wind and solar sectors. Simply put, the basin may soon struggle to find another large customer so eager to take those surplus megawatts—particularly one, like blockchain mining, that might bring other economic benefits. Early data from Douglas County, for example, suggest that the sector’s economic value, especially the sales tax from nonstop server upgrades, may offset any loss in surplus power sales, according to Jim Huffman, a Douglas County port commissioner.
Even in the recent price crash, the miners have maintained their upbeat attitude, in part because they’ve died this death a few times before. In February, a day after bitcoin’s price dipped below $6,000, I checked in with Carlson to see how he was dealing with the huge sell-off. In a series of long texts, he expressed only optimism. The market correction, he argued, had been inevitable, given the rapid price increase. He noted that mining costs in the basin remain so low—still just a little above $2,000 per coin—that prices have a way to fall before bitcoin stops being worth mining there. Carlson is, he told me, “100 percent confident” the price will surpass the $20,000 level we saw before Christmas. “The question, as always, is how long will it take.”
Bitcoin's most important characteristic is that it is decentralized. No single institution controls the bitcoin network. It is maintained by a group of volunteer coders, and run by an open network of dedicated computers spread around the world. This attracts individuals and groups that are uncomfortable with the control that banks or government institutions have over their money.

If the random number generator is not random enough, that means someone else can recreate the private key of the hardware wallet easier. This attack has happened in the past with, a web wallet. Over 300 BTC were lost because did not use good RNG, so a hacker was able to generate the private keys again and steal coins.

Keeping your Bitcoin wallet safe is essential as Bitcoin wallets represent high-value targets for hackers. Some safeguards include: encrypting the wallet with a strong password, and choosing the cold storage option i.e. storing it offline. It's also advisable to frequently back up your desktop and mobile wallets, as problems with the wallet software on your computer or mobile device could erase your holdings. 
Early Bitcoin client versions allowed users to use their CPUs to mine. The advent of GPU mining made CPU mining financially unwise as the hashrate of the network grew to such a degree that the amount of bitcoins produced by CPU mining became lower than the cost of power to operate a CPU. The option was therefore removed from the core Bitcoin client's user interface.
While senders of traditional electronic payments are usually identified (for verification purposes, and to comply with anti-money laundering and other legislation), users of bitcoin in theory operate in semi-anonymity. Since there is no central "validator," users do not need to identify themselves when sending bitcoin to another user. When a transaction request is submitted, the protocol checks all previous transactions to confirm that the sender has the necessary bitcoin as well as the authority to send them. The system does not need to know his or her identity.
The Bitcoin protocol was designed to encourage the distribution of hashing power among miners rather than its concentration. The reason? Miners wield power not only over which transactions get added to the Bitcoin blockchain but over the evolution of the Bitcoin software itself. When updates are made to the protocol, it is the miners, largely, who enforce these changes. If the miners band together and choose not to deploy an update from Bitcoin’s core developers, they can stall transactions or even cause the currency to split into competing versions.

Transactions are verified by network nodes through cryptography and recorded in a public distributed ledger called a blockchain. Bitcoin was invented by an unknown person or group of people using the name Satoshi Nakamoto[9] and released as open-source software in 2009.[10] Bitcoins are created as a reward for a process known as mining. They can be exchanged for other currencies,[11] products, and services. Research produced by the University of Cambridge estimates that in 2017, there were 2.9 to 5.8 million unique users using a cryptocurrency wallet, most of them using bitcoin.[12]