In the validation of a block it is said that a miner has a valid block if the transactions can be tracked in the chain and the hash of the block header is less than the difficulty. I am having a hard time seeing the relationship in real world blocks that are being solved.
For Example from Block#496785 :
Difficulty("target") = 1,347,001,430,558.57 or in hex 000000000000000000000000000000000000000000000000000001399F8AB21E
Mined Hash = 000000000000000000cf3620d570d08d1799a1cafbbfae512fdba2124665eca0
so it seems to me the hash is now greater than the difficulty so an invalid block but this is obviously not the case.
I have heard also that the difficulty is related to the number of leading zeros after the maximum target in which case may make sense where 1399F8AB21E is a 11 byte number and the hash after the default 8 byte leading target contains 10 bytes which is less than the difficulty 11 bytes of zeros.
00000000 0000000000 cf3620d570d08d1799a1cafbbfae512fdba2124665eca0 8 bytes difficulty some value
Is this correct? How does this work?