Beacon Verification Service
Service responsible for cryptographic verification of drand randomness beacons.
This service implements the complete drand beacon verification pipeline, which includes:
Round validation - Ensuring the beacon round matches the expected value
Randomness validation - Verifying that randomness = SHA256(signature)
Signature verification - Cryptographically verifying the BLS signature
The verification process follows the drand specification and ensures that beacons are authentic and have not been tampered with. All beacons must pass all three checks to be considered valid.
Supported Schemes
This service supports all BLS12-381 signing schemes:
pedersen-bls-chained- League of Entropy default networkpedersen-bls-unchained- Timelock encryption compatiblebls-unchained-g1-rfc9380- Quicknet network (RFC 9380 compliant)
Usage
Typically used internally by DrandClient, but can be used standalone:
val verifier = BeaconVerificationService()
val chainInfo = // ... fetch from drand API
val beacon = // ... fetch beacon
val result = verifier.verifyBeacon(
chainInfo = chainInfo,
beacon = beacon,
expectedRound = 1000
)
result.onSuccess { verifiedBeacon ->
println("Beacon verified: ${verifiedBeacon.randomness}")
}.onFailure { error ->
println("Verification failed: ${error.message}")
}See also
Functions
Validates that the beacon's randomness field equals SHA-256(signature).
Validates that the beacon's round number matches the expected round.
Verifies a beacon against expected round and chain info.
Verifies the beacon's BLS signature using the chain's public key and cryptographic scheme.