What is Bitcoin Mining? How To Mining of Bitcoin?

image from : hongkiat                                                                   

Bitcoin mining
To implement a distributed timestamp server on a peer-to-peer basis, bitcoin uses a proof-of-work system similar to Adam Back's Hashcash, rather than newspaper or Usenet posts. This is often called bitcoin mining.

The mining process or proof-of-work process involves scanning for a value that when hashed with SHA-256, the hash begins with a number of zero bits. The average work required is exponential in the number of zero bits required, but can always be verified by executing a single hash.

For the bitcoin timestamp network, it implements the mining process or "proof-of-work" by incrementing a nonce in the record or "block" until a value is found that gives the block's hash the required zero bits. Once the hashing effort has been expended to make it satisfy the proof-of-work, the block cannot be changed without redoing the work. As later records or "blocks" are chained after it, the work to change the block would include redoing all the blocks after it.

The majority decision is represented by the longest chain, which has the greatest proof-of-work effort invested in it. If a majority of computing power is controlled by honest nodes, the honest chain will grow the fastest and outpace any competing chains. To modify a past block, an attacker would have to redo the proof-of-work of the block and all blocks after it and then catch up with and surpass the work of the honest nodes. The probability of a slower attacker catching up diminishes exponentially as subsequent blocks are added.

To compensate for increasing hardware speed and varying interest in running nodes over time, the proof-of-work difficulty is determined by a moving average targeting an average number of blocks per hour. If they're generated too fast, the difficulty increases.

Today, bitcoin mining is a competitive field. An arms race has been observed through the various hashing technologies that are used to mine bitcoins and confirm transactions: High-end GPUs (Graphical Processing Units) common in many gaming computers, FPGAs (Field Programmable Gate Arrays) and ASICs (Application-specific integrated circuits) all have been used. The newest addition, ASICS, are built into specialized servers that can cost nearly $3000 USD a unit.

Computing power is often bundled together from various servers or "pooled" into a central server to more effectively confirm blocks of transactions. Single servers often have to wait relatively long periods of time to confirm a block of transactions and receive payment for their "work" or hashing. When resources are "pooled", all participating servers receive a proportional amount of the bitcoins earned every time any one participating server resolves a block.
Process

The steps to run the network and generate or "mine" bitcoins are:
1. New transactions are broadcast to all nodes.
2. Each node collects new transactions into a block.
3. Each node works on finding a difficult proof-of-work for its block.
4. When a node finds a proof-of-work, it broadcasts the block to all nodes.
5. Bitcoins are successfully collected or "mined" by the receiving node which found the proof-of-work.
6. Nodes accept the block only if all transactions in it are valid and not already spent.
7. Nodes express their acceptance of the block by working on creating the next block in the chain, using the hash of the accepted block as the previous hash.
8. Repeat.

Nodes always consider the longest chain to be the correct one and will keep working on extending it. If two nodes broadcast different versions of the next block simultaneously, some nodes may receive one or the other first. In that case, they work on the first one they received, but save the other branch in case it becomes longer. The tie will be broken when the next proof-of-work is found and one branch becomes longer; the nodes that were working on the other branch will then switch to the longer one.

New transaction broadcasts do not necessarily need to reach all nodes. As long as they reach many nodes, they will get into a block before long. Block broadcasts are also tolerant of dropped messages. If a node does not receive a block, it will request it when it receives the next block and realizes it missed one.

Mined bitcoins
By convention, the first transaction in a block is a special transaction that starts a new coin owned by the creator of the block. This adds an incentive for nodes to support the network, and provides a way to initially distribute coins into circulation, since there is no central authority to issue them.

The steady addition of a constant of amount of new coins is analogous to gold miners expending resources to add gold to circulation. In this case, it is computing power and electricity that is expended.

The incentive can also be funded with transaction fees. If the output value of a transaction is less than its input value, the difference is a transaction fee that is added to the incentive value of the block containing the transaction. Once a predetermined number of coins have entered circulation, the incentive can transition entirely to transaction fees and be completely inflation free.

Local system resources
Once the latest transaction of a coin is buried under enough blocks, the spent transactions which preceded it can be discarded in order to save disk space. To facilitate this without breaking the block's hash, transactions are hashed in a Merkle tree, with only the root included in the block's hash. Old blocks can then be compacted by stubbing off branches of the tree. The interior hashes need not be stored.

A block header with no transactions would be about 80 bytes. Supposing that blocks are generated every 10 minutes, 80 bytes × 6 × 24 × 365 = 4.2 MB per year. With computer systems typically selling with 2 GB of RAM as of 2008, and Moore's law predicting current growth of 1.2 GB per year, storage should not be a problem even if the block headers need to be kept in memory.


Hardware
Users have used various types of hardware over time to mine blocks. Hardware specifications and performance statistics are detailed on the Mining Hardware Comparison page.

CPU Mining
Early Bitcoin client versions allowed users to use their CPUs to mine. The advent of GPU mining made CPU mining financially unwise. The option was therefore removed from the Bitcoin client.

GPU Mining
GPU Mining is drastically faster and more efficient than CPU mining. See the main article: Why a GPU mines faster than a CPU. A variety of popular mining rigs have been documented.

FPGA Mining
FPGA mining is a very efficient and fast way to mine, comparable to GPU mining and drastically outperforming CPU mining. FPGAs typically consume very small amounts of power with relatively high hash ratings, making them more viable and efficient than GPU mining. See Mining Hardware Comparison for FPGA hardware specifications and statistics.

ASIC Mining
An application-specific integrated circuit, or ASIC, is a microchip designed and manufactured for a very specific purpose. ASICs designed for Bitcoin mining were first released in 2013 and (at the time of this writing) are in the hands of a very limited number of miners. For the amount of power they consume, they are expected to be vastly faster than all previous technologies and will likely make GPU mining financially unwise.


Payment verification
It is possible to verify bitcoin payments without running a full network node. A user only needs to keep a copy of the block headers of the longest proof-of-work chain, which he can get by querying network nodes until he is convinced he has the longest chain, and obtain the Merkle branch linking the transaction to the block it is timestamped in. He can not check the transaction for himself, but by linking it to a place in the chain, he can see that a network node has accepted it, and blocks added after it further confirm the network has accepted it.

As such, the verification is reliable as long as honest nodes control the network, but is more vulnerable if the network is overpowered by an attacker. While network nodes can verify transactions for themselves, the simplified method can be fooled by an attacker's fabricated transactions for as long as the attacker can continue to overpower the network. To protect against this, alerts from network nodes detecting an invalid block prompt the user's software to download the full block and verify alerted transactions to confirm their inconsistency. Businesses that receive frequent payments will probably still want to run their own nodes for more independent security and quicker verification.

1 comment:

  1. Great article with excellent idea!Thank you for such a valuable article. I really appreciate for this great information.. mining bitcoin in iran

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...