Author

Topic: How is target and difficulty related? (Read 562 times)

hero member
Activity: 714
Merit: 662
April 19, 2014, 07:33:13 PM
#4
I implemented that code yestersday.
https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin/Target.cs

You will find some test sample at
https://github.com/NicolasDorier/NBitcoin/blob/master/NBitcoin.Tests/util_tests.cs
In the test CanReadConvertTargetToDifficulty

This take Target from differelsnt form (packed and unpacked) and calculate difficulty from it.
legendary
Activity: 1862
Merit: 1011
Reverse engineer from time to time
April 19, 2014, 03:24:09 PM
#3
The difficulty is a human-readable representation of the target, just for us to be more comfortable with it.
legendary
Activity: 966
Merit: 1001
April 19, 2014, 07:48:11 AM
#2
You can find the info in details in the wiki.
For your reference: https://en.bitcoin.it/wiki/Difficulty#What_is_the_formula_for_difficulty.3F
hero member
Activity: 770
Merit: 504
April 17, 2014, 12:49:15 PM
#1
As I understand, the difficulty is the number of hashes, divided by 2^32, required (in average) in order to get a SHA-256 below a target value T. And further, that the target value is actually what is adjusted in the algorithm. Is it then correct that D*(2^32)=(2^256)/T ? Or have I got it wrong here?
Jump to: