Post
Topic
Board Announcements (Altcoins)
Re: [ANN][GAP] Gapcoin - Prime Gap Search - New Math Algo - CPU / GPU - Zero Premine
by
BitcoinFX
on 03/03/2021, 14:32:13 UTC
Excerpt;
Quote
== Generating ==
generate nblocks ( maxtries )
generatetoaddress nblocks address (maxtries)
getgenerate
getwork ( "data" )
setgenerate generate ( genproclimit ) ( sievesize ) ( sieveprimes ) ( shift )
I debated with myself whether to mention generatetoaddress in my response. Although I haven't checked, because I haven't interfered with any of that particular code, I have no reason to doubt its flawless functioning. The trouble is that in-wallet mining of BTC on mainnet was (correctly) considered futile by the Bitcoin devs as far back as 0.13, nearly five years ago - at which point the code for the internal miner was removed from Bitcoin.

One of the key implications of this is that the remaining generator code in the Bitcoin codebase is intended solely for use with testnet/regtest.

The practical consequences are that generatetoaddress isn't suitable for use as a general-purpose, run-until-stopped miner. The call takes three arguments: the target number of blocks to generate, the address to which they should be credited and, importantly, the maximum number of tries to attempt before returning - generatetoaddress nblocks "address" ( maxtries ) - and then it stops and you need to call it again. It's not that it can't be driven from a bash/Powershell script, it's just that this additional technical demand imposes a higher barrier to entry.

However, the Bitcoin code that implements the address-handling for the generatetoaddress function is obviously a candidate for copying and pasting. If it's perceived as highly-desirable to integrate this functionality into the in-wallet miner, one approach would be to store a mining address in the gapcoin.conf file and pick up the value from that.

Be advised though, having all the mined blocks going to one address compromises anonymity but if there's a compelling use case, I would be prepared to consider putting in the time and effort to get it to work.

Cheers

Graham


Here's an example of an address that would appear to be mining blocks to a single address ... (not me!  Cheesy ) ...

- https://chainz.cryptoid.info/gap/address.dws?GUNtDqH8QxesjU9p3TsE7LPkRjtGUykWrp.htm

As mentioned, it's not really a great idea in terms of anonymity or privacy, but I guess it adds some convenience to the mining process.