-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wip-0019: submit draft #70
Conversation
7bdb576
to
50a0def
Compare
I will assign you the wip number WIP-0019 |
wip-asdpc-rng.md
Outdated
|
||
### Retrieval of type `1` sources | ||
|
||
**(4)** When retrieving a type `1` source, a node MUST generate on the spot a random and secret sequence of 32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, the protocol admit a secuence of bytes different of 32, but it will be handle in Tally creation to adapt to 32 bytes (zeropadding or cutting)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still they MUST do so. What they are free to do is to ignore the MUST 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be ok with changing it for SHOULD to acknowledge that there's no way to enforce it.
50a0def
to
114c006
Compare
wip-0019.md
Outdated
**(4)** When retrieving a type `1` source, a node MUST generate on the spot a random and secret sequence of 32 | ||
bytes. | ||
|
||
**(5)** This random and secret sequence of 32 bytes MUST be used as the result of the retrieval. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What should happen when there is a retrieval script? Should that script be executed or ignored? This sentence seems to imply that it should be ignored?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the absence of any specific mention, everything follows the original logic and the script should be executed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to forbid scripts on RNG sources? I guess there's not much use to them, but who knows.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we forbid scripts we can save 1 byte because []
is not a valid script, we currently must use [128]
. Other than that, the only use case I see for allowing scripts would be to try to write a malicious request that looks like a random request but the script makes it deterministic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can see a use for scripts where you'd process the random number on the Witnet blockchain already thereby limiting the number of calculations that need to happen in the smart contract? Currently I don't think enough operators are supported to do useful processing, but that may change in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the point of doing any kind of operation on the "local" randomness, that is, before aggregating the reveals form multiple witnesses.
A different question would be if an script could be provided such that it is applied on the result upon tally. I do believe that would be more in line which was drcpu has in mind (e.g. going from uniform to normal, mapping the randomness to a specific range, etc.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'm talking about a tally script, I missed the context of this being at the aggregation step (though I'm not sure if it would harm being able to do this in the aggregation stage too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we forbid scripts we can save 1 byte because
[]
is not a valid script, we currently must use[128]
. Other than that, the only use case I see for allowing scripts would be to try to write a malicious request that looks like a random request but the script makes it deterministic.
Nice point. Btw in a future WIP we could introduce implicit typing of scripts and other structures (remove the first byte because it's always 128
)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure about the point of doing any kind of operation on the "local" randomness, that is, before aggregating the reveals form multiple witnesses.
If the computation happens before the commit-reveal steps, the result is impossible to prove and therefore insecure. The early versions of witnet used to allow arbitrary scripts in the tally stage, but that was removed for some reason I don't remember, most likely for simplicity.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't remember either why we gave up on tally scripts, but I must recognize at this point I don't see any issue with them other than additional complexity.
114c006
to
4bc2011
Compare
4bc2011
to
37899d6
Compare
wip-0019.md
Outdated
collude around crafting their commitments in such a way that the output is favorable to them, as long as 1 single | ||
committer remains independent and commits a value that is secret to the rest, the final result will hold the desired | ||
randomness properties. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The other very unlikely attack would be a DoS attack in which a REVEAL
transaction is "denied" during the reveal_extra_rounds
period. For that to happen, an attacker would have to be able to mine 4 blocks consecutively.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I included a paragraph stating this more explicitely
37899d6
to
544cff3
Compare
544cff3
to
85bccc9
Compare
Solve #68