Repository navigation
WINEX Core v4.1.0 — Mainnet Hard Fork (90-second blocks)
Activation height: FORK_V41_HEIGHT = 1200 (pkg/consensus/fork_v41.go: ForkV41Height, winex_core.py: FORK_V41_HEIGHT)
This is a mandatory consensus upgrade. Nodes, pools and miners that do not upgrade before block #1,200 will reject the new chain.
What changes at block #1,200
| Before (blocks < 1,200) | v4.1.0 (blocks ≥ 1,200) | |
|---|---|---|
| Target block time | 900 s | 90 s |
| Block reward | 40.0 WNX | 4.0 WNX (same emission per hour) |
| Halving interval | 125,000 blocks | 1,250,000 blocks (same ~3.56 years) |
| Difficulty adjustment | 8-block moving average (wall-clock based) | Per-block LWMA over 30 blocks |
| Stall protection | 45-minute minimum-difficulty floor | 180 s decay, 360 s floor |
| Timestamp rules | ≥ parent − 60 s, ≤ now + 24 h | > median of last 11 blocks, ≤ now + 120 s |
| Max supply | 12,100,000 WNX | 12,100,000 WNX (unchanged) |
Emission and supply
Post-fork heights are mapped to a legacy-equivalent height h_eq = 1200 + floor((h − 1200) / 10), and the reward is 4 WNX >> floor((h_eq − 1) / 125000). Halvings therefore happen at the same moments in time as under the original schedule. The first post-fork halving is at block 1,239,210, then every 1,250,000 blocks. Total PoW emission stays at or below 10,000,000 WNX; with the 2,100,000 WNX Ecosystem & Liquidity Reserve the cap is 12,100,000 WNX.
Difficulty adjustment (LWMA)
Each post-fork block's base target is a linearly weighted moving average over the last 30 blocks (solve times clamped to 1–540 s), aimed at 90 s. The first post-fork block starts from the legacy base target made ten times easier. All arithmetic is integer-only. A block's target depends only on chain data and its own timestamp, so every post-fork block is checked against its exact target during full chain replay.
Emergency difficulty decay (anti-stall)
Measured from the parent block's timestamp:
- ≤ 180 s: LWMA target.
- 180–360 s: the target doubles every 30 s.
- ≥ 360 s: minimum-difficulty floor (
0000ffff…), so any active miner finds the block almost immediately.
Every block still needs a real double SHA-256 Proof-of-Work hash meeting its target; nothing is bypassed. The median-time-past and 120-second future-drift rules prevent miners from faking elapsed time to trigger the decay.
Templates and Stratum
/api/mining/template, getblocktemplate and both Stratum servers (Go pkg/consensus/stratum.go, Python server/winex_stratum.py) compute the target from the current time. They push a new job as soon as the target becomes at least twice as easy, which happens at every decay step and at the 360 s floor.
Upgrade instructions
Node operators (Go standalone node): build cmd/winex-node from this release and restart before block #1,200. The node replays and verifies the full chain from genesis on start-up.
Reference gateway (Python): deploy server/winex_core.py, server/winex_api.py and server/winex_stratum.py together, then restart the API service and the Stratum service. The database schema does not change.
Mining pools:
- Upgrade the node or gateway your pool talks to.
- Expect a 10× higher block rate with a 10× lower reward per block. Payout thresholds and maturity windows counted in blocks should be scaled ×10 to keep the same wall-clock behaviour.
- Refresh jobs when the template target changes, not only on a new block. The bundled Stratum servers already do this.
- Use the template
server_time(or the current time) as the block timestamp. Timestamps more than 120 s in the future are rejected after the fork.
Miners: update to the latest miner, or point it at an upgraded pool. No configuration change is needed.
Exchanges: confirmation counts expressed in blocks should be multiplied by 10 to keep the same time-based security, for example 60 confirmations instead of 6.
Verification (offline)
go test ./pkg/consensus -count=1
python3 -m pytest -q testspkg/consensus/fork_v41_test.goreproduces every value intests/vectors/v41_vectors.json, which is generated by the Python reference (tests/gen_v41_vectors.py). This covers rewards, LWMA chains, decay steps, timestamp rules and pre-fork targets. It also replays a chain across the fork with real PoW and checks the supply cap.tests/test_v41_fork.pymines real PoW blocks through the Python gateway across the fork and checks the 40 → 4 WNX switch, the 90 s / 200 s / 360 s template targets, and the timestamp rules. It also checks that a hash meeting only the floor is rejected at 90 s.WINEX_REPLAY_FILE=<export.json> go test ./pkg/consensus -run TestOfflineChainReplayreplays a full mainnet export, produced byscripts/recover_pubkeys.py --export, through the Go verifier.