Randomness Beacon
A randomness beacon from a drand network.
Drand networks produce randomness beacons at regular intervals (rounds). Each beacon contains a BLS signature over the round number (and optionally the previous signature for chained schemes), and the final randomness value is derived from this signature.
Chained vs Unchained
Drand supports two modes:
Chained: Each beacon signs both the round and the previous signature, creating a hash chain. The previousSignature field is populated.
Unchained: Each beacon signs only the round number. The previousSignature field is null. This mode enables timelock encryption.
Read more: https://drand.love/docs/cryptography/#randomness
Properties
The final randomness value for this beacon. Returns randomness if present, otherwise computes SHA-256(signature). This is the value you should use for random number generation.
Hex-encoded previous signature (optional, for chained mode). In chained mode, this links the current beacon to the previous one. In unchained mode, this is null.
The previousSignature decoded from hex to bytes, or null. Used for chained signature verification.
Hex-encoded randomness bytes (optional, may be null). When present, this is the pre-computed randomness value. When null, randomness is derived via SHA-256 of the signature.
The derivedRandomness decoded from hex to bytes. The actual random bytes you can use in your application.
The round number as an 8-byte big-endian array. Used internally for signature verification.
The signature decoded from hex to bytes. Used for cryptographic verification operations.