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

Preimage Layout
Seed
Miner Canon (20B)
Nonce (16B, BE)
Header
Validation Rule

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

Get Work

The contract publishes current block parameters: header (base64), seed (base64), target (Uint256), expiry time.

Build Preimage

Exactly: seed || miner_canon || nonce(16B, BE) || header. The miner_canon is the canonical 20-byte form of your inj… address.

Hash Twice

Compute SHA256(SHA256(preimage)). Interpret as big-endian integer and compare.

Race Rule

You’re valid only if hash ≤ target AND (if a network best exists) hash < best. Found one? Submit before the block ends!

Finalize

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_window locks 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.

Reward per Epoch
Cumulative Emissions
  • 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

Submission Fee

Each submit burns 0.01 INJ to deter spam.

Winner Payout

Winner receives the block reward (in AST)

Fair Race

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

What exactly is the mining block?

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.

Do I need to stop when the block ends?

Yes. Mining after expiry is meaningless for that round. The UI pauses and waits for finalization / the next block.

Why do I need to beat the network best?

To ensure the strongest proof wins. This keeps the race fair and discourages flooding with weaker submissions.

Is there a halving like Bitcoin?

Yes. Rewards halve every epoch. The exact parameters (initial reward, epoch length) are set by the protocol.

Ready to mine the next block?

Connect your wallet in the Miner page and join the live race.