Docs/Start here

Mining

This page explains what mining is on Argonmine, what it pays, how the difficulty follows the network, how a browser tab mines whole blocks without a pool, and how to mine with the desktop app, a node or your own miner.

Proof of work

A block is valid when the Argon2id hash of its 120-byte header, read as a 256-bit little-endian number, is at most the target encoded in the header's bits field. The parameters are consensus constants:

Parameter Value
Function Argon2id
Memory 8 MiB (8192 KiB)
Passes 1
Lanes 1
Output 32 bytes
Salt the ASCII bytes Argonmine/pow/v1

One attempt fills 8 MiB of memory and takes a few milliseconds on any modern core. That cost is the point. A hash that is cheap to pipeline in silicon, like SHA-256, rewards whoever can build the most specialised hardware; a hash that needs 8 MiB of fast memory per attempt is limited by memory bandwidth, which phones and laptops already have. Verifying a block costs one attempt, so nodes check headers before downloading anything else and drop peers whose headers fail.

The block hash that identifies a block is a separate tagged SHA-256 of the header. The Argon2id hash is only ever compared with the target.

The header's nonce is 64 bits, so a miner never runs out of attempts on one template, and time is 64 bits, so there is no year-2106 limit.

Difficulty

The target is recomputed for every block with ASERT (absolute scheduled exponentially rising targets). The chain has a schedule: block h should arrive 600 × h seconds after genesis. For each new block the algorithm measures how far the parent is ahead of or behind that schedule and sets

target = anchor_target × 2^((time_ahead_of_schedule) / 86400)

where the anchor is the genesis block and 86,400 seconds is the half-life. If the chain is a day behind schedule, the target doubles (difficulty halves); a day ahead, it halves. Because the reference point is fixed at genesis, rounding never accumulates and there is no window an attacker can manipulate with false timestamps. The full fixed-point arithmetic is in Specification §5.

There is a floor: the target can never be easier than the network's proof-of-work limit. On mainnet that limit is 2^18 attempts per block on average, so even an empty network cannot be filled with blocks by one machine in seconds.

Network Easiest target Expected attempts per block at the floor
mainnet 0x1E400000 262,144
testnet 0x1F7FFFFF 512
regtest 0x207FFFFF, constant about 2

Rewards

A block pays its miner the subsidy for its height plus every fee in the block. The subsidy starts at 50 ARG and halves every 210,000 blocks.

Era Heights Subsidy Approximate years from launch
1 0 to 209,999 50 ARG 0 to 4
2 210,000 to 419,999 25 ARG 4 to 8
3 420,000 to 629,999 12.5 ARG 8 to 12
4 630,000 to 839,999 6.25 ARG 12 to 16
5 840,000 to 1,049,999 3.125 ARG 16 to 20

After 64 halvings the subsidy is zero. The total is 20,999,999.9769 ARG. Fees are paid in ARG only, including for asset transfers, so the miner is always paid in the coin they mine.

A reward can be spent 100 blocks after the block that paid it. The app shows this as "maturing" and lists when each reward unlocks.

How long until a block

If your hashrate is m and the rest of the network's is N, you find a share m / (N + m) of blocks. The expected wait is

600 seconds × (N + m) / m
Your rate Network rate Expected wait
50 H/s 1 kH/s 3.5 hours
50 H/s 10 kH/s 1.4 days
300 H/s 10 kH/s 5.7 hours
300 H/s 100 kH/s 2.3 days

Finding a block is a random event with that average. Two blocks in an hour and then nothing for three days is normal at a one-day expectation. The app shows this figure as "Expected time to a block".

What to expect from hardware: a browser tab on a laptop makes tens of attempts per second; the desktop app with several threads makes a few hundred; a phone makes fewer than a laptop. The explorer's hashrate chart shows the whole network.

Solo mining from a browser

The browser app mines whole blocks on its own. There is no pool, no share accounting and no payout queue. The explorer acts as a work server: it builds block templates from its node and forwards solved blocks. It never holds coins. The protocol is two HTTP calls.

Get work

GET /api/work?address=<your address>[&ref=<referrer address>]
{
  "job_id": "…",
  "header_prefix": "<112 bytes, hex>",
  "target": "<32 bytes, hex, little-endian>",
  "height": 12345,
  "network": "testnet",
  "algorithm": "argon2id/t=1,m=8192,p=1,l=32",
  "referrer": "",
  "referral_pct": 5
}

The template's coinbase pays address the whole reward (or, with ref, the reward minus the referral share). header_prefix is the header without its final 8-byte nonce. The server rebuilds templates every ten seconds; a job is valid for five minutes.

Mine

Append a little-endian 64-bit nonce to the prefix, hash the 120 bytes with Argon2id and the parameters above, and compare the result as a little-endian number with the target. Repeat with the next nonce.

Submit

POST /api/work/submit
{"job_id": "…", "nonce": 123456789, "address": "<your address>"}
{"accepted": true, "stale": false, "hash": "<block hash>", "reason": ""}

The server checks the proof once, submits the block to its node, and answers. stale means the job's height has already been mined by someone else: fetch new work. A rejected block names the reason. The same solution submitted twice is accepted once.

Running the work server

Any explorer instance is a work server for its network:

argonmine-explorer -network mainnet -listen 0.0.0.0:8380 -referral-share 5

Point the app at it with argonmine-web -explorer https://…. The server holds no funds and needs no wallet; it only needs RPC access to a node.

Referrals

An invite link is the app's address with ?ref=<your address>. Someone who opens it and mines gives a fixed share of every block they find to you. The default share is 5%; the operator of the work server sets it with -referral-share (0 disables referrals).

The share is paid inside the block: the work server builds the coinbase with two outputs, one to the miner and one to the referrer, so the split is settled by the chain itself the moment the block is mined. Nothing is created for referrals and nobody holds the money in between. The referred miner sees the share on the Mine page and can remove the inviter in Settings, which takes effect from the next template. The explorer marks referral rewards in an address's history, and the app shows them on the Wallet and Settings pages.

Mining with the desktop app

The desktop app is a node, a wallet and a miner in one program with the same interface as the browser app.

argonmine-app -network mainnet
argonmine-app -network testnet -connect <peer:port> -threads 4

It opens http://127.0.0.1:8371 in your browser. Create or restore a wallet, press Start mining, choose the thread count. Blocks are built from the app's own node and mempool and pay the wallet's first address. Mining works while the wallet is locked; sending needs the password. The interface binds to localhost only and every call carries a per-launch token.

Mining with a node

A plain node can mine to any address:

argonmined -network mainnet -mine arg1… -threads 4 -tag "my miner"

-tag puts up to 100 bytes of text in the coinbase. For a test chain on one machine use regtest, where every block takes about two attempts:

argonmined -network regtest -listen none

and then, with the token from <datadir>/regtest/rpc.cookie:

curl -s -H "Authorization: Bearer <token>" \
  -d '{"jsonrpc":"2.0","id":1,"method":"generatetoaddress","params":[101,"rarg1…"]}' \
  http://127.0.0.1:29332/

See Run a node for every flag and RPC method.

Writing your own miner

Everything needed is public and small:

  1. Fetch a job from the work server, or call getblocktemplate on your own node and assemble the coinbase yourself (the miner package shows how).
  2. Build the 120-byte header: the 112-byte prefix plus your 64-bit little-endian nonce.
  3. Hash it with Argon2id, memory 8192 KiB, one pass, one lane, 32-byte output, salt Argonmine/pow/v1.
  4. Read the 32 bytes as a little-endian integer. If it is at most the target, submit; otherwise increment the nonce.
  5. Refresh the job when the server says it is stale or after a few minutes.

The reference implementation is the workclient package, which is what the browser miner compiles to WebAssembly.