$GOURDES

$GOURDES

Mining $GOURDES on Base

Half of every $GOURDES that will ever exist, 500,000,000 coins, can only be created by mining. Mining runs on Base through a public contract with no owner. Anyone with a computer and a Base wallet can take part, under the same rules we follow with our own graphics cards.

Miner contract on Base: 0xdfaBce24c8C1fbEc42327fb336A229606810b497 (explorer). It mints the $GOURDES coin 0xB614b287dA2BD9574181cF9CCA8D049d26AF22d0. Mining is open when the contract's started() function returns true; the miner program below checks this itself and waits until it does.

Mining right now

The current reward, difficulty and solution count load here from the miner contract on Base. This needs JavaScript; the trade page shows the same numbers when Base is selected.

Miner leaderboard

The leaderboard of every wallet that has mined GOURDES loads here. This needs JavaScript; every solution is also on the explorer under the miner contract.

How the puzzle works

The miner contract stores a value called the challenge and a number called the target. A solution is any number, the nonce, for which this hash comes out at or below the target:

keccak256(challenge, your address, nonce) <= target

Hashes are unpredictable, so the only way to find a good nonce is to try a huge number of them. A lower target means fewer hashes qualify, which means more tries on average. That is the whole of the work in proof of work.

Three details make the puzzle fair:

The reward and the halving

Each accepted solution mints the current reward straight to the address that submitted it. The reward halves after a fixed number of solutions, on a schedule set when the contract is deployed. Nobody can change it afterwards.

The sum of all rewards is capped at the mining budget, half the total supply. The miner contract checks this on every solution and clamps the last reward to what is left, and the token contract keeps its own separate count and refuses to mint past the budget. When the reward reaches zero, by halving or because the budget is used up, mining is over for good.

Once mining is live, the trade page shows the reward right now, the current difficulty, the number of solutions so far and how much is left to mine, read straight from the contract when Base is selected.

Difficulty: one solution a minute

The contract aims for one solution per minute across all miners together. Every fixed number of solutions it compares how long that batch actually took with how long it should have taken, and moves the target in proportion:

The contract started with a target of about 236 hashes per solution on average, roughly 68.7 billion, which is about 51 seconds of work for one NVIDIA RTX A5000 graphics card at 1.35 billion hashes per second. When nobody mines, the easing below lowers the work step by step down to the contract's floor, and the retarget raises it again as miners join, to keep the pace near one a minute. The difficulty right now is in Mining right now at the top of this page.

If everyone stops

A miner with a lot of hardware could push the difficulty up and then leave, and nobody else could find a solution. The contract prevents that stall: for every four minutes without a solution, the target used to judge the next one doubles, which halves the work needed. The easing ends as soon as a solution is accepted, and the regular retarget then settles the difficulty to the hashing power that is really there.

What you need to mine

Run the miner

The miner is a Python program. It mines on one or many graphics cards and on processor threads at the same time, and it is the same program we mine with. It needs no account, and it connects only to the Base endpoints you give it. Read it before you run it: it is plain source code.

Easy start: Windows or Docker

Two downloads hold the same miner files as the table below, with everything they need to run. You still need a mining wallet with a little ETH on Base (see Requirements).

Windows, 64-bit (tested on Windows 11)

  1. Download gourdes-miner-windows-x64.zip and unzip it. It includes Python and every package, so there is nothing else to install. Your graphics card's normal Windows driver provides OpenCL.
  2. Double-click start-miner.bat. The first time, it asks for the mining wallet's private key (the typing stays hidden), lists your graphics cards and processor, and lets you choose. The key is saved in keys\hot.key inside the folder, readable only by your Windows user.
  3. It then mines and prints each solution. test-miner.bat does a dry run that sends nothing, list-devices.bat shows your devices and their speed, and stop-miner.bat (or closing the window) stops it.

Windows may show a SmartScreen warning because the package is not signed. Check the zip's sha256 against the table below first (certutil -hashfile gourdes-miner-windows-x64.zip SHA256), then choose More info and Run anyway.

Docker, Linux (NVIDIA cards with the NVIDIA Container Toolkit, or the processor on any machine)

docker build -t gourdes-miner https://gourdes.finance/miner/gourdes-miner-docker.tar.gz
mkdir -m 700 gourdes-data
docker run -it --rm --gpus all --user "$(id -u):$(id -g)" -v "$PWD/gourdes-data:/data" gourdes-miner setup
docker run -d --name gourdes-miner --gpus all --user "$(id -u):$(id -g)" -v "$PWD/gourdes-data:/data" gourdes-miner mine

setup asks for the key and the devices and keeps them in gourdes-data. Replace mine with test (and -d with -it --rm) for a dry run. docker logs -f gourdes-miner follows it and docker stop gourdes-miner stops it. Without an NVIDIA card, leave out --gpus all and it mines on the processor. The README.txt inside the download has the details.

The rest of this section installs the same program by hand.

What a solution pays

Requirements

Files

FileWhat it isBytessha256
run.pyThe mining client. Reads the puzzle, runs the solver, checks and sends solutions.72,190b802a2b2ee2657291dbd22534d518998d89c1707b1d7896567b3622d055867b9
gminer.pyThe GPU solver (OpenCL, any vendor). Also a benchmark and device list on its own.8,0745a5b2e45beee43e44cb14fb0d9eaa89d28fa8fb2e803c3a579ffeeb8d93c4faf
msolver.pyRuns several graphics cards and processor threads on the same puzzle at once.8,9500d8b81e8339ab8efa8c8d98278777f9a90355972cd55b665e6d2e70c8c1ab433
keccak.clThe keccak256 search kernel the solver compiles for the GPU.2,177805ac63a47387923c1a970a402e57205a23a0d9663d1d1000d73b40834ae306b
config.example.jsonConfig template for the client.1,755107b12db5a2fcbaeaabd3c5da9cd0135e4fe2b99c29bc76a569b7d046ab804b0
GourdesMiner.abi.jsonThe miner contract's ABI, named by the config.7,465bfdf8fdc0827a4a7ea2770ac35e5534dbd7d86ca3a711eb0f63720c27da20709
requirements.txtPinned Python packages.85673f67b7fba989fce5b8b8de02b73df3fee8acc9613ffe070c485132da9bf10b
gourdes-miner-windows-x64.zipWindows 64-bit, ready to run: Python, every package and the files above, with start-miner.bat. See Easy start.35,742,293c39c4dc85d5aab529ebd8694cbe066b73068755137f1f9b84c3049f2f7459647
gourdes-miner-docker.tar.gzDocker build context: Dockerfile and the files above. NVIDIA cards or the processor. See Easy start.36,297a9d67cecbc6c8fadf5bc41cea44979d72ebcfa18bcd3ceb6106f33eddac77827
SHA256SUMSThe sha256 of every file above, for sha256sum -c.749116e8a301c7ca9f65457773d6b7a2114837424cf3829cea1ba2f5fff177cf852

All files are served from https://gourdes.finance/miner/. The miner files are plain text; the two packages are the easy-start downloads above.

1. Download and check

mkdir gourdes-miner && cd gourdes-miner
for f in run.py gminer.py msolver.py keccak.cl config.example.json GourdesMiner.abi.json requirements.txt SHA256SUMS; do curl -fsSO https://gourdes.finance/miner/$f; done
sha256sum -c --ignore-missing SHA256SUMS

Every line must end in OK. The hashes in SHA256SUMS are the ones in the table above.

2. Install the Python packages

python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

3. Find your devices and test the solver

NVIDIA cards:

nvidia-smi --query-gpu=uuid,name --format=csv,noheader
CUDA_VISIBLE_DEVICES=GPU-your-full-uuid .venv/bin/python gminer.py --bench 10

The first command prints each card's full uuid (GPU- followed by 32 hex digits in five groups). The second prints the hash rate of that card. The client takes NVIDIA cards by full uuid only and never by index.

Any graphics card, any vendor:

.venv/bin/python gminer.py --list
.venv/bin/python gminer.py --opencl-device 0:0 --bench 10

--list prints every OpenCL device as PLATFORM:DEVICE, for example 0:0 GPU Radeon RX 7900 XTX. Pass that pair to --opencl-device. If --list prints nothing, the graphics driver's OpenCL part is not installed; you can still mine on the processor.

4. Write the config

cp config.example.json config.json

Edit config.json. Every value in it is a safety pin: the client refuses to start, or stops, when the node disagrees with it.

KeyValue
chain_id8453 (Base). Already set.
contractThe miner contract: 0xdfaBce24c8C1fbEc42327fb336A229606810b497
tokenThe $GOURDES coin on Base: 0xB614b287dA2BD9574181cF9CCA8D049d26AF22d0
contract_code_hash, token_code_hashkeccak256 of the code deployed at each address. Compute both with the command below.
abi_fileGourdesMiner.abi.json. Already set.
rpc2Optional second Base endpoint from a different operator, or null.
gas_capsThe most gas one transaction may use: 200,000 for a solution. Already set.
max_native_per_hour_wei, max_native_per_day_weiThe most ETH the client may spend on gas: 0.01 per hour and 0.05 per day as shipped.

A code hash is keccak256 of what eth_getCode returns for the address. Run this once for the miner contract and once for the coin:

.venv/bin/python -c "import sys; from web3 import Web3; w = Web3(Web3.HTTPProvider(sys.argv[1])); print('0x' + bytes(Web3.keccak(w.eth.get_code(Web3.to_checksum_address(sys.argv[2])))).hex())" https://mainnet.base.org 0xdfaBce24c8C1fbEc42327fb336A229606810b497
.venv/bin/python -c "import sys; from web3 import Web3; w = Web3(Web3.HTTPProvider(sys.argv[1])); print('0x' + bytes(Web3.keccak(w.eth.get_code(Web3.to_checksum_address(sys.argv[2])))).hex())" https://mainnet.base.org 0xB614b287dA2BD9574181cF9CCA8D049d26AF22d0

Each command prints 0x followed by 64 hex digits. Write the two results into the config. The zero addresses and zero hashes of the template are placeholders, and the client refuses them.

5. Dry run

.venv/bin/python run.py --rpc https://mainnet.base.org --config config.json --gpu-uuid GPU-your-full-uuid --sender 0xYourMiningAddress

Pick the devices with any mix of these options:

All devices search the same puzzle together and the first valid solution wins, so adding devices adds their speed. The log lists every device it started. Without --send the client only prints the solutions it finds and sends nothing. Use this to check the config, the node and the card. Addresses must be written with their checksum capitals, as wallets and explorers show them. The client mines at any hour by default. To keep the card idle at set times, pass a window, for example --hours mon-fri:19:00-08:00,sat-sun:00:00-24:00 --tz Europe/Paris; times are read in the --tz zone, which defaults to America/New_York.

6. Mine

install -m 700 -d keys
( umask 077; nano keys/hot.key )
.venv/bin/python run.py --rpc https://mainnet.base.org --config config.json --gpu-uuid GPU-your-full-uuid --send --keyfile keys/hot.key --no-profit-gate

Use the same device options as in the dry run: replace --gpu-uuid ... with --opencl-device ..., --cpu-threads N or a mix of them.

Getting ETH on Base for gas

Gas

Facts for programs

The miner contract, for builders

Everything a miner program needs is public on the contract:

FunctionWhat it does
mine(uint256 nonce)Submits a solution. The reward goes to the sender.
challenge()The current puzzle seed.
effectiveTarget()The target a solution is judged against right now, including any easing.
target()The base target set by the last retarget.
currentReward()What the next solution earns.
digestFor(address, uint256)The hash mine would compute for that address and nonce, for checking a hit before sending it.
solutionCount(), totalMined()Solutions accepted and coins minted so far.
started()Whether mining is open.

The contract emits Mined for every accepted solution, Retargeted when the difficulty moves and MiningStarted once, at launch. It has no owner, and every parameter is fixed when it is deployed.

The full mining spec has the exact formulas, a real test vector, the parameters read from Base, event topics, error selectors, the ABI and how a pool fits the address-bound hash.