Skip to content
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

Closed
wants to merge 0 commits into from

Conversation

aesedepece
Copy link
Member

Solve #68

@aesedepece aesedepece force-pushed the wip-asdpc-rng/draft branch 2 times, most recently from 7bdb576 to 50a0def Compare September 9, 2021 09:43
@lrubiorod
Copy link
Contributor

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
Copy link
Contributor

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)

Copy link
Member Author

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 🤣

Copy link
Member Author

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.

@aesedepece aesedepece changed the title wip-asdpc-rng: submit draft wip-0019: submit draft Sep 9, 2021
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.
Copy link
Contributor

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?

Copy link
Member Author

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.

Copy link
Member Author

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.

Copy link
Contributor

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.

Copy link
Contributor

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.

Copy link
Member Author

@aesedepece aesedepece Sep 10, 2021

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.)

Copy link
Contributor

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).

Copy link
Member Author

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)

Copy link
Contributor

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.

Copy link
Member Author

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.

wip-0019.md Outdated Show resolved Hide resolved
wip-0019.md Outdated Show resolved Hide resolved
wip-0019.md Outdated Show resolved Hide resolved
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.

Copy link
Contributor

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.

Copy link
Member Author

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

wip-0019.md Outdated Show resolved Hide resolved
wip-0019.md Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants