Menu

Per-block difficulty adjustment in a post-quantum Proof-of-Work chain (Rust, integer-only) published:
📰

Per-block difficulty adjustment in a post-quantum Proof-of-Work chain (Rust, integer-only) published:

DEV Community: rust·Althaaf Mohamed·3 days ago
#r5u0JODB
#devtorust#devto#dev#difficulty#block
Reading 0:00
15s threshold

I'm building Quantum-Lattice (QL) , a Layer 1 Proof-of-Work chain written in Rust that signs every transaction with ML-DSA-65 (NIST FIPS 204), a post-quantum signature scheme. This post covers one piece of the latest hard fork: moving from a coarse every-10-blocks difficulty retarget to a per-block, fixed-point adjustment.

The old rule

Difficulty was an integer number of leading zero bits, recalculated every 10 blocks and clamped to ±2 bits per step. That is simple, but coarse: it only reacts at window boundaries, it moves in whole bits, and a window can land in a band where the rounded result is zero change.

The new rule

Three ideas:

Fixed-point difficulty. 65,536 units = 1 bit. The target is 2^(256 - d) for fractional d , so difficulty can move in tiny steps.

Integer-only math. Consensus code must give identical results on every machine, so no floats. The fractional power of two uses a cubic polynomial approximation (the same constants as Bitcoin Cash's aserti3 family).…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.