Bitcoin mining is a process of assembling transactions into a block, and find a SHA-256 hash of that block which is smaller or equal to the target. Although there are lots of technical challenges, conceptually it is an extremely easy process.
Let me explain what bitcoin mining is about in few lines of code
As you can see, I print out hash every 10000 iteration to save some space. At the end, I found a hash which is smaller than target. Is that it? Yes! This is all about bitcoin mining, and lots of other crypto mining processes are very similar.
In reality, the object won’t be a string. Instead, it is an object containing all transaction information along with other meta data, and encoded into binary form.