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?
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
I don't see any functionality to use it to see the miners of previous blocks, like in