# dee: Rust implementation of drand
[][Documentation]

[][Crates.io]
[Crates.io]: https://crates.io/crates/dee
[Documentation]: https://docs.rs/dee/
dee is a tool to retrieve public randomness generated by drand beacon. It features an HTTP client, and verification method.
The format specification is at [drand.love/docs/specification](https://drand.love/docs/specification/). drand was designed in [Scalable Bias-Resistant Distributed Randomness](https://eprint.iacr.org/2016/1067.pdf).
The reference interroperable Go implementation is available at [drand/drand](https://github.com/drand/drand).
## Install
```bash
cargo install dee
```
## Usage
```bash
dee chain add mainnet https://api.drand.sh # Add a new beacon
dee get --set-upstream mainnet 1000 # Fetch round 1000 and set upstream to mainnet
dee get --format json # Fetch latest mainnet round as json
dee chain add testnet https://testnet0-api.drand.cloudflare.com/f3827d772c155f95a9fda8901ddd59591a082df5ac6efe3a479ddb1f5eeb202c # Add a new beacon
dee chain info testnet # Retrieve information about testnet beacon
```
## Seeding your Random Number Generator
You can leverage drand randomness as a seed for PRNG systems.
### bash
```bash
### Python
```python
import random
random.seed(int("dee-randomness", 16))
print(random.random())
print(random.random())
print(random.random())
```
### Rust
```rust
use rand::prelude::*;
use rand_seeder::{Seeder, SipHasher};
use rand_pcg::Pcg64;
fn main() {
// In one line:
let mut rng: Pcg64 = Seeder::from("dee-rng").make_rng();
println!("{}", rng.gen_range(0..100));
println!("{}", rng.gen_range(0..100));
println!("{}", rng.gen_range(0..100));
}
```
## Details
This client supports validation of chained and unchained randomness, both with signature on G1 and on G2.