1

I know Javascript is not the Language for this matter, however i believe it's the easiest to understand and would be very easy to anyone to port to any other language.

what i am trying to understand is how do i "hash" transactions, "create my own 12.5" transaction concat, append, rehash, hash it once again... as i see here and there... it all seems very confusing, anyone could explain a bare basic implementation of step by step on what is needed in order to create a valid btc block?

my ultimate goal is to get any random block here https://blockexplorer.com/, and using the exactly same nonce as input recreate the same result

1 Answers1

0

Your question involves quite a bit.
Mining is done with conjunction of a wallet.
A lot of the work is handled by the wallet.
See the RPC getblocktemplate
Also run help getblocktemplate to see more information, that will point you to a few BIPs (B22, 23, 9, and 145) for further reading.

Basically (simplified) you do a getblocktemplate and then you repeatedly hash it (while incrementing the nonce) to get a hash that meets the difficulty criteria.

I hope this is enough information to get you started

Albert S
  • 1,630
  • 12
  • 21