Author

Topic: Python3 CPU mining (Read 365 times)

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
July 05, 2022, 01:47:50 AM
#10
Maybe you're planning to run this in the background of a website and utilize viewer hardware to mine some BTC? 

If that is the case then OP should re-implement the miner in WebAssembly and JS, because 1) Python can't run in browser scripts and 2) even if it could, it would be much more inefficient than if it was written in assembly, or some pseudoassembly language like C [or WebAssembly].
hero member
Activity: 952
Merit: 938
July 05, 2022, 12:50:53 AM
#9
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.
~snip~
Any help or guidance would be appreciated.
~snip~

Have a look here:

https://github.com/jgarzik/pyminer

It's basically what you are trying to do:

#Pyminer

This is a 'getwork' CPU mining client for bitcoin.

It is pure-python, and therefore very, very slow.  The purpose is to
provide a reference implementation of a miner, for study.

##In order for this software to run you must build and run bitcoind from source on your computer.
legendary
Activity: 2405
Merit: 1459
-> morgen, ist heute, schon gestern <-
June 26, 2022, 05:32:20 PM
#8
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.
https://github.com/ORP967/BTC_RPC_Mining
I'm able to connect to my RPC and get the getblocktemplate information. I just don't know where to go from there. Any help or guidance would be appreciated.
I tried implementing pyminer.py and pyminer3.py but they both use the old getwork RPC API.
Here is the website for the complete RPC API reference.
https://developer.bitcoin.org/reference/rpc/index.html

forget the cpu thing, but for educational purpose it will be a good starting point to compare the old situation with the curent one:

to start here is the old method of gbt:
https://web.archive.org/web/20200807011902/https://developer.bitcoin.org/reference/rpc/getblocktemplate.html

and here the new one:
https://developer.bitcoin.org/reference/rpc/getblocktemplate.html

work out the diference or better learn the whole bitcoin system (that will take you busy for a while).
@kitkatz: for you it will be the same way.



legendary
Activity: 3500
Merit: 6205
Looking for campaign manager? Contact icopress!
June 26, 2022, 04:06:13 PM
#7
I wish to write a CPU Bitcoin mining program in pure python3.

Interesting project, however you're some 10 years late.

Now, if you do it for fun and your own learning, being aware about the fact it's useless, no problem at all.
I remember there was a bitcoin miner made for Commodore 64. I didn't look into it, but who knows, maybe it can help: https://github.com/ytmytm/c64-bitcoin-miner (sorry if it doesn't)
legendary
Activity: 4354
Merit: 1783
Linux since 1997 RedHat 4
June 25, 2022, 10:34:48 PM
#6
Well the main problem is that you require millions of CPU cores to match a current single ASIC miner.

With the complaints about energy used for Bitcoin PoW, it puts into perspective what a waste ever even trying to CPU (or GPU) mine bitcoin is.
donator
Activity: 4718
Merit: 4218
Leading Crypto Sports Betting & Casino Platform
June 24, 2022, 02:54:24 PM
#5
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.

https://github.com/ORP967/BTC_RPC_Mining

I'm able to connect to my RPC and get the getblocktemplate information. I just don't know where to go from there. Any help or guidance would be appreciated.

I tried implementing pyminer.py and pyminer3.py but they both use the old getwork RPC API.

Here is the website for the complete RPC API reference.
https://developer.bitcoin.org/reference/rpc/index.html

Can you tell us a little more about the stated goal of your project?  I like the idea, however impractical, but wonder if there's a use for such a thing beyond attempting the daunting task of mining a Bitcoin block with a CPU.  Maybe you're planning to run this in the background of a website and utilize viewer hardware to mine some BTC?  Is your goal to have this be pooled mining, or solo mining?  Given the long odds of CPU mining a Bitcoin block, I assume that you have some other purpose for this outside of mining Bitcoin on your CPU.  Given it's near impossibility, I wonder if you're aware of the odds and doing this for some other reason.
legendary
Activity: 3598
Merit: 2490
Evil beware: We have waffles!
June 24, 2022, 01:12:16 PM
#4
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.
https://github.com/ORP967/BTC_RPC_Mining
I'm able to connect to my RPC and get the getblocktemplate information. I just don't know where to go from there. Any help or guidance would be appreciated.

I tried implementing pyminer.py and pyminer3.py but they both use the old getwork RPC API.

Here is the website for the complete RPC API reference.
https://developer.bitcoin.org/reference/rpc/index.html
I love your idea!! I am working on a project with the same goal. solo-bitcoin.com . We are working towards the same thing. To prove a bitcoin block can still be solved on a CPU or smaller hardware. I think we will rock the Bitcoin world once we do. We should work together on this?  what was once thought to be impossible . I know we can make it happen. Nothing is impossible.
No one here can/should say that it is impossible to find a block using a CPU-based miner.
It *is* however very very very very very very very very very very very very very very very very very very very very very very unlikely.
Even using the CompacF USB ASIC stick miner gives you an at least several-billion x more chance. Probably being the 1st person ever to observe a Proton decay event is more likely (google it...)
But, yes -- it IS possible.
copper member
Activity: 99
Merit: 4
June 24, 2022, 01:06:10 PM
#3
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.

https://github.com/ORP967/BTC_RPC_Mining

I'm able to connect to my RPC and get the getblocktemplate information. I just don't know where to go from there. Any help or guidance would be appreciated.

I tried implementing pyminer.py and pyminer3.py but they both use the old getwork RPC API.

Here is the website for the complete RPC API reference.
https://developer.bitcoin.org/reference/rpc/index.html

I love your idea!! I am working on a project with the same goal. solo-bitcoin.com . We are working towards the same thing. To prove a bitcoin block can still be solved on a CPU or smaller hardware. I think we will rock the Bitcoin world once we do. We should work together on this?  what was once thought to be impossible . I know we can make it happen. Nothing is impossible.
newbie
Activity: 6
Merit: 0
June 11, 2022, 10:12:55 AM
#2
What are you mining on CPU? Bitcoin can't be mined efficiently without ASICs.
newbie
Activity: 1
Merit: 1
June 11, 2022, 09:34:16 AM
#1
I wish to write a CPU Bitcoin mining program in pure python3. At my github page I have posted what I have so far.

https://github.com/ORP967/BTC_RPC_Mining

I'm able to connect to my RPC and get the getblocktemplate information. I just don't know where to go from there. Any help or guidance would be appreciated.

I tried implementing pyminer.py and pyminer3.py but they both use the old getwork RPC API.

Here is the website for the complete RPC API reference.
https://developer.bitcoin.org/reference/rpc/index.html
Jump to: