Quantus · QTC · consensus, read from the source
Every block renegotiates
how hard the next one is.
Quantus doesn't retarget every 2,016 blocks like Bitcoin. It retargets
every single block — an Ethereum-Homestead-style formula running inside
pallet_qpow, fed by the block's own timestamp. This lab replays that exact
algorithm over every real block timestamp since genesis, so the difficulty curve below is
the chain's actual difficulty curve — recomputed, not sampled.
The retarget, exactly
One function, run at the end of every block (on_finalize).
Same formula as Ethereum's Homestead — rescaled to a 12-second target.
block_time = max(observed_ms, 500) // author-controlled floor divisor = max(target * 10 / 12, 1) // 12_000 -> 10_000 ms time_factor = block_time / divisor // integer division adjustment = max(1 - time_factor, -99) increment = parent_difficulty / 2048 new = parent + increment * adjustment // clamped to [2^17, 2^512-1]
Integer math only — the same BigInt steps the runtime executes. The live default fills in when the snapshot loads.
Retarget zones at the 12 s target
| Observed block time | time_factor | adjustment | Effect |
|---|
Difficulty history — recomputed from genesis
Every point below comes from replaying the retarget over the real timestamps of all … indexed blocks. Toggle the scale; drag the recent window.
Block-time observatory
What the chain actually felt like: inter-block times from the last … blocks, against the memoryless ideal a perfect 12-second Poisson process would draw.
Log-spaced buckets. The amber curve is the ideal exponential with λ = 1/12 s.
pallets/qpow/src/lib.rs).
PoW anatomy: Poseidon2, not SHA-256
Quantus mining hashes with Poseidon2 — a ZK-friendly algebraic hash — instead of SHA-256. The 512-bit output is the whole point.
qpow-math/src/lib.rs.
Chain selection & settlement
Heaviest target chain wins
Chain work is the sum of per-block target difficulties — deliberately not the achieved difficulty of the winning hashes. From the source: every block at a given difficulty contributes an identical, deterministic amount of work, “so cumulative chain work tracks expended hash power instead of being dominated by a single lucky hash.” A freak lucky block buys no extra chain weight.
The runtime exposes this through verify_and_get_achieved_difficulty (legacy name kept on
purpose): it returns the block's difficulty, and the client accumulates
parent_work + difficulty. Because the metric lives on-chain, flipping the whole network to
target-based work needed only a Wasm upgrade — no coordinated node-binary rollout.
The 100-block reorg bound
MaxReorgDepth = 100: the protocol's own rule for how deep a reorganization may go.
Treat it as settlement guidance, not a promise:
| Confirmations | Reading |
|---|---|
| 1–12 | Fresh; fine for pocket change, reorgable in principle |
| 13–100 | Deepening; a reorg here is expensive but protocol-legal |
| > 100 | Beyond the protocol's max reorg depth — the chain's own finality line |
Quantus has no GRANDPA-style deterministic finality on PoW blocks; >100 confirmations is the closest thing to “settled” the protocol defines. Exchanges and bridges should key their confirmation requirements to this number.
51% cost lab
What would it cost to out-hash the network? Enter your own hardware — the lab prices the attack honestly, including the part most calculators skip: there is no public rental market for qpow hashrate.
Method & sources
| Claim on this page | Source |
|---|---|
| Per-block Homestead-style retarget formula | pallets/qpow/src/lib.rs :: calculate_difficulty |
| Target block time 12,000 ms | runtime/src/lib.rs :: TARGET_BLOCK_TIME_MS |
| Genesis difficulty 99,999,999,999 | runtime/src/configs/mod.rs :: QPoWInitialDifficulty |
| Minimum difficulty 217 = 131,072 | pallets/qpow/src/lib.rs :: get_min_difficulty |
| 500 ms retarget floor | pallets/qpow/src/lib.rs :: MIN_RETARGET_BLOCK_TIME_MS |
| Max reorg depth 100 | runtime/src/configs/mod.rs :: MaxReorgDepth |
| Poseidon2 double-squeeze, validity = hash < 2512/D | qpow-math/src/lib.rs :: is_valid_nonce |
| Target-based chain work (not achieved) | pallets/qpow/src/lib.rs :: verify_and_get_achieved_difficulty |
| Block timestamps & heights | sqm.quantus.com/v1/graphql (public Subsquid indexer) |
Difficulty history is recomputed, not read: the indexer doesn't expose
QPoW.CurrentDifficulty storage, so scripts/fetch-consensus-data.mjs replays the exact
runtime algorithm over every real block timestamp (genesis block uses the 12 s target, exactly as
on_finalize does). All 142k+ heights indexed with zero gaps at snapshot time; re-run the script and
commit to refresh. Verified against upstream 2026-09-30.