The amount of new bitcoin released with each mined block is called the block reward. The block reward is halved every 210,000 blocks, or roughly every 4 years. The block reward started at 50 in 2009, is now 12.5 in 2018, and will continue to decrease. This diminishing block reward will result in a total release of bitcoin that approaches 21 million.  
Another interesting way (literally) to earn bitcoins is by lending them out, and being repaid in the currency. Lending can take three forms – direct lending to someone you know; through a website which facilitates peer-to-peer transactions, pairing borrowers and lenders; or depositing bitcoins in a virtual bank that offers a certain interest rate for Bitcoin accounts. Some such sites are Bitbond, BitLendingClub and BTCjam. Obviously, you should do due diligence on any third-party site.
Then two things happen. New transactions are added to the Bitcoin blockchain ledger, and the winning miner is rewarded with newly minted bitcoins. The miner also collects small fees that users voluntarily tack onto their transactions as a way of pushing them to the head of the line. It’s ultimately an exchange of electricity for coins, mediated by a whole lot of computing power. The probability of an individual miner winning the lottery depends entirely on the speed at which that miner can generate new hashes relative to the speed of all other miners combined. In this way, the lottery is more like a raffle, where the more tickets you buy in comparison to everyone else makes it more likely that your name will be pulled out of the hat.
Computing power is often bundled together or "pooled" to reduce variance in miner income. Individual mining rigs often have to wait for long periods to confirm a block of transactions and receive payment. In a pool, all participating miners get paid every time a participating server solves a block. This payment depends on the amount of work an individual miner contributed to help find that block.[82]
With the Antminers needing to stay below 38 °C, Mongolia is not the ideal location for a mining facility. It had been above 40 °C for several days when I visited in July. And in the winter, it can fall to –20 °C, cold enough for Bitmain to add insulation to the facilities. Dust is a problem as well, which is why the interior of every warehouse I walk through is veiled in a fine fabric filter.

Bitcoin mining is the process of updating the ledger of Bitcoin transactions known as the blockchain. Mining is done by running extremely powerful computers (known as ASICs) that race against other miners in an attempt to guess a specific number. The first miner to guess the number gets to update the ledger of transactions and also receives a reward of newly minted Bitcoins (currently the reward is 12.5 Bitcoins).

Wu claims that Antbleed, which has since been patched, was only vestigial code left in by mistake when engineers were trying to build a kill switch for a customer’s own use. There was some skepticism about this explanation, but because the S9’s firmware is open source, users are confident in the patched version. Still, the discovery of it was a startling reminder of the need for diversity in the mining hardware industry.
In the blockchain, bitcoins are registered to bitcoin addresses. Creating a bitcoin address requires nothing more than picking a random valid private key and computing the corresponding bitcoin address. This computation can be done in a split second. But the reverse, computing the private key of a given bitcoin address, is mathematically unfeasible. Users can tell others or make public a bitcoin address without compromising its corresponding private key. Moreover, the number of valid private keys is so vast that it is extremely unlikely someone will compute a key-pair that is already in use and has funds. The vast number of valid private keys makes it unfeasible that brute force could be used to compromise a private key. To be able to spend their bitcoins, the owner must know the corresponding private key and digitally sign the transaction. The network verifies the signature using the public key.[3]:ch. 5
The receiver of the first bitcoin transaction was cypherpunk Hal Finney, who created the first reusable proof-of-work system (RPOW) in 2004.[21] Finney downloaded the bitcoin software on its release date, and on 12 January 2009 received ten bitcoins from Nakamoto.[22][23] Other early cypherpunk supporters were creators of bitcoin predecessors: Wei Dai, creator of b-money, and Nick Szabo, creator of bit gold.[24] In 2010, the first known commercial transaction using bitcoin occurred when programmer Laszlo Hanyecz bought two Papa John's pizzas for 10,000 bitcoin.[25]