-
Notifications
You must be signed in to change notification settings - Fork 23
doc: include RNG documentation #98
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
Conversation
docs/protocol/data-requests/rng.md
Outdated
| Witnet requests are currently used to retrieve information from public external APIs to Witnet network and | ||
| other blockchains that are connected with it. Moreover, using the structure about Witnet network, another | ||
| functionality as Random Number Generator (aka RNG) is possible, providing a real random number created by | ||
| several witnesses in a decentralized way. |
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.
No need to beat around the bush. Let's go straight to the point of RNG. This paragraph can be dropped altogether.
docs/protocol/data-requests/rng.md
Outdated
| ## Witnet RNG request | ||
| The Witnet RNG request shares the same structure as a normal request with the 3 stages (retrieval, | ||
| aggregation and tally) and it will be solved by the same witnesses that are currently working in the Witnet | ||
| mainnet. To retrieve this new functionality those are the changes: |
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.
| mainnet. To retrieve this new functionality those are the changes: | |
| mainnet. |
docs/protocol/data-requests/rng.md
Outdated
| are not necessary, so the `url` will be empty and the `script` won't be read so we can specify the code | ||
| for an empty array. We only use an only retrieval for this kind of requests. |
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.
| are not necessary, so the `url` will be empty and the `script` won't be read so we can specify the code | |
| for an empty array. We only use an only retrieval for this kind of requests. | |
| are not necessary: the `url` field must be empty and the `script` field will be ignored, so we can specify the CBOR code for an empty array ([128]`). A single source is used in the retrieval section of this kind of requests. |
docs/protocol/data-requests/rng.md
Outdated
| Aggregation is not necessary due to RNG requests has only one retrieval. To unwrap the `RadonArray` with | ||
| only one element we will use the `Mode` as a `RadonReducer` without filters. |
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.
| Aggregation is not necessary due to RNG requests has only one retrieval. To unwrap the `RadonArray` with | |
| only one element we will use the `Mode` as a `RadonReducer` without filters. | |
| Aggregation is not necessary due to the fact that RNG requests have only one retrieval. To unwrap the `RadonArray` into a single element, we will use the `Mode` as a `RadonReducer` without filters. |
docs/protocol/data-requests/rng.md
Outdated
| For the tally stage a new `RadonReducer` is required, `HashConcatenate`. This reducer takes the | ||
| `RadonBytes` sent by witnesses, concatenate them in a single vector of bytes and hash them with Sha2_256. | ||
| As the aggregation stage, no filters are required. |
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.
| For the tally stage a new `RadonReducer` is required, `HashConcatenate`. This reducer takes the | |
| `RadonBytes` sent by witnesses, concatenate them in a single vector of bytes and hash them with Sha2_256. | |
| As the aggregation stage, no filters are required. | |
| For the tally stage, a new `RadonReducer` is required, `HashConcatenate`. This reducer takes the | |
| `RadonBytes` revealed by the witnesses, concatenate them into a single vector of bytes and hash them with SHA256. In the same way as in the aggregation stage, no filters are required. |
docs/protocol/data-requests/rng.md
Outdated
| ## Conclusions | ||
| The random number generated by Witnet protocol is the result of a Hash function which its seed comes from | ||
| the random bytes provided by several different witnesses selected randomly in the Witnet mainnet. In this | ||
| way, randomness comes from the decentralization nature of Witnet protocol. |
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.
| ## Conclusions | |
| The random number generated by Witnet protocol is the result of a Hash function which its seed comes from | |
| the random bytes provided by several different witnesses selected randomly in the Witnet mainnet. In this | |
| way, randomness comes from the decentralization nature of Witnet protocol. | |
| ## Conclusions | |
| The random numbers (actually, random bytes) generated by the Witnet protocol are the result of applying a hash function on a crowdsourced seed coming from the random bytes provided by several different witnesses, as selected randomly by the Witnet protocol. That is, the randomness property of these are powered by the decentralized nature of the Witnet network. |
docs/protocol/data-requests/rng.md
Outdated
| # Random Number Generation | ||
|
|
||
| ## Witnet RNG request | ||
| The Witnet RNG request shares the same structure as a normal request with the 3 stages (retrieval, aggregation and |
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 do you think about use a more specific word such as HTTP-GET or even standard?
| The Witnet RNG request shares the same structure as a normal request with the 3 stages (retrieval, aggregation and | |
| The Witnet RNG request shares the same structure as an HTTP-GET request with the 3 stages (retrieval, aggregation and |
| ### Retrieval | ||
| As a source for RNG requests, we specify a new `RADType` called `Rng`. This new source will trigger the creation of a | ||
| random vector of 32 bytes, instead of reading data from an API source. The rest of fields are not necessary: the `url` | ||
| field must be empty and the `script` field will be ignored, so we can specify the CBOR code for an empty array |
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.
| field must be empty and the `script` field will be ignored, so we can specify the CBOR code for an empty array | |
| field must be empty and the `script` field will be ignored so we can specify the CBOR code for an empty array |
docs/protocol/data-requests/rng.md
Outdated
|
|
||
| ### Retrieval | ||
| As a source for RNG requests, we specify a new `RADType` called `Rng`. This new source will trigger the creation of a | ||
| random vector of 32 bytes, instead of reading data from an API source. The rest of fields are not necessary: the `url` |
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.
| random vector of 32 bytes, instead of reading data from an API source. The rest of fields are not necessary: the `url` | |
| random vector of 32 bytes, instead of reading data from an API source. The rest of the fields are unnecessary: the `url` |
docs/protocol/data-requests/rng.md
Outdated
|
|
||
| ### Tally | ||
| For the tally stage, a new `RadonReducer` is required, `HashConcatenate`. This reducer takes the `RadonBytes` revealed | ||
| by the witnesses, concatenate them into a single vector of bytes and hash them with SHA256. In the same way as in the |
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.
| by the witnesses, concatenate them into a single vector of bytes and hash them with SHA256. In the same way as in the | |
| by the witnesses, concatenates them into a single vector of bytes and hash them with SHA256. In the same way, as in the |
docs/protocol/data-requests/rng.md
Outdated
| ## Conclusions | ||
| The random numbers (actually, random bytes) generated by the Witnet protocol are the result of applying a hash | ||
| function on a crowdsourced seed coming from the random bytes provided by several different witnesses, as selected | ||
| randomly by the Witnet protocol. That is, the randomness property of these are powered by the decentralized nature |
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.
| randomly by the Witnet protocol. That is, the randomness property of these are powered by the decentralized nature | |
| randomly by the Witnet protocol. That is, the randomness property of these is powered by the decentralized nature |
It is included inside of data request section but it could be moved
Close #97