I am trying to understand the monero code and was unsure how the code decides which address to the block reward to and how it is done. I have been able to follow the proccess up until we decide how much the block reward is but after that I havent been able to follow the code to see how it actually creates the transaction and sends it.
1 Answer
In the miner code, there is a request_block_template
function, which requests a new block template to the daemon using the miner's address.
If and when the miner finds a block, she will create it from the block template that contains her address. If the block is accepted by the network, her address will be credited with the block reward.
-
But let's say I wanted to change the coinbase transaction so that 1% of the block reward would go to the dev fund how would that work.– nalsJan 12, 2018 at 9:35
-
You can't - the reward is paid in full to the coinbase address that is included in the block. If you want to pay the dev fund, you need to make a separate payment.– assyliasJan 12, 2018 at 9:40
-
So even if we hard forked monero there would no possibility to create a dev fund by modifying the code– nalsJan 12, 2018 at 9:47
-
It would probably not be trivial change but there is no reason why you wouldn't be able to do that. I don't know the code enough to say how hard it would be.– assyliasJan 12, 2018 at 10:08
-
@assylias does that mean the coinbase address is visible in clear text (not stealth) so it's publicly known who (the coinbase address) received how much (block reward + fees)? Would this allow any kind of tracking? Jan 12, 2018 at 14:28