artonomous / artonomous-mvp

A Self-Owning, Self-Sustaining, Self-Improving Autonomous Artist Using the Ethereum Blockchain
158 stars 21 forks source link

Use block as unit time instead of I.S ? #16

Closed Asone closed 6 years ago

Asone commented 6 years ago

As per documentation recommandations

Both the timestamp and the block hash can be influenced by miners to some degree. Bad actors in the mining community can for example run a casino payout function on a chosen hash and just retry a different hash if they did not receive any money.

Wouldn't it be safer to use blocks number as unit of time instead of the I.S ? e.g : example here

Asone commented 6 years ago

i made a draft you can see here

Any positive/negative feedback would be welcome in order to know if i should open PR for that.

simondlr commented 6 years ago

Hey @Asone! Thanks for opening up this issue.

I think it should be okay. Timestamps can be manipulated by miners, yes. In this case however, the timestamp is not as important. It's only useful in setting timeframes for when the auctions end. It's unlikely that a miner would want to manipulate an auction to end sooner than intended (the only useful reason for manipulating the time).

This stackexchange answer gives good reasoning on it. https://ethereum.stackexchange.com/questions/413/can-a-contract-safely-rely-on-block-timestamp. Particularly, this quote: "block.timestamp should only be safely used if the total amount of value resting on what the contract does at "expiration time", is lower than what a miner earns by mining a single block".

Additionally, moving to block numbers needs to be more future proof in the event that blocks can arrive potentially faster in the future with proof-of-stake. Thus, timestamps are fine for now.

What's perhaps more interesting is that if the artonomous bot becomes so massive on Ethereum that a better piece of art will cause the price of Ethereum to rise to such an extent that a miner is incentivized to manipulate the blockhash at the start of auctions such that the miner believes it's more advantageous vs not manipulating the blockhash. Doubt that would ever happen though.

Asone commented 6 years ago

thanks for the explanation, your remark seems quite leggit so i close the issue ^^

Thanks again for taking the time to explain !