Post
Topic
Board Altcoin Discussion
Re: Nxt Scripts (progress and discussion)
by
Zahlen
on 16/02/2014, 11:41:49 UTC
Now that I think about it perhaps instead of using the secondary hash (which can be altered by the forger) it might be better just to simply add up x time stamps from the following blocks and hash that (as a forger can't modify the time stamp by very much or they would end up creating an invalid block).

So given that the forger can only alter the time stamp by +-15 seconds (or it is more - am not sure about that) then at best they can decide which of 30 different values would be most suitable for a ticket that was purchased x blocks ago. It is still of some advantage to the forger who happens to be a player but it isn't a huge advantage (and you wouldn't always be able to predict that you will be the one forging the block x blocks in the future so you are still taking a risk by "buying a ticket").

Timestamp sounds like a good hard-to-predict data source! Will the timestamp be in seconds or something smaller like milliseconds? And how punctual will most forgers be in practice, once TF is activated? But whatever the case, you can control the granularity by taking e.g. floor(time / CONSTANT), or some other more sophisticated function that makes all output values approximately equally likely, so you can control how many possibilities a forging entrant could choose from.

Let N be the number of possibilities of the timestamp -> data function. You'll want N small enough to minimize cheating forger advantage, but N^x large enough that it's impractical for other cheating participants to compute a significant advantage. It's a balancing act, but sounds doable with suitable obfuscations/iterations to the lottery function.

Is there another hard-to-predict data source that can be used in addition to timestamp?

EDIT: Plenty I think, if we're sampling over multiple blocks. Total # of transactions, total Nxt transacted, sum of account numbers of everyone who made a transaction, etc. Granularity can again be controlled by suitable functions. The key thing is that we're taking data over multiple blocks, not just one, so no single forging participant can have large control.