Then I want to ask a question on how you generated the SHA 256 hash for 21,000,000... was there any encoding or let me just ask how??
Right, important. So, let me explain what's going on when I say that
you hash the number 21 million.
A hash function, as we all know, is a function that maps data of arbitrary size to a fixed-size output. The data that it takes as input usually comes in chunks of bytes. In
this Github page, you can hash any value you want, with any encoding you want. In Bitcoin, OP_SHA256 takes as input bytes, with
little endian order. This means that hashing the number 21 million in Bitcoin would look like this:
- Convert the number 21 million into hexadecimal, so that it's easier to manipulate. (You can use rapidtables.com)
- 21000000 = 0x1406F40
- Convert it to little endian: 0x406F4001 (Used this tool)
Now you need to pass these bytes (0x406F4001) into SHA256 using the Github page I posted above. It'll give you 0xdf3984c3d89ec61f93f2d3060263bbb960a885ffa5d41ca1eb9c2692de71d8b7.
It should be through trial and error because SHA256 can't be decoded
Since it's a one way encryption.
Important corrections:
- This is not analogous to trial and error. When your input fails to produce the given hash, it does not give you any insights for your future selections, as with any cases where trial and error takes place (i.e., chess). What you probably meant is through brute force.
- Hashes, while used in encryption, are not encrypting anything, per se. It's a one way function. It simply digests a message.
- Encoding exists only in the input. For example, if you're hashing binary, will it be hex, or Base64? If you're hashing Text, will it be UTF-8?