0
When bitcoin miners mine, they have to solve a difficult and extremely repetitive math problem using the SHA256 algorithm. The miners are trying (basically playing lottery and almost always working in large groups) to get a hash with (currently) at least ~18.81 zeroes. (I put a decimal/float number because the value is inconsistent.) But, I want to put the hash into a hash function and get that super hard-to-compute number for a story I have where a superhero calculates this number. How do I get this string (nonce) that calculates to this zeroed hash and where do I find this on a block explorer, such as blockchain.com, or on bitcoin-cli?
Sorry, I'm not secure to undestend the your question, you want have a method for calculate the nonce and you want find the nonce on the explorer, right? – vincenzopalazzo – 2019-08-25T13:39:48.783
Yeah. That’s what I wanted to do. The nonce has already been computed. – Number File – 2019-08-25T13:45:16.670
1
Bitcoin PoW uses double SHA256, sometimes written SHA256d. See https://en.bitcoin.it/wiki/Block_hashing_algorithm for the format of the block header an example. Note this data is binary (aka bits) and 'string' is usually used in computing for characters, so if you are using a program or API designed to hash 'strings' it may not work for bitcoin, although some languages like C++ and python2 do support arbitrary binary strings.
– dave_thompson_085 – 2019-08-25T15:15:20.397That’s true, I did some research and found that you can get the info as the block heading/header – Number File – 2019-08-25T16:24:12.103