How exactly does #bitcoin hashing work? What information is being processed in the sha256 algorithm? Why/how does a node accept a block as valid?

Something with nonces but I'm not sure

#asknostr

Reply to this note

Please Login to reply.

Discussion

bump lol

This isn't really exact, many details are missing, but in essence the block content (transaction data) + hash of the previous block + the nonce (big random number) are hashed and the block is regarded as valid if the hash, interpreted as a big number, is smaller (i.e. it has enough leading zeroes) than a certain value which is specified by the current difficulty level.

If the hash doesn't fit this description, another nonce is tried until a fitting hash is found.

The block content (TX data) is what confused me, because blocks are individually constructed and altered constantly. But it makes sense if miners hash until the leading zeros match with the difficulty number. In that case the TX data and nonce can be anything (within parameters). Thanks!

I think this is enough to understand without going too deep