Pages:
Author

Topic: [Guide] Solo mine testnet bitcoins with bfgminer, Bitcoin Core, and a CPU/GPU (Read 1164 times)

hero member
Activity: 714
Merit: 1010
Crypto Swap Exchange
It seems that one or more entities already throw some spare ASICs to mine in Testnet4, hell, for whatever reasons. It takes just one to force others to follow that path and leave everybody else without ASICs behind. Anyway, in a trustless PoW scenario miners can do what they're are able to with their gear, you can't control that. Why wouldn't history of Testnet3 repeat in Testnet4?

Does it make sense to drive difficulty up to levels where only few dare to waste money for energy for a worthless-by-design-and-intention coin like tBTC? I don't think so.

It would be more fun for participants to be able to mine Testnet4 with CPU cycles in a truely decentralized fashion. But that's not gonna work with human mindsets unfortunately. Only if we had an ASIC-resistant hashing algorithm for Testnet4, but then Testnet4 would diverge from Mainnet too much.
brand new
Activity: 0
Merit: 0
hi guys,

have u guys tried to mine bitcoin on testnet4?
Hi, mining on testnet4 worked for me with bfgminer and a bitcoin core testnet4 node, compiled as mentioned in this thread:

How can i run a Bitcoin testnet 4 node?

Most of you know how the V3 is about to die with those 2.4M unconfirmed transactions, and the V4 is on the way, but i see the testen 4 is alive and it already has blocks (https://mempool.space/testnet4) so, how can i run a testnet v4 node?

I would appreciate it if anyone had a hint on this topic because I wasn't able to find information about this.

---UPDATE----

USER: mocacinno packaged everything in a container:
https://bitcointalksearch.org/topic/testnet4-in-a-container-5496494

and with this .config:

Code:
testnet4=1
txindex=1
server=1
[testnet4]
rpcport=5000
rpcallowip=YOUR_MINER_IP
rpcuser=YOUR_RPC_USER
rpcpassword=YOUR_RPC_PASSWORD
rpcbind=0.0.0.0

The difficulty is already too high tough that it would make sense to mine on a CPU/GPU.
brand new
Activity: 0
Merit: 0
hi guys,

have u guys tried to mine bitcoin on testnet4?
hero member
Activity: 882
Merit: 5818
not your keys, not your coins!
Note that this is bfgminer, with CPU. This is not supposed to have the latest CPU optimizations enabled as it's not used for that in years, maybe a decade or more.
if there's demand now what's really needed is instructions for cpu with AES support. for sure regular sha256() ,openssl, with hardware aes turned on there , is faster than yours now.
Since openssl is a dependency, I suppose it already uses that. Furthermore, this isn't nullama's software. I'm pretty sure it was first released (and maintained - last commit in '21) by Luke Dashjr [1-2].

[1] https://github.com/luke-jr/bfgminer/
[2] https://en.bitcoin.it/wiki/BFGMiner

I got an accepted hash after 7 minutes, another 3 minutes later and another one minute later.
Did you create your own Fork that stays on difficulty 1?
I ran it like suggested by nullama just for benchmarking:

Code:
./bfgminer -S cpu:auto --benchmark-intense
member
Activity: 131
Merit: 16
For comparison purposes a single RX 6600 achieves 1500Mh/s in cgminer/bfgminer
That's good to know. How about compiling a list of modern desktop hardware just for fun? Then it could be added to [1] the Bitcoin Wiki, which as of now only has very old hardware listed.
I think it would be good to post at least a console output from bfgminer as proof.

[1] https://en.bitcoin.it/wiki/Mining_Hardware_Comparison



Very odd. I quickly logged into a VM of mine with 7 cores (underlying CPU is pretty new Intel model boosting to almost 5GHz); the benchmark only results in ~20MH/s (probably due to virtualization), yet still I got an accepted hash after 7 minutes, another 3 minutes later and another one minute later.

Code:
[XXXX-XX-XX XX:51:31] Accepted 11128a4f CPU 4  Diff 14/1
[XXXX-XX-XX XX:54:51] Accepted bcd92259 CPU 0  Diff 1/1
[XXXX-XX-XX XX:55:27] Accepted f5f3501e CPU 1  Diff 1/1

I will test on bare-metal hardware with Bitcoin Core on the weekend, as mentioned before. Maybe there is hope for Loyce's 7MH/s second machine Grin (although it makes no sense on paper - even getting accepted hashes that fast with 20MH/s...).

16/02/2023

RX6600 (bfgminer):
Code:
OCL 0:       |  1.18/ 1.50/ 1.46Gh/s | A: 5 R:0+0(none) HW:0/none

RX6700XT (cgminer):
Code:
GPU 0:                | 2.198G/2.663Gh/s | A:6468 R:0 HW:0 WU:    39.5/m I:10

I would enjoy seeing what a 4090 can achieve
hero member
Activity: 980
Merit: 957
I got an accepted hash after 7 minutes, another 3 minutes later and another one minute later.
Did you create your own Fork that stays on difficulty 1?

When you use the benchmark option the difficulty by default is 1. It doesn't connect to any network.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
I got an accepted hash after 7 minutes, another 3 minutes later and another one minute later.
Did you create your own Fork that stays on difficulty 1?
member
Activity: 312
Merit: 30
Note that this is bfgminer, with CPU. This is not supposed to have the latest CPU optimizations enabled as it's not used for that in years, maybe a decade or more.
if there's demand now what's really needed is instructions for cpu with AES support. for sure regular sha256() ,openssl, with hardware aes turned on there , is faster than yours now.
hero member
Activity: 882
Merit: 5818
not your keys, not your coins!
For comparison purposes a single RX 6600 achieves 1500Mh/s in cgminer/bfgminer
That's good to know. How about compiling a list of modern desktop hardware just for fun? Then it could be added to [1] the Bitcoin Wiki, which as of now only has very old hardware listed.
I think it would be good to post at least a console output from bfgminer as proof.

[1] https://en.bitcoin.it/wiki/Mining_Hardware_Comparison



Very odd. I quickly logged into a VM of mine with 7 cores (underlying CPU is pretty new Intel model boosting to almost 5GHz); the benchmark only results in ~20MH/s (probably due to virtualization), yet still I got an accepted hash after 7 minutes, another 3 minutes later and another one minute later.

Code:
[XXXX-XX-XX XX:51:31] Accepted 11128a4f CPU 4  Diff 14/1
[XXXX-XX-XX XX:54:51] Accepted bcd92259 CPU 0  Diff 1/1
[XXXX-XX-XX XX:55:27] Accepted f5f3501e CPU 1  Diff 1/1

I will test on bare-metal hardware with Bitcoin Core on the weekend, as mentioned before. Maybe there is hope for Loyce's 7MH/s second machine Grin (although it makes no sense on paper - even getting accepted hashes that fast with 20MH/s...).
hero member
Activity: 980
Merit: 957
CPU
did you use sse at least? say sse3.1 have some stuff for that. avx too

SSE is not supported in an ARM device like the M1.

Code:
benchmarking all sha256 algorithms ...
"c"        : benchmarking algorithm ...
"c"        : algorithm runs at 1.52071 MH/s
"cryptopp" : benchmarking algorithm ...
"cryptopp" : algorithm runs at 0.47593 MH/s
"c"        : is fastest algorithm at 1.52071 MH/s

That's per core, the M1 has 8 cores.

In an Intel CPU:

Code:
benchmarking all sha256 algorithms ...
"c"        : benchmarking algorithm ...
"c"        : algorithm runs at 1.82270 MH/s
"cryptopp" : benchmarking algorithm ...
"cryptopp" : algorithm runs at 1.11739 MH/s
"sse2_64"  : benchmarking algorithm ...
"sse2_64"  : algorithm runs at 1.42778 MH/s
"sse4_64"  : benchmarking algorithm ...
"sse4_64"  : algorithm runs at 1.31795 MH/s
"c"        : is fastest algorithm at 1.82270 MH/s

That's per core, the CPU had 20 cores. Also, I've seen the sse4_64 algo being the fastest at other times in the same CPU.

Note that this is bfgminer, with CPU. This is not supposed to have the latest CPU optimizations enabled as it's not used for that in years, maybe a decade or more.
member
Activity: 312
Merit: 30
CPU
did you use sse at least? say sse3.1 have some stuff for that. avx too
member
Activity: 131
Merit: 16
For comparison purposes a single RX 6600 achieves 1500Mh/s in cgminer/bfgminer
hero member
Activity: 980
Merit: 957
~snip~
Sure, but if you have it already and need a bunch of testnet BTC, it should work nicely. I will try on the weekend with some modern desktop general-purpose hardware that I can access. I was surprised to see a >100MH/s hashrate on CPUs, since yours only managed single digits. Therefore, I was about to call this guide half-failed (the CPU part), but those benchmarks give me hope.

CPU mining absolutely works for testnet with relatively new devices.

Just did a quick benchmark with bfgminer on a mac mini M1(2020 device) with CPU only(you can also use OpenCL to use the GPU), and in less than 5 minutes I got 2 shares over Diff 1:

Code:
[XXX-XX-XX XX:12:17] New best share: 1
 [XXX-XX-XX XX:12:17] Accepted fe912210 CPU 7  Diff 1/1
 [XXX-XX-XX XX:12:21] 20s: 8.46 avg: 8.56 u:30.08 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:12:42] 20s: 8.61 avg: 8.60 u:26.34 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:13:02] 20s: 8.57 avg: 8.59 u:23.44 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:13:22] 20s: 8.59 avg: 8.59 u:21.09 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:13:43] 20s: 8.69 avg: 8.61 u:19.17 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:14:03] 20s: 8.73 avg: 8.63 u:17.58 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:14:23] 20s: 8.64 avg: 8.62 u:16.23 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:14:44] 20s: 8.70 avg: 8.63 u:15.07 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:15:04] 20s: 8.74 avg: 8.64 u:14.07 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:15:24] 20s: 8.71 avg: 8.64 u:13.19 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:15:44] 20s: 8.56 avg: 8.62 u:12.42 Mh/s | A:1 R:0+0(none) HW:0/none
 [XXX-XX-XX XX:15:53] New best share: 291
 [XXX-XX-XX XX:15:53] Accepted 00e0a123 CPU 5  Diff 291/1

You can see that it is absolutely possible to find a block when Diff is 1 with a CPU. It's just that it's way less probable than with an ASIC.

If you want to test a device without having to setup a local Bitcoin Core, you can do this:

Code:
./bfgminer -S cpu:auto --benchmark-intense

Also, notice the M1 hashrate hovering around 20Mh/s or so. It should be higher than that because I did the benchmark while using the device at 100% for other intensive tasks that I didn't want to stop.
hero member
Activity: 882
Merit: 5818
not your keys, not your coins!
It somewhat surprises me that more people did not spin up a rig just for fun, but on the other hand the coin was worthless and energy & hardware did cost something.
Don't remind me Sad I should have done that when I first read about Bitcoin, which was years before I joined Bitcointalk.
I think many folks here share this sentiment. Wink

Quote
@LoyceV, after browsing a bit online, it seems like there are modern CPUs now that can compete with something like ETFBitcoin's 100MH/s GPU.
It's just that your CPU is old.. old old.. Grin
It's old indeed, but works very well for it's task: pushing bytes to the outside world.
This Xeon CPU is already faster in finding Bitcoin vanity addresses than my laptop GPU.

Quote
From 2011 to 2023, well, things changed. An i9-9900K from Q4 2018 even manages over 100MH/s, it seems like. [4]
Buying a CPU just for hashing is a waste of money (and electricity). That's 95W that could be used for better things.
Sure, but if you have it already and need a bunch of testnet BTC, it should work nicely. I will try on the weekend with some modern desktop general-purpose hardware that I can access. I was surprised to see a >100MH/s hashrate on CPUs, since yours only managed single digits. Therefore, I was about to call this guide half-failed (the CPU part), but those benchmarks give me hope.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
It somewhat surprises me that more people did not spin up a rig just for fun, but on the other hand the coin was worthless and energy & hardware did cost something.
Don't remind me Sad I should have done that when I first read about Bitcoin, which was years before I joined Bitcointalk.

Quote
@LoyceV, after browsing a bit online, it seems like there are modern CPUs now that can compete with something like ETFBitcoin's 100MH/s GPU.
It's just that your CPU is old.. old old.. Grin
It's old indeed, but works very well for it's task: pushing bytes to the outside world.
This Xeon CPU is already faster in finding Bitcoin vanity addresses than my laptop GPU.

Quote
From 2011 to 2023, well, things changed. An i9-9900K from Q4 2018 even manages over 100MH/s, it seems like. [4]
Buying a CPU just for hashing is a waste of money (and electricity). That's 95W that could be used for better things.
hero member
Activity: 882
Merit: 5818
not your keys, not your coins!
it looks like mining tBTC (at difficulty 1) is more difficult than i expected.
In a way it makes sense: mining on one computer produces one block per 10 minutes. That sounds exactly like the beginning of Bitcoin.
The 10 minute figure is correct:

The average time to find a block can be approximated by calculating:
Code:
time = difficulty * 2**32 / hashrate
Actually, if we use this formula, it appears that with difficulty=1, you need on average 4295032833 or ~4.3GH to find a valid one. So on a 7MH/s machine, that's 613 seconds or 10 minutes. Impossible.. Grin
Code:
>>> 1 * 2**32 / 7000000
613.5667565714285

Indeed, yes. The whole network hash rate in the beginning of 2009 was relatively stable around 4-5MH/s [1]. A new CPU from Q1 2009 like the Intel Pentium E5400 [2] was already able to output about 2.2MH/s [3], so there were literally just 2 CPUs on the whole network for almost a year back then. It somewhat surprises me that more people did not spin up a rig just for fun, but on the other hand the coin was worthless and energy & hardware did cost something.

[1] https://www.coinwarz.com/mining/bitcoin/hashrate-chart/2009
[2] https://ark.intel.com/content/www/us/en/ark/products/40478/intel-pentium-processor-e5400-2m-cache-2-70-ghz-800-mhz-fsb.html
[3] https://bitcointalksearch.org/topic/hash-rate-cpu-comparison-table-1628



@LoyceV, after browsing a bit online, it seems like there are modern CPUs now that can compete with something like ETFBitcoin's 100MH/s GPU.
It's just that your CPU is old.. old old.. Grin

I just mined 27 blocks over the last ~24h using a single Compac F; those were always 1-difficulty-blocks, so it should have been possible with CPU, just as well.
Your post got me motivated, so I've been mining Testnet on CPU (Intel(R) Xeon(R) CPU E3-1270 V2 @ 3.50GHz) for the past 19 hours. So far, not a single block mined.

From 2011 to 2023, well, things changed. An i9-9900K from Q4 2018 even manages over 100MH/s, it seems like. [4]
I will verify with some relatively modern Desktop hardware, later myself directly with bfgminer and report back.

Sadly, @nullama's assumption (I guess he assumed that, like myself?) that difficulty=1 means an immediate hit on any hardware, was wrong. However, with a modern computer you should definitely get something, if you have a few hundred MH/s.

[4] https://forum.level1techs.com/t/whats-the-fastest-processor-for-single-threaded-single-process-of-running-sha256sum/157464?page=3
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
it looks like mining tBTC (at difficulty 1) is more difficult than i expected.
In a way it makes sense: mining on one computer produces one block per 10 minutes. That sounds exactly like the beginning of Bitcoin.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
It also looks like my CPU mining is utterly useless Tongue I'll give it another week, then I'll wipe it.
To conclude this: I give up Tongue After wasting another week of CPU time without finding a block, I wiped the testnet installation. Using a testnet faucet is much faster if you need some.
hero member
Activity: 882
Merit: 5818
not your keys, not your coins!
Do we know @ETFbitcoin 's hash rate?
It looks like he used his GPU:
IIRC my GPU has speed about 200 Mh/s, so you should already mine at least a block within a month.

It also looks like my CPU mining is utterly useless Tongue I'll give it another week, then I'll wipe it.
Indeed, that's a pity. @nullama may want to edit the original post / title and include the calculations I posted.
It seems that CPUs are too weak even for difficulty=1, and even GPUs may struggle.

An old 1GH/s USB mining stick would take 4 whole seconds to mine a block and a 200MH/s graphics card takes 20 seconds. That's really stretching it, if you ask me, as ASIC miners will have a 20 second head start.

For ASICs owners like yourself: would it be possible to only turn it on when the difficulty is 1? Or use it for something else, and then switch to testnet mining when the last block was for instance 19 minutes and 50 seconds ago?
Yeah, that should definitely be possible. Although I don't think it's advised to heat cycle hardware a lot, so maybe it's worth modifying cgminer to monitor the testnet blockchain and switch over whenever the last block approaches 20 min old. The ASIC doesn't care; it just hashes whatever it's given. But that way it stays hot and mines actually valuable BTC whenever the difficulty on testnet is higher than 1.

On the other hand, old / weaker ASICs make you such few sats per day that it's almost not worth the hassle to set this up. I'd just leave Compac F sticks on testnet for a day if I need tBTC and rest of the time on solo pool.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
Do we know @ETFbitcoin 's hash rate?
It looks like he used his GPU:
IIRC my GPU has speed about 200 Mh/s, so you should already mine at least a block within a month.

It also looks like my CPU mining is utterly useless Tongue I'll give it another week, then I'll wipe it.

For ASICs owners like yourself: would it be possible to only turn it on when the difficulty is 1? Or use it for something else, and then switch to testnet mining when the last block was for instance 19 minutes and 50 seconds ago?
Pages:
Jump to: