How AST Proof‑of‑Work Works
A visual guide to the mining block, preimage, hashing, race mechanics, token economics, halving, finalization, fees and rewards.
Overview
- AST uses a blockchain PoW race. The contract publishes a header, a seed, a global target and an expiry (block end).
- Miners compute double‑SHA256 over a specific preimage and compare the result to the target and the current network best hash.
- If you find a qualifying hash, you must submit it before the block ends. After expiry, anyone can finalize_window.
Preimage & Hashing
Treat H = SHA256(SHA256(preimage)) as a big‑endian integer. A solution is valid if H ≤ target and, when a network best exists, also H < best.
// Preimage (binary concatenation) // seed || miner_canon || nonce_be(16) || header // double SHA-256 → compare as big-endian integer const pre = concat(seed, minerCanon, nonceBE16, header); const h1 = sha256(pre); const h2 = sha256(h1); const ok = (int(h2) <= target) && (!best || int(h2) < int(best));
Mining Race & Block
The contract publishes current block parameters: header (base64), seed (base64), target (Uint256), expiry time.
Exactly: seed || miner_canon || nonce(16B, BE) || header. The miner_canon is the canonical 20-byte form of your inj… address.
Compute SHA256(SHA256(preimage)). Interpret as big-endian integer and compare.
You’re valid only if hash ≤ target AND (if a network best exists) hash < best. Found one? Submit before the block ends!
When time is up, anyone may call finalize_window. The winner becomes the block’s candidate and receives the reward.
- Submission fee: 0.01 INJ per submit to discourage spam.
- Finalize: After the block ends,
finalize_windowlocks the winner and moves to the next block. - Fairness: The race rule prevents late, weaker hashes from replacing the current best.
Tokenomics & Halving
AST issuance follows a classic halving schedule. The base reward starts at an initial value per block and is halved every epoch, reducing inflation over time and rewarding early miners while converging toward scarcity.
- Initial Reward: configurable at deployment or via governance.
- Epoch Length: number of blocks per epoch; defines when halving occurs.
- Supply Cap: practical cap emerges as rewards diminish toward zero.
Fees, Rewards & Incentives
Each submit burns 0.01 INJ to deter spam.
Winner receives the block reward (in AST)
Only hashes that beat the current best and meet the global target are acceptable.
Security & Correctness
- Deterministic Preimage: All fields and order are fixed. Any mismatch results in an invalid hash.
- Nonce Size: 16‑byte big‑endian (Uint128) prevents trivial wraparounds; clients can use random or strided search.
- Comparison: Use big‑endian integer comparison of the full 32‑byte hash.
- Anti‑Spam: Submission fee limits useless transactions; only the best practical candidate should be submitted.
FAQ
It’s a timed round. The contract defines a header, seed, target, and an expiry. You mine only for that round. After expiry, finalize_window seals the result and the next round begins.
Yes. Mining after expiry is meaningless for that round. The UI pauses and waits for finalization / the next block.
To ensure the strongest proof wins. This keeps the race fair and discourages flooding with weaker submissions.
Yes. Rewards halve every epoch. The exact parameters (initial reward, epoch length) are set by the protocol.
Connect your wallet in the Miner page and join the live race.