Post
Topic
Board Development & Technical Discussion
Re: How to get <target> values for a block?
by
odolvlobo
on 22/12/2022, 20:27:13 UTC
User HoBzY posted a question in this sub-forum, but it seems that the thread got locked (maybe on purpose, maybe on accident).
Here's a link to the original question:
https://bitcointalk.org/index.php?topic=5428781.0
How do you get 422681968 nbits out of 86564599.52 complexity?

I suspect that HoBzY's confusion stems from the name nBits.

The term comes from the name of the variable in the code and it does not stand for "number of bits".

Satoshi used a (mostly deprecated) variable naming scheme invented at Microsoft called Hungarian Notation. In this scheme, the name is prefixed by a symbol that represents the variable's type. In the case of nBits, the prefix is n, which says that the variable is an integer.

So, the name nBits indicates that it represents bits in the form of an integer. A very poorly named variable in my opinion, since bits says nothing about what the variable contains.