24 votes
Accepted

What is the exact "longest chain" rule implemented in the Ethereum "Homestead" protocol?

Ethereum determines the longest chain based on the total difficulty, which is embedded in the block header. Ties are broken randomly. Total difficulty is the simple sum of block difficulty values ...
Nick Johnson's user avatar
  • 8,154
21 votes

How do I decrease the difficulty on a private testnet?

You can make the difficulty static by modifying the CalcDifficulty in Geth to return a static number. Example: func CalcDifficulty(config *ChainConfig, time, parentTime uint64, parentNumber, ...
eth's user avatar
  • 85.8k
21 votes
Accepted

How is the Mining Difficulty calculated on Ethereum?

From https://github.com/ethereum/EIPs/blob/master/EIPS/eip-2.md: Mining difficulty is calculated from the time difference between blocks. The exact formula will change in Homestead. The symbol // in ...
MrChico's user avatar
  • 1,786
20 votes
Accepted

How does the Ethereum Homestead difficulty adjustment algorithm work?

Summary If the timestamp difference (block_timestamp - parent_timestamp) is: < 10 seconds, the difficulty is adjusted upwards by parent_diff // 2048 * 1 10 to 19 seconds, the difficulty is left ...
BokkyPooBah's user avatar
  • 40.3k
16 votes
Accepted

How to make Ethereum mining difficulty static for a private chain?

Modify the CalcDifficulty in Geth to return a static number, then rebuild Geth. Example: func CalcDifficulty(config *ChainConfig, time, parentTime uint64, parentNumber, parentDiff *big.Int) *big.Int ...
eth's user avatar
  • 85.8k
15 votes
Accepted

Why are there no leading zeroes in ethereum block hash?

In the Ethereum blockchain, the difficulty is used to calculate a target. Here are the ethminer logs for block number 1257006: ℹ 35:02:42.89 ethminer Solution found; Submitting to http://192.168.4....
BokkyPooBah's user avatar
  • 40.3k
14 votes
Accepted

When will the difficulty bomb make mining impossible?

According to Vitalik Buterin on r/ethereum, the difficulty bomb was slowed down with homestead a bit. As it turns out, with the change in the difficulty adjustment algorithm brought about in the ...
q9f's user avatar
  • 32.9k
12 votes
Accepted

Difficulty and total difficulty

These are explained on the wiki in the JSON RPC README, under the entry for eth_getBlockByHash(). difficulty: QUANTITY - integer of the difficulty for this block. totalDifficulty: QUANTITY - ...
Richard Horrocks's user avatar
9 votes

When will the difficulty bomb make mining impossible?

The changes to the code were made in August in this commit, with the meaty parts of the maths being found in core/chain_util.go. The constant increase in difficulty is due to an additional ...
Richard Horrocks's user avatar
9 votes

Why are there no leading zeroes in ethereum block hash?

What you see in block explorers is the sha3 of the block header, not the ethash.
Yaron Welner's user avatar
8 votes

Difficulty and total difficulty

As Richard already pointed out, the difficulty is the current quantitative measure how hard it is to brute force ('mine') a block. The total difficulty is the accumulated sum of all blocks difficulty ...
q9f's user avatar
  • 32.9k
8 votes

How do I decrease the difficulty on a private testnet?

As seen in this blog difficulty A scalar value corresponding to the difficulty level applied during the nonce discovering of this block. It defines the mining Target, which can be calculated from ...
niksmac's user avatar
  • 9,673
7 votes
Accepted

How do I decrease the difficulty on a private testnet?

There are 2 ways to do this: Change the value of difficulty parameter in genesis.json file to a small number(preferably set it to 0). You can refer to this example genesis file { "config": { ...
Vaibhav Saini's user avatar
7 votes

What is Terminal Total Difficulty (TTD)?

Terminal Total Difficulty (TTD) specifies the final, terminal Proof of Work block, after which the Proof of Stake consensus (implemented in the Beacon Chain) takes over. Pictorially: TTD is the total ...
eth's user avatar
  • 85.8k
5 votes

Why is avg. block time growing so much latley

This is due to the Ethereum 'Ice Age' - an incentive implemented in the code to switch from the current Proof of Work consensus mechanism to a Proof of Stake consensus mechanism or as Vitalik puts it ...
SteveJaxon's user avatar
  • 2,528
4 votes

How do I decrease the difficulty on a private testnet?

You can follow this tutorial with detailed explanation: http://blog.coinfabrik.com/fast-smart-contracts-execution-ethereum-private-blockchain-development-environment/
Paul Exchange's user avatar
4 votes
Accepted

Can I control the time for confirmation?

No, you can only control the confirmation time through the difficulty of the blockchain which in turn depends on the mining resources allocated for the respective private net. You can set a "small" ...
Sebi's user avatar
  • 5,294
4 votes
Accepted

Are there any drawbacks for making difficulty static on a private chain?

Are there any drawbacks for making difficulty static on a private chain? One potential problem would be that you can't add further hashing power without changing the block time. Making the ...
Richard Horrocks's user avatar
4 votes

What is the exact "longest chain" rule implemented in the Ethereum "Homestead" protocol?

Things have changed since the answer by Nick was posted. Especially, with introduction of EIP 100 (which was accepted in June 2017 - just 3 months after Nick's answer) which changes the difficulty ...
dufferZafar's user avatar
4 votes
Accepted

What does the difficulty value represent in a Geth genesis block config?

The difficulty value here is the reciprocal of the probability that the hash for mining the first block is "good" and that the block gets included in the blockchain. For example, in the Ethereum main ...
lungj's user avatar
  • 6,680
4 votes
Accepted

What is Terminal Total Difficulty (TTD)?

Literally, it means the timing to fork when the total difficulty over this value. Please refer to the Ropsten Merge Announcement https://blog.ethereum.org/2022/05/30/ropsten-merge-announcement/ "...
Quincy C's user avatar
3 votes
Accepted

How difficulty is related to mining in ethereum blockchain ?

Difficulty is proportional to hash power. The Ethash algorithm increases difficulty by increasing it if the last blocks have been found in shorter time than usual and decreases it if it was found in ...
Roland Kofler's user avatar
3 votes

How to calculate difficulty of genesis block?

The difficulty for the genesis block, along with all the other parameters, is hard coded into the Ethereum clients. It is not calculated. More information about genesis block can be found here. The ...
galahad's user avatar
  • 3,920
3 votes
Accepted

What happens if the block time changes to 5 seconds?

One thing to consider would be the orphan rate, which is alluded to in the comments for the thread you linked to. The lower you set the difficulty, the shorter the block time, which is what you're ...
Richard Horrocks's user avatar
3 votes
Accepted

What happened in 2016 so that "2GB cards stopped working" for mining?

see here The issue is to do with the DAG file size, which is loaded onto GPU memory in order for the ethash algorithm to call pieces of it during the hashing process. The DAG file grows with time, ...
TC8's user avatar
  • 1,260
3 votes

Does Geth Clique will get affected when difficulty increases to its maximum?

In Clique Proof-of-Authority consensus algorithm the difficulty does not increase with the chain lenght (unlike the Proof-of-Work). In fact the term of "difficulty" is not relevant in PoA as ...
clement's user avatar
  • 4,302
3 votes

What is Terminal Total Difficulty (TTD)?

Terminal Total Difficulty is just a specific Total Difficulty value (totalDifficulty). You need to understand the Merge in order to understand what this value is. Let me explain. As you said, the ...
Winston Smith's user avatar
2 votes

How does the Ethereum Homestead difficulty adjustment algorithm work?

Ethereum's algorithm would have been better if the max() had not been used. The parent_diff/2048*(1-t/10) could have been expanded to prevent the zero that results from integer division. This would ...
zawy's user avatar
  • 21
2 votes
Accepted

Calculating difficulty and verifying a hash as a solution

Your calculation are correct. Let says X=1 the event a hash is "valid", and X=0 if is not valid (X is called "Bernoulli random variable" Bernoulli Distribution). Now we have P(X=1) = D/2^256 where D ...
2 votes

Ethereum Difficulty History? Percentages not a chart

I've got the following raw data from by viewing the source at https://etherscan.io/charts/difficulty . data: [ {y : 0.121, dt : 'Thursday, July 30, 2015', },{y : 0.603, dt : 'Friday, July 31, 2015', ...
BokkyPooBah's user avatar
  • 40.3k

Only top scored, non community-wiki answers of a minimum length are eligible