program reference
Addresses, account seeds, instructions, events and error codes, for reading the chain directly instead of this site.
address
One deployed program hosts every token. The address below is live on mainnet-beta, and its finalized on-chain bytes reproduce the reviewed build's hash. The earlier AB6LW5 devnet program remains separate and superseded. §9.1
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 Lode 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
- 6.1Every account except the platform is seeded by the mint
- 7.1The platform singleton holds the only live authority
- 8.1Chain state is authoritative and there is no indexer
The paper is the authority. Where this page and §6.1 disagree, the paper is right and this page is a bug.