🎲 drandite
An idiomatic Rust implementation for drand
drandite is an idiomatic Rust implementation of the drand stack,
covering cryptographic primitives, beacon verification, the wire protocol,
an HTTP client, and time-lock encryption.
Based on the original Go implementation, it differs by leveraging Rust's strong typing guarantees, aiming to make invalid states unrepresentable.
Cryptographic operations use formally verified libraries, libcrux and blst.
Usage
The following example fetches chain information for a pinned chain hash, retrieves the latest beacon, and verifies it before accessing its randomness.
use ;
use hex;
use Duration;
See the API documentation for more information and other uses.
AI Usage
AI tools were used to assist with documentation and tests. Approximately 90% of
the implementation was written by hand, with good part of it being ported
directly from the original Go implementation (including the kyber library)
into idiomatic Rust.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or https://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.