# GPU Mining a Proof-of-Work Token on an L2

GPU mining a proof-of-work token on an L2 means running a hash search off-chain on graphics cards and submitting each winning nonce to a smart contract, which checks the hash and mints the reward. $GOURDES is mined this way on Base: the `GourdesMiner` contract accepts one solution per block, adjusts difficulty toward one solution every 60 seconds and pays 475 coins per solution in the first era, halving every 525,600 solutions. Whether mining pays for a given miner depends on hashes per solution, electricity per hash and Base gas for each `mine` call, set against the reward.

## Key facts

- $GOURDES has a hard cap of 1,000,000,000 coins, counted across all chains.
- $GOURDES has Base as its home chain.
- $GOURDES launches on 13 EVM chains plus Solana.
- $GOURDES bridges as a LayerZero v2 OFT: coins are burned on the source chain and minted on the destination chain.
- Half of the $GOURDES supply goes into locked pools at launch; the other half can only be created by proof-of-work mining on Base.
- The main $GOURDES pool on each EVM chain charges a fee that starts at 20% and falls to 0.3% over the first 60 seconds after launch.
- $GOURDES contract addresses are published on https://gourdes.finance and in https://gourdes.finance/tokenlist.json.
- $GOURDES mining pays 475 coins per solution in the first era and halves every 525,600 solutions.

## How does a proof-of-work token contract work?

A proof-of-work token contract is a smart contract that mints coins to whoever submits a number whose hash falls below a difficulty target. The contract publishes a challenge, miners search nonces off-chain, and a winning miner sends one transaction with the nonce. The contract recomputes one hash to verify it, so verification is cheap while finding the nonce is expensive.

For $GOURDES, `GourdesMiner.mine(nonce)` does this:

1. Reverts if another solution was already accepted in the same block (`OneSolutionPerBlock`).
2. Computes `digest = keccak256(challenge, msg.sender, nonce)`.
3. Reverts with `InvalidSolution` if `digest` is above `effectiveTarget()`.
4. Sets a new challenge from the digest, the solution count and the previous block hash.
5. Mints `currentReward()` to `msg.sender` through the token's `mint`, which only the miner may call.

## Why does the sender's address matter in GPU mining on-chain?

The sender's address matters because the $GOURDES hash includes `msg.sender`. A nonce that solves the puzzle for one address does not solve it for another, so a bot that copies a pending `mine` transaction from the mempool produces a failing hash. Each miner searches its own space, and pooled mining requires the pool to submit from its own address.

`digestFor(miner, nonce)` returns the digest the contract would compute, which a miner can use to test its implementation against the live challenge.

## What are the $GOURDES mining parameters?

| Parameter | Value | Where set |
|---|---|---|
| Hash function | keccak256 over challenge, sender, nonce | `GourdesMiner.mine` |
| Target solution time | 60 seconds | `TARGET_SOLUTION_TIME` |
| Retarget interval | Every 64 solutions | `RETARGET_INTERVAL` |
| Retarget step limit | Between 1/4 and 4 times per epoch | `_retarget` |
| Starting difficulty | About 2^36 expected hashes per solution | `START_TARGET = max >> 36` |
| Easiest allowed target | `max >> 8` | `MAX_TARGET` |
| Hardest allowed target | `1 << 32` | `MIN_TARGET` |
| First-era reward | 475 coins per solution | `INITIAL_REWARD` |
| Halving | Every 525,600 solutions | `HALVING_INTERVAL` |
| Mining budget | 500,000,000 coins, Base only | `MINING_BUDGET` |

2^36 is about 68.7 billion hashes. At a sustained rate of 1.35 billion keccak hashes per second, that is about 51 seconds per expected solution.

## How does $GOURDES difficulty adjust?

$GOURDES difficulty adjusts in two ways.

- **Retargeting.** After every 64 solutions, `_retarget` compares the time the epoch took with the expected 3,840 seconds (64 times 60) and scales the target by elapsed over expected. The step is clamped to between one quarter and four times per epoch, which limits both timestamp games and sudden hashrate changes.
- **Easing.** If no one has solved for a while, `effectiveTarget()` doubles the target once for every 240 seconds of silence (`EASING_K = 4` times 60 seconds), up to `MAX_TARGET`. Easing affects only the current solution and does not change the stored target, so mining recovers after hashrate leaves without a permanent jump in ease.

## How does the one-solution-per-block rule interact with Base block times?

The one-solution-per-block rule means at most one $GOURDES solution is accepted per Base block. Base produces a block every 2 seconds, so the rule caps the solution rate at one every 2 seconds. If the network's hashrate is far above difficulty, an epoch of 64 solutions takes at least 128 seconds, against 3,840 seconds expected, and the retarget then makes mining four times harder in one step.

When two miners find solutions for the same challenge, the first one included wins. The second `mine` transaction reverts, either because a solution was already accepted in that block or because the challenge changed, and the losing miner pays Base gas for the failed call.

## How much $GOURDES does mining emit over time?

$GOURDES mining emits by solution count, not by calendar. At the 60-second target, 525,600 solutions take about a year.

| Era | Reward per solution | Solutions in era | Coins emitted in era |
|---|---|---|---|
| 1 | 475 | 525,600 | 249,660,000 |
| 2 | 237.5 | 525,600 | 124,830,000 |
| 3 | 118.75 | 525,600 | 62,415,000 |

At the target rate, era 1 emits 684,000 coins per day. The geometric total approaches 499,320,000 coins, under the 500,000,000-coin budget, and `currentReward()` clamps the final payouts to whatever budget remains.

## What does a $GOURDES solution cost a GPU miner?

A $GOURDES solution costs a GPU miner the energy for the expected hashes plus gas for the `mine` transaction.

`cost_per_solution = (expected_hashes / hashrate) * power_draw * energy_price + base_gas_per_mine_call`

`expected_hashes = 2^256 / target`

`revenue_per_solution = currentReward()`

Three adjustments apply:

1. **Share of the network.** A miner with a fraction p of total hashrate wins about p of all solutions over time, so expected coins per hour are p times 60 times the current reward at the target rate.
2. **Stale work.** Every accepted solution changes the challenge, so a search in progress is discarded when anyone else solves.
3. **Failed submissions.** A losing submission in a contested block still pays gas.

The site states that the $GOURDES team also mines with its own graphics cards under the same rules as everyone else.

## What happens to mined $GOURDES?

Mined $GOURDES is minted on Base to the solving address and is an ordinary $GOURDES balance from then on. It can be traded in the Base pools, staked on Base for a share of Base fees, or bridged to any of the other 13 chains through the $GOURDES LayerZero routes, at up to 1,000,000 coins per message. Mining does not exist on Solana or on the other EVM chains.

The [mining page](https://gourdes.finance/mining/) shows the live challenge and reward. The [bridge page](https://gourdes.finance/bridge/) moves mined coins, the [staking page](https://gourdes.finance/staking/) covers staking, the [home page](https://gourdes.finance/) trades and the [about page](https://gourdes.finance/about/) has the supply split.

## Questions and answers

**Can you GPU mine $GOURDES?**
Yes. $GOURDES is mined on Base by searching keccak256 nonces off-chain and submitting winners to `GourdesMiner.mine`.

**What is the $GOURDES block reward?**
475 coins per solution in the first era, halving every 525,600 solutions.

**How often is a $GOURDES solution accepted?**
Difficulty targets one solution every 60 seconds, with at most one accepted per Base block.

**Can someone steal my mining solution from the mempool?**
No. The hash includes the sender's address, so the nonce fails for anyone else.

**Is $GOURDES mining available on chains other than Base?**
No. Mining exists only on Base; mined coins can then be bridged to the other chains.

**How much $GOURDES can ever be mined?**
At most 500,000,000 coins. The halving schedule approaches 499,320,000 coins.

**What happens if hashrate drops sharply?**
The target doubles for every 240 seconds without a solution, and the next retarget can ease difficulty by up to four times.
