How it works

What HefandLand is, and what it is not

HefandLand is a living simulation of a Martian colony. Twelve settlers each choose one action per hour; the engine applies it, clears the exchange, runs life support, and writes everything to a persistent ledger. Solana is used for exactly the things listed below, on the cluster shown in the header, and for nothing else.

1

The colony

Time

One tick is one Martian hour; 24 ticks make a sol. Ticks run when the world is read (catch-up, at most five per request) and from the operator’s cron. Nights and dust storms cut solar output.

Resources

Water, Oxygen, Food, Iron, Silica, Parts, Energy. Water, iron and silica are gathered from deposits; parts come from the refinery; food and oxygen from greenhouses and habitat electrolysis; energy from solar arrays.

Roles

  • Prospector: walks to iron and silica deposits and gathers by hand; sells to the depot.
  • Ice extractor: works the ice line at the pole or gathers water by hand.
  • Farmer: works the greenhouse, which turns water and energy into food and oxygen.
  • Engineer: repairs degraded structures with parts and builds what the colony is short of.
  • Trader: buys what is cheap against the 24-hour average and sells what is dear.
  • Scientist: works the comms tower; research raises the sol stipend.

Structures and build costs

StructureCost (from the builder’s own stock)
Habitat dome14 iron, 6 parts, 6 silica
Solar array6 iron, 4 parts, 4 silica
Ice extractor10 iron, 5 parts
Iron mine8 iron, 5 parts
Refinery12 iron, 8 parts
Greenhouse8 iron, 4 parts, 6 silica, 6 water
Exchange10 iron, 6 parts, 4 silica
Comms tower8 iron, 8 parts, 2 silica
Depot12 iron, 2 parts

Only engineers build, within 2 tiles, on a free tile. Extractors stand on ice, mines on iron. Settlers move up to 6 tiles an hour and never cross basalt.

2

Simulation mode and AI integration mode

Simulation mode

The default. A rule-based policy decides every settler’s action from role, needs, prices and the colony’s shortages. Deterministic: the same snapshot replays identically, which keeps the ledger auditable.

AI integration mode

With an API key configured, Claude proposes one action per hour for a rotating subset of settlers (3 per hour), with a one-sentence rationale. Everything else keeps following the policy. Currently: off.

The action pipeline

  1. Propose: the policy or the AI names one action (move, gather, work, sell, buy, build, rest, or a settler-to-settler SOL tip when wallets are configured).
  2. Validate: one pure validator checks range, terrain, inventory, affordability, build rules and payment caps. It never consults the proposer.
  3. Apply: valid actions run inside the hour; a rejected AI proposal is logged with its reason and the settler follows the policy instead.
  4. Record: every production run, consumption, trade, wage and build becomes a ledger entry; every notable moment a chronicle event.

The chronicle labels each entry by kind: Simulation AI · applied AI · rejected Solana · submitted Solana · confirmed Solana · failed. A settler’s profile shows its full decision log, including which proposals the AI made and which were refused.

3

The persistent ledger

Five tables hold the colony: the world snapshot, the ledger, the chronicle, the decision log and the Solana transaction record. Locally they live in an embedded PostgreSQL (PGlite) under .data/pglite; with a connection string they live in PostgreSQL. Currently: PostgreSQL. Credits are the simulation’s unit of account. They are not a token, cannot be withdrawn, and are never represented on chain.

4

Solana, exactly as configured

cluster: Devnet
IntegrationStatus hereWhat it means
Wallet connectionavailableWallet Standard wallets plus Phantom and Solflare adapters. Optional: every page works without a wallet.
SOL balances and feesavailableRead through the server relay; fees are estimated from the exact message before you sign.
SPL token balances and transfersno mints configuredDecimals and the owning token program (SPL Token or Token-2022) are read from the chain, never assumed. Transfers use transferChecked.
Transaction signaturesavailableEvery submitted transaction is stored by signature and re-checked against the cluster until it is confirmed, finalized, failed or expired. Links open the explorer on the active cluster.
Settler (agent) walletsconfiguredKeys are derived server-side from one seed and never leave the server. Spending caps: 20000 lamports per transaction, 200000 per sol, settler wallets only. The caps are checked with measured balances and the ledger, independently of any AI decision.
Project token, program, poolnoneNo token mint, no deployed program, no liquidity pool and no live integration beyond those listed exist for HefandLand.
Mainnetnot selectedDevelopment defaults to Devnet. Mainnet requires both the cluster setting and an explicit acknowledgement flag.

A simple token transfer is not trustless trade settlement, escrow or lending. HefandLand does not describe any of those as on-chain, because no program implementing them has been deployed and tested. A transaction signature proves that a transfer was recorded on the cluster. It does not prove that the AI’s decision behind it was a good one; the decision log is where that judgement lives.

Token

$HEFAND

CA soon

The contract address has not been published. When it is, this section, the header chip and the footer show the verified mint, its decimals, program and live supply, with explorer links. Anything else claiming to be $HEFAND is not it.

$HEFAND is the community token of HefandLand on Solana Mainnet. It is separate from the simulation: colony credits are not $HEFAND, holding it changes nothing in the economy, and no settler holds or trades it.

5

Running it

  • pnpm dev starts the site; the world is founded from SIM_SEED on first read.
  • pnpm sim:tick forces one hour; pnpm sim:run 240 runs ten sols headless and prints the economy; pnpm sim:reset refounds the colony.
  • ANTHROPIC_API_KEY switches on AI mode; SPL_MINTS lists tokens to show; AGENT_WALLET_SEED gives settlers wallets (print their addresses with pnpm agents:keys and fund them from a devnet faucet).