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
| Class | Description | |
|---|---|---|
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
| Action | Description |
|---|---|
FindLog | Discover a log object by proving a short VDF. |
CraftWood | Refine one log into a wood object with PoW quality checks. |
CraftSticks | Split one wood object into two stick objects. |
CraftWoodPick | Combine wood and a stick to craft a wood pick. |
MineStoneWithWoodPick | Mine stone using a wood pick (consumes durability). |
CraftStonePick | Combine stone and a stick to craft a stone pick. |
MineStoneWithStonePick | Mine 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 discovery —
FindLogproves an iterated-hash delay function, so new logs cost real wall-clock time. - PoW quality checks —
CraftWoodgrinds 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*Pickhelpers 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.pexeOr 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.pexeSource:
examples/craft-basics/