1

I'm looking into some Solidity functions and block.coinbase caught my attention. It returns the address of a block's miner. Can it be read for the current block or just for previous blocks like blockhash?

1

When your transaction gets included in a block, it's done by a miner. So the block.coinbase will point to that miner.

Multiple miners may include the transaction in their block around the same time, and in their block the block.coinbase is different. But eventually the blockchain reaches a consensus and agrees which block to keep and ditch the others. So, as long as you are in the winning chain (not a problem usually), you can trust the block.coinbase.

I don't see any functionality to use it to see the miners of previous blocks, like in blockhash.

3
  • Ok, since nobody knows which miner will be on the winning chain, if I use block.coinbase as seed for a pseudorandom number generation, combined with the sender address, the only way to manipulate it would be if the miner and the sender would collude, is that correct?
    – sigmawf
    Sep 25 at 16:40
  • That's an interesting proposition. But, sorry, I can't think that far currently. Feel free to post a new question about it, and do let me know, thanks Sep 25 at 19:38
  • When a miner initiates the PoW processing, is the block.coinbase value or a related value (miner address or original pk) included in the PoW puzzle input?
    – sigmawf
    Sep 26 at 0:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.