A single computer's entropy allowance is a stub. This project tries to extract random streams from the distributed network of computers provided by Golem. The idea is to have a rest API sitting on some address that when invoked, asks Golem nodes for their random data. Each node runs some special software that employ a variaty of PRNGs to provide the requested randomness. At the moment, there are two PRNGs, one based on Chaos machines and the other that makes use of Sodium.
first off please head to Golem handbook and learn how to setup a requestor workflow.
Simply run the script.sh
file via your shell and wait for the output. The output you receive depends on the length and number sources you pass to the script.
Example:
~$ ./script.sh -s 8 -l 16
asks for 16 bytes of random data from 8 sources.
The output would be:
{ "csprng": { "xored": "2NyHU/7UtXf5q0kZsi9C5g==", "streams": [ "F4wOs1o/9K0CaxYpBnrgNQ==", "B+ID7aLtBYWicr5bdSV00w==", "IpY6WCP3LcsnBOnq4HXWQA==", "JawP1hOK6EqWHfFZ8KarIg==", "FH5XJRJ7VkDbly6vV7mrCw==", "oF9yoBlzqsTASyl4YOCQRA==" ] }, "chaos": { "xored": "NKMedZrCXZZsaYCAyZoiyg==", "streams": [ "pwzGJczOkP6KQuQUySiuNg==", "tE8AgO7SFzp2gHz6WNx+Xg==", "CNBMpcYIJnTwwSgRXKqvTA==", "mC+wQN7sDpDPCWB4TtqhgA==", "OgCY3WKKRJrsboyegWAivA==", "rKfiPKBYglTdZ5CAzBKloA==" ] } }
If sources are > 2, two are choosen in random, removed from the list and xored. This is done to enrich the outcome.
Note that this API is just an experiment and still in development. So, please employ extreme caution in using it in real applications.
- Make sure the sources are distinct
- Cryptographically secure tests & benchmarks
- Hook a public REST API for smart contract consumers