What is the program in Python that print information about the current block the world try to mine (I mean Version, Previous Block, Merkle Root, Time, Bits) plus how many zeros we are looking for for the output of the hash!
To take the information of the bitcoin blockchain, you can use the bitcoin core RPC Framework, for use it, you must have all blockchain on your computer
- Download Bitcoin core
- aligns the bitcoin node
- Configure rpc framework
- Use the API to take the information, I prefer using this library with python, this is an example for using it
You can use this documentation for study API
also for a response to the last comment, you can use the API for call the Mining commands but is difficult understand your question "I can print information about the block they're mining now" because the mining is a war for the node and each node can have different information
information about the current block the world try to mine
The world is concurrently trying to mine many different blocks which only have the block height and target (bits/difficulty) in common and therefore have a common prior block hash.
(I mean Version, Previous Block, Merkle Root, Time, Bits)
previous block and
bits are common to all concurrent mining effort globally,
Merkle root and
time are things effectively chosen by individual miners (or pools) and therefore differ from miner to miner.
To get the target and the hash of the top block, you need to interrogate either a node that you run (e.g. Bitcoin core as vincenzopalazzo suggested) or a public node such as a blockchain explorer. Both have APIs but the APIs differ. There may be Python libraries you can use but which libraries you should use, if any, will depend on which source you select.
Bitcoin core's API has functions useful for constructing block templates.
plus how many zeros we are looking for for the output of the hash!
None. Bitcoin does not ever consider the number of leading zeroes. Adam Black's "HashCash" unimplemented proposal used number of binary leading zeroes but Nakamoto's "Bitcoin" did something different though partially inspired by Hashcash.
The test in Bitcoin is a simple numeric comparison of
hash <= target where the target is obtained by expanding the
bits you mentioned before and recalculating the next value when appropriate (when block height is a multiple of 2016).