BeaconConfig
Storage Plain v216 → currentThe Drand beacon configuration used for verifying randomness pulses.
Explore chainThe Big Picture
This is the 'trust anchor' for on-chain randomness. It contains the Drand network's public key and parameters. When a pulse is submitted, the chain verifies its BLS signature against this configuration. If BeaconConfig is wrong, no valid pulses can be verified.
Why This Matters
All randomness verification depends on this configuration being correct. If you're building on Drand randomness or running infrastructure, you need to ensure your offchain worker fetches from a beacon matching this configuration.
Example Scenario
Query BeaconConfig() returns {public_key: '...', genesis_time: 1692803367, period: 30, ...}. This tells you the chain expects pulses from a Drand beacon with 30-second periods starting at that genesis time. Fetch from a matching beacon (e.g., api.drand.sh).
Common Questions
- What if my offchain worker uses a different beacon?
- Pulse verification will fail - signatures won't match. Ensure your worker fetches from a beacon matching BeaconConfig exactly.
- How often does this change?
- Rarely. Only when Drand itself migrates or the chain switches beacon networks. Most chains run years on the same configuration.
Use Cases
- Configure offchain workers to fetch from correct Drand beacon
- Verify current randomness source parameters
- Debug pulse verification failures
- Audit randomness infrastructure configuration
From Chain Metadata
the drand beacon configuration
Purpose & Usage
Purpose
Stores public keys, genesis time, period, and other parameters needed to verify Drand signatures.
Common Query Patterns
- Query to understand current randomness source
- Verify beacon parameters before submitting pulses
- Check configuration for offchain worker setup
Notes
- Contains BLS public key, genesis time, period, and chain hash
- Must match the external Drand beacon exactly
- Changed via set_beacon_config (root only)
Stored Value
value (BeaconConfiguration)
Relationships
Modified By
Related Events
Code Examples
import { ApiPromise, WsProvider } from "@polkadot/api";
import { stringCamelCase } from "@polkadot/util";
const provider = new WsProvider("wss://entrypoint-finney.opentensor.ai:443");
const api = await ApiPromise.create({ provider });
// Query BeaconConfig storage (no keys - plain value)
const result = await api.query
[stringCamelCase("Drand")]
[stringCamelCase("BeaconConfig")]();
console.log("BeaconConfig:", result.toHuman());Runtime Info
View Source- Pallet
- Drand
- Storage Kind
- Plain
- First Version
- v216
- Current Version
- v393