Prevents timestamp manipulation by enforcing minimum advancement between blocks.
Current Value
6000The Big Picture
This constant ensures timestamps can't go backwards or stay static between blocks. Each new timestamp must exceed the previous by at least MinimumPeriod milliseconds. With Aura consensus, the expected block time is exactly 2 * MinimumPeriod. This provides a fundamental time safety guarantee for all time-dependent chain logic.
Why This Matters
Understanding block timing is essential for any time-based application. If MinimumPeriod is 6000ms (6 seconds), blocks come roughly every 12 seconds. This affects how you design timeouts, deadlines, and rate-limiting logic.
Example
Query MinimumPeriod() returns 6000 (milliseconds). With Aura, this means blocks are produced every ~12 seconds (2 * 6000ms). If your application needs a 1-hour delay, that's approximately 300 blocks (3600000ms / 12000ms).
Common Questions
- Why is block time 2x MinimumPeriod?
- With Aura consensus, the slot duration is 2 * MinimumPeriod. This ensures each block can safely increase the timestamp by at least MinimumPeriod without violating constraints.
- Can validators set any timestamp above the minimum?
- They have flexibility, but consensus mechanisms typically constrain the allowed range. Setting a timestamp too far in the future would be rejected by other validators.
- How does this compare to Ethereum?
- Ethereum has different timestamp constraints. Bittensor's MinimumPeriod provides tighter guarantees, making on-chain time more predictable and reliable.
From Chain Metadata
The minimum period between blocks. Beware that this is different to the *expected* period that the block production apparatus provides. Your chosen consensus system will generally work with this to determine a sensible block time. e.g. For Aura, it will be double this period on default settings.
Use Cases
- Calculate expected block time (2 * MinimumPeriod)
- Validate timestamp progression
- Understand block timing constraints
How to Use This Constant
- → Read once at startup to understand timing constraints
- → Used internally by runtime to validate timestamps
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 MinimumPeriod constant
const value = api.consts[stringCamelCase("Timestamp")][stringCamelCase("MinimumPeriod")];
console.log("MinimumPeriod:", value.toHuman());
// Convert RAO to TAO if this is a balance value
const taoValue = value.toBigInt() / BigInt(1e9);
console.log("TAO:", taoValue.toString());Type Information
- Type
- u64
- Byte Size
- 8 bytes
- Encoding
- fixed
- Raw Hex
- 0x7017000000000000
Runtime Info
- Pallet
- Timestamp
- First Version
- v101
- Latest Version
- v101
- Current Runtime
- v393