Pages:
Author

Topic: SoloMining with CGMiner against Bitcoind / Bitcoin Core v0.18.1 - page 3. (Read 2585 times)

newbie
Activity: 72
Merit: 0
No, coz in your case you are advertising code for free to people claiming it will work, without testing it properly,
with clearly no understanding of what you are doing, and people are silly enough to listen to you and some of them, if they find  a block, will not get the reward.

Yeah this place is full of hackers that think they know what they are doing but wont be found when the shit hits the fan.

If you were to actually test it properly you would 'likely' spot the obvious issue.

who do you mean?i did not advertise code for free.i had quoted the patch to ask if you had referred to it in your previous reply because it was not clear.

still unanswered is your statement that this patch sends coins to a foreign address. I'd love to understand, but you don't seem to want to answer.

does anyone else know what kano means and what it has to do with this patch?
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
No, coz in your case you are advertising code for free to people claiming it will work, without testing it properly,
with clearly no understanding of what you are doing, and people are silly enough to listen to you and some of them, if they find  a block, will not get the reward.

Yeah this place is full of hackers that think they know what they are doing but wont be found when the shit hits the fan.

If you were to actually test it properly you would 'likely' spot the obvious issue.
newbie
Activity: 72
Merit: 0
You have enabled other code that wont always work.

Rather simple and obvious actually for a programmer.

you said that after applying this patch cgminer will not send the coins to your address but a
random address under certain circumstances.What code does the patch enable?
can you please be more specific with your reply?
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
You have enabled other code that wont always work.

Rather simple and obvious actually for a programmer.
newbie
Activity: 72
Merit: 0
Be aware that the patch mentioned above will not send the coins to your address but a random address under certain circumstances.
Most people don't like thoroughly testing patches, so yeah too bad about that hey.

do you mean this patch?

Code:
From 168a1bdfedb1408a690f5387e04e3c9af7842c5e Mon Sep 17 00:00:00 2001
From: Stefan Berger
Date: Sun, 28 Feb 2021 10:51:53 +0000
Subject: [PATCH] Make coinbaseaux flags optional

Needed for solo mining on bitcoind, starting with v0.20.0
It's probably safe to delete the coinbase flags, but leave them in as optional for now.

See also: https://github.com/bitcoin/bitcoin/commit/9aedabe67eedfee9c94c6a50962f11348eb99bca
---
 cgminer.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/cgminer.c b/cgminer.c
index ece7ce100f..ab52e30a61 100644
--- a/cgminer.c
+++ b/cgminer.c
@@ -2960,7 +2960,7 @@ static bool gbt_solo_decode(struct pool *pool, json_t *res_val)
  flags = json_string_value(json_object_get(coinbase_aux, "flags"));
  default_witness_commitment = json_string_value(json_object_get(res_val, "default_witness_commitment"));
 
- if (!previousblockhash || !target || !version || !curtime || !bits || !coinbase_aux || !flags) {
+ if (!previousblockhash || !target || !version || !curtime || !bits) {
  applog(LOG_ERR, "Pool %d JSON failed to decode GBT", pool->pool_no);
  return false;
  }
@@ -3039,10 +3039,12 @@ static bool gbt_solo_decode(struct pool *pool, json_t *res_val)
  ofs += ser_number(pool->scriptsig_base + ofs, height); // max 5
 
  /* Followed by flags */
- len = strlen(flags) / 2;
- pool->scriptsig_base[ofs++] = len;
- hex2bin(pool->scriptsig_base + ofs, flags, len);
- ofs += len;
+ if (flags) {
+ len = strlen(flags) / 2;
+ pool->scriptsig_base[ofs++] = len;
+ hex2bin(pool->scriptsig_base + ofs, flags, len);
+ ofs += len;
+ }
 
  /* Followed by timestamp */
  cgtime(&now);

I cannot find a random number generator in that code or any references to bitcoin addresses so what exactly do you mean?
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
Be aware that the patch mentioned above will not send the coins to your address but a random address under certain circumstances.
Most people don't like thoroughly testing patches, so yeah too bad about that hey.
newbie
Activity: 72
Merit: 0
which cgminer version is required to mine on a full node?could someone give me a download link please
hero member
Activity: 630
Merit: 731
Bitcoin g33k
good idea, but I would advise against solo mining on a hosted node due to the sheer amount of data (some TBs per month) just for the GBT traffic.
could you please explain this a little more, please? I understand that due to GBT a bunch of data is transferred between fullnode and miner every second. As far as miner+fullnode work on one and the same host, which is very powerful and therefore performant, does direct mining on bitcoin core really have a disadvantage compared to mining by intermediary pool ? Or maybe there are even advantages? I tried this setup on testnet and it works fine so far.

I started to play around with mining on a hosted node last week, somewhat inspired by all these solo pools that have popped up recently. A far better option is to install a ckpool instance on the same machine and connect there via stratum. I did such a setup and it works fine. And that way, you don't even need to patch cgminer and it works for stratum-only devices like the Futurebit Apollo as well. If there is interest, I could post a setup guide too.
Would be awesome to see a setup and operation guide, I guess it would be interesting for the whole community. Thank you in advance.

See the steps for patching cgminer below:


EDIT: You could also use this modded cgminer: https://github.com/cmmodtools/cgminer There are a few patched versions around that should work equally well.

many thanks for the instructions. I tried patching Kano's latest cgminer version with the goldenguy patch and it worked fine, I was able to successful mine on bitcoin core with GBT using. Can you explain please what kind of additional mods the mentioned cmmodtools/cgminer has in comparison to Kano latest cgminer version? And which other patched or modded versions of cgminer are available out there that you can suggest and for what reason? What kind of mods/patches have they included and what are they good for (some examples) ? Thanks for your very helpful and kind reply.
member
Activity: 100
Merit: 29

ok, thanks for the info.

Did you modify cgminer any further then adding golden-guys comit?
I now sync the testnet and try it, just to confirm it.

I was thinking that taproot has to be implemented as segwit was.
My concern was, that the version bits have to be valid for taproot.


I just updated cgminer 4.11.1 with the golden-guy patches, fired up bitcoind 22 and synced testnet3. So even without any change on the version bit (in regards to signalling taproot support) the solo-mined blocks are accepted and confirmed on the blockchain just fine. I have yet to find any implication on the mining software that might have been introduced by the taproot changes.

EDIT: According to the getblocktemplate response as returned by bitcoind 22, the client (i.e. cgminer) may just disregard the "taproot" rule and can continue using the existing blocktemplate as-is. Which basically means as long as there are non-taproot transactions added to the mempool, it will just continue to create valid blocks. As can be seen and verified on testnet.

Hi 100knot2dae and rest,

would you mind sharing a brief step-by-step how-to for getting the patched cgminer version to run on with an own full-node which is running bitcoin core v23.0.0. I have a full-node running in a data center with superior superfast internet connection and would like to use it for solo-mining with a GekkoScience Compac F. Unfortunately Kanos' latest version 4.12 does prohibit the use for mining on an own full node running latest bitcoin core 23.0.0 version. How to mitigate this? Thanks to all

Hello,
good idea, but I would advise against solo mining on a hosted node due to the sheer amount of data (some TBs per month) just for the GBT traffic. I started to play around with mining on a hosted node last week, somewhat inspired by all these solo pools that have popped up recently. A far better option is to install a ckpool instance on the same machine and connect there via stratum. I did such a setup and it works fine. And that way, you don't even need to patch cgminer and it works for stratum-only devices like the Futurebit Apollo as well. If there is interest, I could post a setup guide too.

See the steps for patching cgminer below:


EDIT: You could also use this modded cgminer: https://github.com/cmmodtools/cgminer There are a few patched versions around that should work equally well.
hero member
Activity: 630
Merit: 731
Bitcoin g33k

ok, thanks for the info.

Did you modify cgminer any further then adding golden-guys comit?
I now sync the testnet and try it, just to confirm it.

I was thinking that taproot has to be implemented as segwit was.
My concern was, that the version bits have to be valid for taproot.


I just updated cgminer 4.11.1 with the golden-guy patches, fired up bitcoind 22 and synced testnet3. So even without any change on the version bit (in regards to signalling taproot support) the solo-mined blocks are accepted and confirmed on the blockchain just fine. I have yet to find any implication on the mining software that might have been introduced by the taproot changes.

EDIT: According to the getblocktemplate response as returned by bitcoind 22, the client (i.e. cgminer) may just disregard the "taproot" rule and can continue using the existing blocktemplate as-is. Which basically means as long as there are non-taproot transactions added to the mempool, it will just continue to create valid blocks. As can be seen and verified on testnet.

Hi 100knot2dae and rest,

would you mind sharing a brief step-by-step how-to for getting the patched cgminer version to run on with an own full-node which is running bitcoin core v23.0.0. I have a full-node running in a data center with superior superfast internet connection and would like to use it for solo-mining with a GekkoScience Compac F. Unfortunately Kanos' latest version 4.12 does prohibit the use for mining on an own full node running latest bitcoin core 23.0.0 version. How to mitigate this? Thanks to all
member
Activity: 152
Merit: 25
Solo mining FTW  Cool

Let's band together and make an effort to code something that could work

This is what bitcoin is all about. This is how it started!
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
There's a chance if you use slow internet, run it through tor, add a vpn on top of that, run your bitcoin through tor and a vpn, then connect to a pool node on the other side of the planet, and restrict your node to hope someone else will send you blocks and get your block you find out to the rest of the world.

The point is you want to make sure you don't make your chances WAY worse by doing such things.

The chance of a miner finding a block is a simple to calculate fixed number - that changes every ~2 weeks - and that chance of course is just a statistic, even a small miner can find a block ... as you know well.

However, reducing the chances of winning that block dramatically by doing such things as I mentioned above is just silly.

If you are lucky enough to have your miner find a block, but then throw it away coz your network setup is no where near as good as the major pools, that would be a really bad thing to do.

If your miner is spending a % of it's time working on stale blocks and also taking a long time to send that one share you might find that is a block to bitcoin, then bitcoin spends a long time processing that block and a long time getting that block out to the network, then you are just possibly throwing away hundreds of thousands of dollars. Yeah a certain other solo pool owner may be able to afford to do that, but do you want to?

The point is that is all unnecessary, you don't need to take those risks and damage your chances of winning a block.
full member
Activity: 633
Merit: 159
But there's a chance!!  Wink

legendary
Activity: 3822
Merit: 2703
Evil beware: We have waffles!
As Kano said, even the big pools lose orphan races. If your connection to the network is even just 2x slower than theirs one has just increased the odds against getting a block before someone else does.

Yes there is a *chance* that if against already incredible odds one *does* find a block when solo mining to their own node, personally I'd be heartbroken to soon after see that another miner with better connections to the BTC network beat me in the race for my block to be the one that is 1st to be confirmed & built upon...
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
...
Ignorance is bliss.
...
... and I even pointed out the exact reasons further up why it is a bad idea ... sigh.

If someone tells you not to smash your thumb with a mallet coz it will hurt, do you need to try it anyway?

The big pools still lose blocks due to orphan races - just no one reports the losses.
I see some of them coz I have a world wide network that also reports these events.

If you are 10 times slower than the big pools at doing block changes you will get 10 or more times the orphans.
If you are 30 times slower, you will get 30 or more times the orphans and also get stale blocks that no one will ever see.

As for running slow bitcoin and no global fast network connectivity, that 30 number would be minimum, and probably worse.
full member
Activity: 633
Merit: 159
How is it a 'hero' to help fools do something stupid?

Look, even that other pool a lot of you solo mine on has lost around 5 blocks due to negligence and miss-management.
The last guy who lost a block there was ripped off by the guy who runs it - and he has around $100mil in BTC - lol.

Ignorance is bliss.



A hero in my mind usually perform things that many others cannot and help when many others cannot.

You have a specific skillset with coding and as you have read by many on here there is a desire to do this.

Since solo mining on our own is currently is not easily done with CGMiner and Bitcoin Core  and I personally haven't heard of anyone losing a block solo mining on their own... We really don't know if its stupid idea or not.  Reminds me of a great quote "Nothing beats a trial but a failure" from Maya Angelou.

The comment about the "other pool" is even more reason to give everyday folks a shot of doing this on their own.

You kinda indirectly just proved the my point about the need for this.
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
How is it a 'hero' to help fools do something stupid?

Look, even that other pool a lot of you solo mine on has lost around 5 blocks due to negligence and miss-management.
The last guy who lost a block there was ripped off by the guy who runs it - and he has around $100mil in BTC - lol.

Ignorance is bliss.

full member
Activity: 633
Merit: 159
Kano,

I have been very successful with my mining endeavors from the altcoin side (ETH,RVN,ZIL) and the BTC side. And yes some of that luck has in fact come from "bad ideas" and "just about impossible" situations as you know.

My offer to send you some BTC was genuine and offered in thanks for your coding efforts on CGMiner as without it I wouldn't have ever been mining BTC directly let alone find a block. Let's call it good karma or at least an attempt at such from my end.

Now back to BTC solo mining efforts. As my BTC mini mining farm grows and it is indeed growing I would still love the ability to be able to solo mine directly to Bitcoin Core. It's not the fact that I don't want to mine to a pool, its more the fact that I like to be in more control of my own environment when mining.

Given that I understand what you are saying about block distribution from what I gather the relatively small amount of data that is transmitted I believe (excuse my ignorance if it in fact is that) that the connections to other nodes are in fact more important than internet speed. I don't think anyone here mines on dial up at this point.  Wink Distribution of said data shouldn't require a significant amount of compute power or network throughput even if sharing that data with 30+ nodes within a very short window.

My suggestion to modify CGMiner to allow for solo mining to Bitcoin Core would benefit the Bitcoin network as a whole.

My logic would be quite simply that adding additional full nodes to the BTC network helps everyone.

The sending of hashpower to your pool (solo or otherwise) even if just for a short duration with some sort of split with the end user would also be an added benefit for the end miner as well. Not to mention would improve the overall hashrate and I believe the health of your pool.

Now as for the transparency part there are many different mining software out there that have fees associated with the use of their software. I am not sure if by doing what I suggest would violate the licensing of CGMiner but if it didn't then implementing this functionality would be a tremendous help to the community.

I can't say I have ever lost a block solo mining but that would be something I and many others would be willing to try.

Make no mistake I respect your opinions and your expertise on blockchain programming but you have the option to be a hero to many here that want to do just as I am trying as well as help yourself (through your pool) in turn as well.
legendary
Activity: 4634
Merit: 1851
Linux since 1997 RedHat 4
It has nothing to do with 'pay for effort'
That is the same as the reason why I told you not to give me any BTC when you wanted to.

Instead, it has to do with you losing blocks.

Unless you run all of:
a high speed bitcoin that can average processing network block changes in less than 100ms.
a bitcoin that gets blocks from the whole internet very fast
a bitcoin that can distribute blocks to the whole internet very fast
a method to distribute your blocks around the world to your own distributed nodes very quickly

If you don't do the above, then your chances of losing blocks due to stale or orphan is much higher than a well connected pool that does the above

Suggesting people solo mine at home is, to be blunt, negligent, bad advice.

Some people seem to think that running bitcoin on a rpi is a great idea.
. It is not if you are solo mining.
Some people think that they don't need a fast and well distributed network.
. It is no good if you are solo mining.
Some people think it is ok to CPU mine.
. It is not, it's a complete waste of time.

I added the 3rd one since the three together seem to be common ignorance.

At home my main bitcoin runs on it's own on an i7-10700 with 32GB ram and a 1GBit internet connection.
No chance I would be using it to try to solo mine blocks.
That would be stupid.
I use it for testing and that's as far as I would go with it.
Being a pool developer and the main cgminer developer, that is a necessity.

But it gets worse:
There's the complete misunderstanding about anonymity.
No bitcoin isn't anonymous. If anyone told you that, then they don't understand bitcoin.
Also, you'll need your bitcoin node to be well connected and have a fast connection to the bitcoin network, seeing all the network blocks as fast as possible.
Hiding your bitcoin node behind networks/vpns/tor/etc will definitely increase the chances of you losing a block, if you ever find one.

... and aside: worse, mining to a pool sending your bitcoin address twice every minute is exceptionally far from anonymous.

Yes people are free to do stupid things, but I'm not gonna go out of my way to help them do it, even for BTC.
As said, I'll get around to putting the simple fix in one day, but anyone with the idea that my efforts and compensation are related, has no idea.
full member
Activity: 633
Merit: 159
Due to the many reasons I've explained - I consider this a bad idea.
Many people I discuss anything about bitcoin with seem to not even understand the issues.

Some time when I get around to doing the next gekko driver I'll probably fix the solo code, but helping people lose blocks always sounds like a bad idea to me.

Kano,
I know you are busy I get it but if I had the coding knowledge you have demonstrated I would consider adding a small "10 second" or "30 second" per hour or whatever fee to the CGMiner software and then point that traffic at your solo pool.

Forgive me if that would violate the licensing but....

Come up with some sort of split so that with the miner and your solo pool would be equally or proportionality rewarded (be transparent) if they hit a solo block.

You can do this and I for one would be using it!


People are going to do it anyway. Better they do it in at least a working environment that you wrote.
If not, there is someone out there who will hack it together and kind of sorta get it working and if they don't have anything better to use they will use what they have.

-Dave

Dave,
I suggest he use my logic above to help pay for his efforts.
Pages:
Jump to: