Is there a desktop C++/Python library to take a raw hex bitcoin block as input and then break it down to various parameters and print it.

Moreover it should be able to validate the structure of a bitcoin block based on all the latest protocols and rules. I don't have the bitcoin core and can't afford to download 400GB but what i want to achieve is the following:

  1. Get the latest block number, its hash and bits from online. - this part is not difficult.
  2. Manually lower the bits/difficulty so that mining is much easier (for testing sake).
  3. Create a coinbase transaction in hex (by hand) using some existing wallet address.
  4. Using the coinbase transaction above create a block header and get the valid hash for lowered bits.
  5. Completely create a new Coinbase Block in hex.
  6. Validate using the library if the Coinbase Block created is structurally sound according to all the rules and protocols. In other words, if the difficulty was the lower one as we assumed, the block would have been valid and mined on the 'mainnet'.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.