Given a particular bitcoin balance on a particular wallet — how to compute the approximate amount of energy or compute cycles that were invested into mining it?
There are a lot of variables, such as when each input was mined? Was it 2009 or 2010 so it was likely CPU mined? Was it 2011-early 2013 when it was likely GPU or FPGA mined? What year thereafter was it mined so that you could see the likely ASIC hardware used. Then you'd have to have a guesstimate of the cost/watt of power. You'd also want to then look at how long each block took to be mined since if it took 10 seconds, that is a lot different than 20 minutes. Would you also include just the one miner who did it or all of the network attempting to mine that same block at the same time? The hash rate of the network vs the hash rate of a single miner?
You'd have to trace each input back to the block that mined it and calculate which it was. You would also have to look at the percentage of a block that it was, e.g. if it was a full block reward (50? 25? that would depend on the year) that ended up in the "balance" or was it 1/10000.
Do you also want to include the blocks that included the transfer from the block reward block to now and see what percentage of each block led to the current "balance"?
Of course, all of it would be an estimate and there are probably even more variables to take into account depending on how close you want to get to a true answer.