Skip to content

craft-basics ⛏️

A miniature survival-game loop: discover raw material with verifiable work, refine it, assemble tools, and spend tool durability to mine harder material. Every item is a Digital Object; every craft is a zero-knowledge-proved action.

FindLog (VDF)                            → 🌲 Log
CraftWood (PoW)          🌲 Log          → 🪵 Wood
CraftSticks              🪵 Wood         → 🥢 Stick + 🥢 Stick
CraftWoodPick            🪵 + 🥢         → ⛏️ WoodPick (durability 100)
MineStoneWithWoodPick    ⛏️ wear -1      → 🪨 Stone
CraftStonePick           🪨 + 🥢         → ⛏️ StonePick (durability 200)
MineStoneWithStonePick   ⛏️ wear -1      → 🪨 Stone

Classes

ClassDescription
Log🌲A discovered log that can be refined into wood.
Wood🪵Refined wood used for sticks and basic tools.
Stick🥢A stick used as a handle in tool crafting.
Stone🪨Mined stone used to craft stronger tools.
WoodPick⛏️A wood pick that can mine stone while durability remains.
StonePick⛏️A stone pick that can mine stone while durability remains.

Actions

ActionDescription
FindLogDiscover a log object by proving a short VDF.
CraftWoodRefine one log into a wood object with PoW quality checks.
CraftSticksSplit one wood object into two stick objects.
CraftWoodPickCombine wood and a stick to craft a wood pick.
MineStoneWithWoodPickMine stone using a wood pick (consumes durability).
CraftStonePickCombine stone and a stick to craft a stone pick.
MineStoneWithStonePickMine stone using a stone pick (consumes durability).
UseWoodPick (hidden)Internal durability/work update for wood pick usage.
UseStonePick (hidden)Internal durability/work update for stone pick usage.

What it demonstrates

  • VDF-gated discoveryFindLog proves an iterated-hash delay function, so new logs cost real wall-clock time.
  • PoW quality checksCraftWood grinds a key whose top limb must clear a difficulty target, proved with a 256-bit comparison.
  • Durability you can't fake — using a pick proves the old durability was positive and that the new value is exactly one less.
  • Hidden subactions — the Use*Pick helpers are composed into the mining actions rather than invoked directly.

Install

Install the driver first, then add this plugin — dobj install hot-reloads the catalog, so no restart is needed:

~/.dobj/bin/dobj install https://github.com/dobjlabs/digital-objects-network/releases/latest/download/craft-basics.pexe

Or build it from a checkout of the repo, then install the archive:

cargo run -p pexe --release -- build examples/craft-basics   # -> target/pexe/craft-basics.pexe
~/.dobj/bin/dobj install target/pexe/craft-basics.pexe

Source: examples/craft-basics/