dogecoin / dogecoin

very currency
MIT License
14.4k stars 2.8k forks source link

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 3 weeks ago

msy2008 commented 3 weeks ago

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 commented 3 weeks ago

what software are you referring to? dogcoind?

slightlyskepticalpotat commented 3 weeks ago

If you are mining with outside software, typically you have to specify a fixed coinbasetxn address so all the coins go to the same address.

On Tue, Apr 23, 2024 at 12:20 PM Jadi @.***> wrote:

what software are you referring to? dogcoind?

— Reply to this email directly, view it on GitHub https://github.com/dogecoin/dogecoin/issues/3527#issuecomment-2072854873, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHOXLYBFAYGPQZNH5KIJBMLY62C3NAVCNFSM6AAAAABGSZYUIOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANZSHA2TIOBXGM . You are receiving this because you are subscribed to this thread.Message ID: @.***>

farsider350 commented 3 weeks ago

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 commented 2 weeks ago

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 commented 2 weeks ago

I want to know where the code is

Called here in the getauxblock RPC call:

https://github.com/dogecoin/dogecoin/blob/a6d12201363b0eb4ccf854b609fc6e98958b1443/src/rpc/mining.cpp#L1167

Which, through boost signals, calls:

https://github.com/dogecoin/dogecoin/blob/a6d12201363b0eb4ccf854b609fc6e98958b1443/src/wallet/wallet.cpp#L3464-L3473


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 commented 2 weeks ago

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 commented 2 weeks ago

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?