21

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, parentDiff *big.Int) *big.Int { return big.NewInt(1) } Rebuild Geth and use your modified version. Source: Answer to Is it possible to change the block target ...


21

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 without explicitly counting uncles. Difficulty is computed based on parent difficulty and timestamp, block timestamp, and block number, again without reference to ...


18

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 unchanged >= 20 seconds, the difficulty is adjust downwards proportional to the timestamp difference, from parent_diff // 2048 * -1 to a max downward adjustment ...


18

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 the following denotes integer division. Frontier: block_diff = parent_diff + parent_diff // 2048 * (1 if block_timestamp - parent_timestamp < 13 else -1) + ...


17

The difficulty bomb is a part of the consensus algorithm; its goal is to make the difficulty of mining a block arbitrarily hard at some point in the future. When active, it will get increasingly hard for miners to create new blocks and therefore will get block rewards less frequently; which means less revenues. Exponentially. From the blog: starting from ...


15

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 { return big.NewInt(0x4000) } Source: Answer to Is it possible to change the block target time?


14

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 last hardfork, the ice age will come very slowly indeed. Originally, the maximum amount by which the difficulty could adjust was 1/2048x, and so given a natural ...


14

The mined block is an uncle. The uncle reward formula is (U_n + 8 - B_n) * R / 8 where R is the static reward of 5, U_n is the uncle number and B_n is the block numer, so: Uncle 0 : 4.375 ETH Uncle 1 : 3.750 ETH Here's an example: B_n = 1337, R = 5 U_0 = (1336 + 8 - 1337) * 5 / 8 == 4.375 U_1 = (1335 + 8 - 1337) * 5 / 8 == 3.750


14

If you got 3.75 ether, this was an uncle mining reward. Kind of the "second place" of mining on Ethereum. You found a solution but someone else found the solution before you. Thankfully for you, it was soon enough from the original block that a reward was paid out. It's still 5 ether per block for a mining reward. Update: As of Oct-16-2017 05:22:11 AM +UTC ...


11

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.120:8545 ... ℹ 35:02:42.89 ethminer Nonce: ff4136b6b6a244ec ℹ 35:02:42.89 ethminer Mixhash: ...


9

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 exponentiation step in the algorithm. A quick back-of-the-envelope calculation can be found here, and would suggest that after 22 months (from August 2015) the average ...


8

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 the previous block’s difficulty level and the timestamp. The higher the difficulty, the statistically more calculations a Miner must perform to discover a valid ...


8

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 - integer of the total difficulty of the chain until this block. [ Where the difficulty itself is a measure of how difficult it is for a miner to mine a new ...


8

What you see in block explorers is the sha3 of the block header, not the ethash.


6

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 till the block you queried. I recently learned, this is the best indicator for the longest chain, i.e., for a client to determine in case of a fork which chain ...


6

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": { "chainId": 1994, "homesteadBlock": 0, "eip155Block": 0, "eip158Block": 0, "byzantiumBlock": 0 }, "difficulty": "0x0", //...


5

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 to "prevent protocol stagnation". From a Tweet Vitalk made:


4

You can follow this tutorial with detailed explanation: http://blog.coinfabrik.com/fast-smart-contracts-execution-ethereum-private-blockchain-development-environment/


4

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" difficulty in the genesis block and see the average confirmation time for a block (you'll have to run a few tests with the miner of your choice). Adjust the ...


4

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 difficulty static This is achieved by changing the difficulty adjustment algorithm code so that it returns a static value, instead of calculating any changes in ...


3

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 aiming for. However, the lower the difficulty, the greater the chance of multiple miners solving the block at the same time, and the chain forking. This ...


3

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 Genesis block is pretty much a database file: it contains all the transactions from the Ether sale, and when a user inputs it into the client, it represents ...


3

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 lower time. So that in average a ~14s blocktime is achieved. A static difficulty would decrease the average blocktime as more miners join. Eventually the mining ...


3

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 calculation algorithm to include Uncles. I'm new to Ethereum so I don't fully understand what effect this has so if someone could explain it, that'll be great. ...


3

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 net, this value is 0x400000000, or 17179869184 in decimal. So about one in 17179869184 hashes lead to a valid block. If the total hash power of miners is ...


3

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, so as it gets bigger graphics cards will become obsolete if they can't hold the full file in their memory. While this seems like a pain, this memory-intensive ...


2

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', },{y : 0.887, dt : 'Saturday, August 1, 2015', },{y : 1.020, dt : 'Sunday, August 2, 2015', },{y : 1.126, dt : 'Monday, August 3, 2015', },{y : 1.217, dt : '...


2

In short it increases/decreases the number of computations (time needed) to solve the proof-of-work puzzles to adjust the actual mining time to the target mining time.


2

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 is the number of valid solutions (and P(X=0) = 1 - D/2^256). Let says you can make H hashes per week. Then we have X_1, X_2,... X_H that says if the k-ism hash ...


2

Uncles are there to incentivise miners despite the fact that fast blocks give undue advantage to well-connected miners. Look up the GHOST protocol. If the calculations needed to create an uncle were factored into adjusting the difficulty, it would make the blocks slower. Edit: In the world of hash calculations, "nearly identical work" is misleading. There ...


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