Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the mining pool change its address every time it mines a block? Does anyone know where this code is? #3527

Open
msy2008 opened this issue Apr 22, 2024 · 8 comments

Comments

@msy2008
Copy link

msy2008 commented Apr 22, 2024

Why does the mining pool change its address every time it mines a block? Does anyone know where this code is?
I want to fix the mining receiving address of the mining pool or change the address after every 100 blocks mined.

@jadijadi
Copy link
Contributor

what software are you referring to? dogcoind?

@slightlyskepticalpotat
Copy link
Contributor

slightlyskepticalpotat commented Apr 23, 2024 via email

@farsider350
Copy link

getauxblock generates a new address each mined block
createauxblock <address> then submitauxblock <hash> <auxpow> will generate to desired address.

Depends what mining software is being used to how you/they generate the blocks.

@msy2008
Copy link
Author

msy2008 commented Apr 27, 2024

The address can be reused 100 times or 1000 times before it is changed to another address without the need for me to set it up separately.
The existing version of the code only uses the address once by default. . .
I want to know where the code is

@patricklodder
Copy link
Member

patricklodder commented Apr 27, 2024

I want to know where the code is

Called here in the getauxblock RPC call:

GetMainSignals().ScriptForMining(coinbaseScript);

Which, through boost signals, calls:

dogecoin/src/wallet/wallet.cpp

Lines 3464 to 3473 in a6d1220

void CWallet::GetScriptForMining(std::shared_ptr<CReserveScript> &script)
{
std::shared_ptr<CReserveKey> rKey(new CReserveKey(this));
CPubKey pubkey;
if (!rKey->GetReservedKey(pubkey))
return;
script = rKey;
script->reserveScript = CScript() << ToByteVector(pubkey) << OP_CHECKSIG;
}


As @farsider350 noted, if you want to control the address, createauxblock is the recommended RPC call to use (many pools already use this instead of getauxblock). You can then, even if you use the built-in wallet, control exactly to which address the coinbase tx will pay out, i.e. by calling getnewaddress whenever you desire to switch addresses.

@msy2008
Copy link
Author

msy2008 commented Apr 28, 2024

But not every mining pool will consciously use createauxblock
When the mining pool only uses getauxblock, the receiving address can be received 100 or 1000 times instead of 1 time. Which code modification can do this? Thanks

@patricklodder
Copy link
Member

When the mining pool only uses getauxblock, the receiving address can be received 100 or 1000 times instead of 1 time. Which code modification can do this?

I wouldn't recommend that. Not reusing addresses is a security feature, as you don't want to repeat signatures outside of a single transaction, in case of signing also weaknesses. Changing the default behavior like that would force pools to be less secure, so that's not really an option.

Are you asking this for your own pool?

@msy2008
Copy link
Author

msy2008 commented May 17, 2024

When the mining pool only uses getauxblock, the receiving address can be received 100 or 1000 times instead of 1 time. Which code modification can do this?

I wouldn't recommend that. Not reusing addresses is a security feature, as you don't want to repeat signatures outside of a single transaction, in case of signing also weaknesses. Changing the default behavior like that would force pools to be less secure, so that's not really an option.

Are you asking this for your own pool?

To be honest, I am developing DOGM...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants