Bitcoin Forum
November 04, 2024, 03:59:09 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Python3 CPU mining  (Read 393 times)
ORP967 (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 1


View Profile
June 11, 2022, 01:34:16 PM
Merited by KitKatZ (1)
 #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
skinnyjeans77
Newbie
*
Offline Offline

Activity: 6
Merit: 0


View Profile
June 11, 2022, 02:12:55 PM
 #2

What are you mining on CPU? Bitcoin can't be mined efficiently without ASICs.
KitKatZ
Copper Member
Jr. Member
*
Offline Offline

Activity: 99
Merit: 4


View Profile
June 24, 2022, 05: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.

shhpool.com
“There is nothing impossible to they who will try.”
— Alexander the Great
NotFuzzyWarm
Legendary
*
Offline Offline

Activity: 3808
Merit: 2697


Evil beware: We have waffles!


View Profile
June 24, 2022, 05: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.

- For bitcoin to succeed the community must police itself -    My info useful? Donations welcome!  3NtFuzyWREGoDHWeMczeJzxFZpiLAFJXYr
 -Sole remaining active Primary developer of cgminer, Kano's repo is here
-Support Sidehacks miner development. Donations to:   1BURGERAXHH6Yi6LRybRJK7ybEm5m5HwTr
OgNasty
Donator
Legendary
*
Offline Offline

Activity: 4914
Merit: 4828


Leading Crypto Sports Betting & Casino Platform


View Profile WWW
June 24, 2022, 06: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.

..Stake.com..   ▄████████████████████████████████████▄
   ██ ▄▄▄▄▄▄▄▄▄▄            ▄▄▄▄▄▄▄▄▄▄ ██  ▄████▄
   ██ ▀▀▀▀▀▀▀▀▀▀ ██████████ ▀▀▀▀▀▀▀▀▀▀ ██  ██████
   ██ ██████████ ██      ██ ██████████ ██   ▀██▀
   ██ ██      ██ ██████  ██ ██      ██ ██    ██
   ██ ██████  ██ █████  ███ ██████  ██ ████▄ ██
   ██ █████  ███ ████  ████ █████  ███ ████████
   ██ ████  ████ ██████████ ████  ████ ████▀
   ██ ██████████ ▄▄▄▄▄▄▄▄▄▄ ██████████ ██
   ██            ▀▀▀▀▀▀▀▀▀▀            ██ 
   ▀█████████▀ ▄████████████▄ ▀█████████▀
  ▄▄▄▄▄▄▄▄▄▄▄▄███  ██  ██  ███▄▄▄▄▄▄▄▄▄▄▄▄
 ██████████████████████████████████████████
▄▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▄
█  ▄▀▄             █▀▀█▀▄▄
█  █▀█             █  ▐  ▐▌
█       ▄██▄       █  ▌  █
█     ▄██████▄     █  ▌ ▐▌
█    ██████████    █ ▐  █
█   ▐██████████▌   █ ▐ ▐▌
█    ▀▀██████▀▀    █ ▌ █
█     ▄▄▄██▄▄▄     █ ▌▐▌
█                  █▐ █
█                  █▐▐▌
█                  █▐█
▀▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▀█
▄▄█████████▄▄
▄██▀▀▀▀█████▀▀▀▀██▄
▄█▀       ▐█▌       ▀█▄
██         ▐█▌         ██
████▄     ▄█████▄     ▄████
████████▄███████████▄████████
███▀    █████████████    ▀███
██       ███████████       ██
▀█▄       █████████       ▄█▀
▀█▄    ▄██▀▀▀▀▀▀▀██▄  ▄▄▄█▀
▀███████         ███████▀
▀█████▄       ▄█████▀
▀▀▀███▄▄▄███▀▀▀
..PLAY NOW..
kano
Legendary
*
Offline Offline

Activity: 4620
Merit: 1851


Linux since 1997 RedHat 4


View Profile
June 26, 2022, 02:34:48 AM
 #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.

Pool: https://kano.is - low 0.5% fee PPLNS 3 Days - Most reliable Solo with ONLY 0.5% fee   Bitcointalk thread: Forum
Discord support invite at https://kano.is/ Majority developer of the ckpool code - k for kano
The ONLY active original developer of cgminer. Original master git: https://github.com/kanoi/cgminer
NeuroticFish
Legendary
*
Offline Offline

Activity: 3850
Merit: 6583


Looking for campaign manager? Contact icopress!


View Profile
June 26, 2022, 08: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)

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
o_solo_miner
Legendary
*
Offline Offline

Activity: 2484
Merit: 1482


-> morgen, ist heute, schon gestern <-


View Profile
June 26, 2022, 09: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.




from the creator of CGMiner http://solo.ckpool.org for Solominers
paused: passthrough for solo.ckpool.org => stratum+tcp://rfpool.org:3334
nullama
Hero Member
*****
Offline Offline

Activity: 1162
Merit: 970



View Profile
July 05, 2022, 04: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.
NotATether
Legendary
*
Offline Offline

Activity: 1778
Merit: 7360


Top Crypto Casino


View Profile WWW
July 05, 2022, 05: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].

███████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████

███████████████████████
.
BC.GAME
▄▄▀▀▀▀▀▀▀▄▄
▄▀▀░▄██▀░▀██▄░▀▀▄
▄▀░▐▀▄░▀░░▀░░▀░▄▀▌░▀▄
▄▀▄█▐░▀▄▀▀▀▀▀▄▀░▌█▄▀▄
▄▀░▀░░█░▄███████▄░█░░▀░▀▄
█░█░▀░█████████████░▀░█░█
█░██░▀█▀▀█▄▄█▀▀█▀░██░█
█░█▀██░█▀▀██▀▀█░██▀█░█
▀▄▀██░░░▀▀▄▌▐▄▀▀░░░██▀▄▀
▀▄▀██░░▄░▀▄█▄▀░▄░░██▀▄▀
▀▄░▀█░▄▄▄░▀░▄▄▄░█▀░▄▀
▀▄▄▀▀███▄███▀▀▄▄▀
██████▄▄▄▄▄▄▄██████
.
..CASINO....SPORTS....RACING..


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!