core

Docs / Reference

Program reference and verification

Address, account seeds, instructions, events and error codes, plus the command that checks the deployed bytes against the reviewed build.

address

One deployed program hosts every token. The address below is the release program on mainnet-beta. The release record and reviewed build hash are documented in the specification. §9.1

programCoreWBGScwpt9Fj44SRaHXLHfu1u5YP4m3msVmFrhvpM

account seeds

Every account except the platform singleton is seeded by the mint, so two tokens can never share state and an account belonging to one token cannot be passed into an instruction operating on another. §6.1

config
["lode-config", mint]
emission vault
["lode-vault", mint]
stake vault
["lode-stake-vault", mint]
miner
["lode-miner", mint, authority]
platform
["lode-platform"]

instructions

Legacy launch and mine are disabled. Legacy claim, crank and close remain callable so a position opened under the earlier account model can still be exited. §2.6

launch_v2
Create the mint, config, both vaults and immutable metadata, mint the full supply, revoke mint authority.
register
Create the per-wallet miner account for one token. Rent is refundable on close.
deposit_stake
Move units into the stake vault as pending stake, activating next round.
mine_v2
Verify one Equihash proof and credit active stake as this round's weight. Moves no tokens.
crank
Close the open round if it has elapsed and derive the next challenge. Permissionless, one round per call.
claim
Settle, then transfer accrued rewards from the emission vault to the miner's token account.
withdraw_stake
Return principal from the stake vault, refused while unsettled round weight is held.
close_miner
Close the miner account and refund its rent. Refused while rewards are still pending.
init_platform
Initialize the fee singleton. Callable only by the deployed program's current upgrade authority.

events

Every state change worth indexing is emitted. There is no Core indexer, so these are for whoever wants to build one. §8.1

RoundClosed
mint, index, budget, total_weight, next_index
Submitted
mint, authority, round, weight, round_total_weight, round_miners, solution_hash
StakeDeposited
mint, authority, amount, activation_round, active_stake, pending_stake, total_staked
StakeWithdrawn
mint, authority, amount, active_stake, pending_stake, total_staked
Claimed
mint, authority, amount

errors you are most likely to see

The program returns named errors rather than bare codes. These ten cover almost everything a miner or launcher will hit in normal use.

  • round has elapsed; crank before mining
  • this miner has already submitted a solution for the current round
  • positive active stake is required to mine
  • stake used by an unsettled round cannot be withdrawn
  • solution hash does not fall under the difficulty target
  • live platform fee exceeds the user-signed maximum
  • emission schedule cannot emit the mineable supply
  • legacy token config is unsupported by this instruction
  • stake vault balance is below recorded liabilities
  • mineable supply has been exhausted

this page expands

The paper is the authority. Where this page and §6.1 disagree, the paper is right and this page is a bug.