cool_python_apps icon indicating copy to clipboard operation
cool_python_apps copied to clipboard

And How it goes to wallet ?

Open amaendeepm opened this issue 4 years ago • 4 comments

How this code https://github.com/codebasics/cool_python_apps/blob/main/2_bitcoin_mining/bitcoin_mining.py sends mined qty to wallet ?

amaendeepm avatar Jan 29 '21 08:01 amaendeepm

This isn't a true Bitcoin miner, but more of a proof of concept on how mining works. It only mines a single simulated block

zevaryx avatar Mar 01 '21 17:03 zevaryx

Yeah! as zevaryx mentioned above, this code only has demo purposes to get the idea and concept of mining.

AdrianViverosL avatar Apr 14 '21 05:04 AdrianViverosL

And where can I find a TRUE script to mine bitcoins to my wallet, I changed the code, and now is in a loop so is just mining and mining and all of that. so where can I find one that sends the bitcoins to my wallet?

bener07 avatar Jun 07 '21 21:06 bener07

For various reasons, that would be a terrible idea.

tl;dr is that you can't directly mine BTC with standard computers anymore, ignoring that this code is just a proof of concept.

Full reasons:

  • Bitcoin mining is astronomically difficult to compute with normal computers, even with GPU acceleration. You typically mine it with something called an ASIC miner, but not with a normal PC
  • Most mining programs are written in much lower languages than Python, like C/C++, and have very well-optimized algorithms that they use, typically taking advantage of SSE and AVX instructions on CPUs, and OpenCL or CUDA processing on GPUs. This type of optimization is not possible with Python (at least, not without writing a good portion of the code in C and importing it)
  • This code doesn't actually mine anything, but merely simulates what mining would be like. Mining requires accessing the blockchain, synchronizing, validation, and mining. This code does none of that, merely simulating something similar to mining.

zevaryx avatar Jun 08 '21 19:06 zevaryx