articles

Block hashing algorithm - Bitcoin Wiki Bitcoin mining algorithmus

Содержание статьи

What is commonly referred to as Bitcoin “mining” is really the creation of a new block in the block chain. Instead of making block creation a relatively simple operation, Satoshi realized that only a computationally expensive operation, performed as a kind of lottery, would prevent forgers from subverting the digital currency. But for a computationally expensive operation, which costs CPU power and thus electricity, some kind of reward would be necessary. Otherwise, only people with nefarious intent would participate in block creation.

One of the most difficult problems in computer science is reversing a secure hash (finding an input text for a given output, the digital signature). Let me explain this problem in simple terms. Let’s assume the wealthy but terminally ill Alice wrote her will and stored it on her computer. Knowing that a computer can be hacked and the will can be altered, Alice digitally signed her will with the secure hash algorithm SHA-256. She then emailed the digital signature to all her friends, allowing them to check the validity of the document. Bob wants to hack into the computer and change Alice’s will so that he becomes the sole beneficiary, but he faces a problem: he needs to change the will in such a way that the widely distributed SHA-256 signature stays the same. Otherwise, everybody realizes that the will has been forged. This is the computationally difficult problem of reversing or brute-forcing SHA-256, or finding an input that matches a predefined output. Satoshi famously decided that in order to find a new block, people all over the world need to compete in reversing SHA-256, turning block creation into a global lottery.

But since this is a computationally intractable problem, Satoshi made it somewhat easier. You see, an exact match to the signature doesn’t need to be found, but merely a match that satisfies an inequality, or an inexact match. In other words, a signature that differs from the desired output signature by less than a given (and adjustable) number qualifies for the block reward. This number is adjusted downwards as mining difficulty increases, making the brute-forcing problem computationally harder and harder, thus maintaining the average block creation rate of one new block every 10 minutes. Controlling the "money supply" by keeping the block creation rate steady prevents runaway inflation.

Bitcoin Mining on a CPU   

Initially, Bitcoin miners simply ran Satoshi’s published code on their computers, adding more computers to gain an advantage over other miners. But when someone ported the mining algorithm to OpenCL (the C-like parallel language that allows graphics cards to act like a poor man’s supercomputer), the mining difficulty rose so much that mining on a CPU became obsolete. In other words, at that point, the cost of electricity for CPU-based mining vastly exceeded the Bitcoin revenue.

Solo Mining vs. Mining on Mining Pools

A solo miner participates in the block-searching lottery on his own, and goes empty most of the time. On the rare occasion when he does find a lock, he instantly gets 25 Bitcoins (plus a small transaction bonus). But solo mining makes sense only for massive mining operations, at, say, 50 GH/s and up. Most miners instead opt to participate in one of the dozens of mining pools (for instance deepbit.net or eligius.st), and thus benefit from a steady income in Bitcoins. Most, but not all, mining pools take a small percentage of the mining revenue to pay for server hosting and DDoS protection.

Это интересно:

Как добываются биткоины или что такое майнинг

A lot has been said and written in regards to Bitcoin Cash and its unusual mining difficulty algorithm. In a lot of cases, the mining difficulty adjusts in such a way that the altcoin becomes increasingly easy to mine when things go awry. A recent screenshot by Charlie Lee showed how the network sometimes generates dozens of blocks an hour before increasing the mining difficulty again, which in turn may cause network delays. It is certainly true that this may not necessarily represent Satoshi’s vision.

Bitcoin Cash’s EDA Still makes Little Sense

Whether you love it or hate it, you can’t deny that the Bitcoin Cash mining difficulty adjustment algorithm is a very intriguing creature. More specifically, this EDA can change the mining difficulty rather quickly. In most cases, the difficulty will lower as a way to speed up the network and ensure there is no backlog whatsoever. Once the mining power picks up again, the difficulty will readjust to increase the network time between blocks. It makes a lot of sense, but can sometimes lead to some odd side effects.

According to a screenshot shared by Litecoin founder Charlie Lee, the EDA may be working too well sometimes. In fact, the image he posted detailed 43 Bitcoin Cash blocks generated over the course of one hour. While that is not necessarily a bad thing, it could be viewed as a problem considering it means over 600 BCH were added to the circulating supply during that time. That rate is pretty alarming, as the erratic changes in time between blocks and rewards could cause some big consequences.

At the same time, such a “speeding up” of network blocks will eventually lead to a higher mining difficulty. When that happens, the time in between blocks may go up to several hours, which is less than ideal. This is certainly not the way Satoshi Nakamoto envisioned the evolution of the Bitcoin network whatsoever. Thankfully, the EDA is something that can be addressed by BCH developers, assuming they will ever be inclined to do so.

One thing that is worth taking into account is how this also influences the profitability of mining Bitcoin and Bitcoin Cash. A lower difficulty makes it more profitable to mine BCH over BTC, which means the Bitcoin network may struggle with its mempool every now and then. During times of high BCH difficulty, miners will often switch back to the main Bitcoin blockchain, leaving BCH hanging out to dry. It is far from an ideal situation for both networks; that much is rather evident.

Issues with the Bitcoin Cash mining difficulty algorithm have been discussed many times before. So far, the BCH developers don’t see a need to make any major changes, even though changes in block time are a bit erratic at times. At the time of writing, it is 60.5% more profitable to mine Bitcoin Cash than BTC itself. Then again, this has not affected Bitcoin network confirmation times just yet. One of our transactions got three confirmations within 20 minutes, which is pretty quick for a BTC transfer these days.

Moreover, during the writing of this article, we saw a total of 20 BCH blocks being discovered on the network. That is an absurd amount, to say the very least, as some blocks are literally coming twenty seconds apart. It is evident this situation will continue to spark debate moving forward and also speed up the inflation rate of Bitcoin Cash. As a result, the BCH price is taking a sharp nosedive right now, although there is no real reason to panic just yet.

биржа биткоинов ехмо.

The economics of mining Bitcoin » Brave New Coin

A few days ago, we talked about how the Bitcoin Cash mining adjustments were seemingly controlled in some way. Developer Gregory Maxwell alluded to as much not too long ago. We have now received a bit more evidence to further confirm these claims, although they still remain subject to interpretation. There certainly appears to be solid evidence of a bug affecting the difficulty retarget algorithm of Bitcoin Cash.

Bitcoin Cash’s Mining Difficulty Adjustment Boggles the Mind

Since the day the Bitcoin Cash network was launched, people have been questioning the way its mining difficulty adjusts. It is certainly true there have been some “profitable” changes in this regard. Not too long ago we saw the difficulty drop to as low as 7% compared to the original Bitcoin blockchain despite a growing amount of network hashpower. Lower difficulty and higher hashpower should be, under normal circumstances, mutually exclusive except for a brief moment. However, this situation has remained active for some time.

As a result, there were a ton of blocks mined on the Bitcoin Cash network. That also resulted in large amounts of BCH being mined, so much even that the Bitcoin Cash blockchain is now slightly ahead of Bitcoin’s in size and block height. This is an interesting development, although it was only a matter of time until this happened due to the 8MB block size as compared to 1MB. After the mining difficulty was adjusted to 30% of that of the Bitcoin blockchain, profitability suddenly plummeted by a whopping 200%.

It is not entirely strange we would see the profitability change by such a large margin. What is rather disconcerting is how exactly this difficulty adjustment algorithm works. A few days ago, we reported on Gregory Maxwell’s comments that this technology is seemingly based on some very unusual conditions. As a result, mining pools – or even small mining operations – could take advantage of this algorithm and improve their overall profitability. Manipulating the mining difficulty of the entire network is often frowned upon, for obvious reasons.

According to new evidence emailed to us by JM, it certainly appears there is a bug in the difficulty adjustment algorithm. Whether this was added intentionally or is merely a major oversight by the development team remains to be determined right now. It certainly appears Bitcoin Cash is susceptible to price manipulation and attack by miners. The bug allows the timestamps of network blocks to be altered, which could speed up the mining process. It would certainly explain why so many miners have flocked to BCH these past two days, as they were finding blocks on the network quickly.

Based on the code, the Bitcoin Cash difficulty adjustment algorithm trusts these timestamps on blocks created by the miner. Any malicious miner could effectively exploit this trust and mine more blocks at an increased rate. In fact, one could effectively make the algorithm retarget without causing an actual network attack. This is a very disturbing development, to say the least, and one that does not bode well for the BCH network as a whole. As a result, we see an inflated mining income which can be used for short-term gains by both miners and the Bitcoin Cash developers accordingly.

Considering that Bitcoin Cash boasts the largest Bitcoin blockchain at the time of writing, it appears this “bug” was coded in on purpose. Making this altcoin stand out from Bitcoin would require trickery of some sort, including ensuring the chain is larger compared to Bitcoin’s. Unfortunately, it will not enjoy this status for long, as the current mining difficulty makes it nearly impossible to mine new BCH blocks. Eventually, the Bitcoin network will catch up without too many issues and things will go back to normal.

hashflare.io отзывы.

How does Bitcoin Mining work? - The Bitcoin News

From Bitcoin Wiki

A proof of work is a piece of data which is difficult (costly, time-consuming) to produce but easy for others to verify and which satisfies certain requirements. Producing a proof of work can be a random process with low probability so that a lot of trial and error is required on average before a valid proof of work is generated. Bitcoin uses the Hashcash proof of work system.

One application of this idea is using Hashcash as a method to preventing email spam, requiring a proof of work on the email's contents (including the To address), on every email. Legitimate emails will be able to do the work to generate the proof easily (not much work is required for a single email), but mass spam emailers will have difficulty generating the required proofs (which would require huge computational resources).

Hashcash proofs of work are used in Bitcoin for block generation. In order for a block to be accepted by network participants, miners must complete a proof of work which covers all of the data in the block. The difficulty of this work is adjusted so as to limit the rate at which new blocks can be generated by the network to one every 10 minutes. Due to the very low probability of successful generation, this makes it unpredictable which worker computer in the network will be able to generate the next block.

For a block to be valid it must hash to a value less than the current target; this means that each block indicates that work has been done generating it. Each block contains the hash of the preceding block, thus each block has a chain of blocks that together contain a large amount of work. Changing a block (which can only be done by making a new block containing the same predecessor) requires regenerating all successors and redoing the work they contain. This protects the block chain from tampering.

The most widely used proof-of-work scheme is based on SHA-256 and was introduced as a part of Bitcoin. Some other hashing algorithms that are used for proof-of-work include Scrypt, Blake-256, CryptoNight, HEFTY1, Quark, SHA-3, scrypt-jane, scrypt-n, and combinations thereof.

Example

Let's say the base string that we are going to do work on is "Hello, world!". Our target is to find a variation of it that SHA-256 hashes to a value beginning with '000'. We vary the string by adding an integer value to the end called a nonce and incrementing it each time. Finding a match for "Hello, world!" takes us 4251 tries (but happens to have zeroes in the first four digits):

"Hello, world!0" => 1312af178c253f84028d480a6adc1e25e81caa44c749ec81976192e2ec934c64
"Hello, world!1" => e9afc424b79e4f6ab42d99c81156d3a17228d6e1eef4139be78e948a9332a7d8
"Hello, world!2" => ae37343a357a8297591625e7134cbea22f5928be8ca2a32aa475cf05fd4266b7
...
"Hello, world!4248" => 6e110d98b388e77e9c6f042ac6b497cec46660deef75a55ebc7cfdf65cc0b965
"Hello, world!4249" => c004190b822f1669cac8dc37e761cb73652e7832fb814565702245cf26ebb9e6
"Hello, world!4250" => 0000c3af42fc31103f1fdc0151fa747ff87349a4714df7cc52ea464e12dcd4e9

4251 hashes on a modern computer is not very much work (most computers can achieve at least 4 million hashes per second). Bitcoin automatically varies the difficulty (and thus the amount of work required to generate a block) to keep a roughly constant rate of block generation.

In Bitcoin things are a bit more complex, especially since the header contains the Merkle tree which depends on the included transactions. This includes the generation transaction, a transaction "out of nowhere" to our own address, which in addition to providing the miner with incentive to do the work, also ensures that every miner hashes a unique data set.

List of algorithms

Traditional proof of work

Proof of X

  1. Proof of Stake
  2. Proof of Burn

Consensus

  1. Stellar Consensus Protocol

References

Distribution of nonces and hashes

bitcointalk.org cloak.

GUIminer - инструмент для GPUCPU-майнинга Bitcoin в ОС .

<< Go back to the previous page

Похожие статьи