Difficulty
In Bitcoin, difficulty is a value that shows how challenging it is to find a valid block during mining. To add a block, miners must solve a puzzle: they try to produce a block hash—a large number—that’s less than a target set by the network. This target acts as a threshold. If the hash is lower than the target, the block is valid.
Difficulty isn’t fixed; it automatically adjusts every 2016 blocks, or about every two weeks. The idea is to keep new blocks appearing roughly every 10 minutes, no matter how many miners are participating. If blocks are being found too quickly because more miners have joined, the network increases the difficulty by lowering the target. If blocks are too slow, the difficulty decreases by raising the target. So, the difficulty tracks changes to the network’s hash rate.
Technically, Bitcoin sets the “target” value, and the term “difficulty” refers to how much harder mining is compared to when Bitcoin first started. A lower target means a higher difficulty, making mining tougher. This target is recorded in each block’s header as a field called 'bits', allowing every node to easily check whether a block’s Proof-of-Work meets the challenge.
