The Sovereign Economy is a complete, self-contained virtual marketplace. Here's everything included:
| Component | What | Size |
|---|---|---|
| Database schema | 10 tables (items, inventory, ledger, trades, auctions, vendors, mail, spawns, seasons, pass progress) | ~2 KB |
| Item seeds | 50 Sovereign Intaglio items with prices and descriptions | ~8 KB |
| Crafting recipes | 6 recipes (ore → refined → alloy → tools) | ~1 KB |
| API routes | 34 endpoints (trading, auctions, vendors, crafting, mail, pass, sinks, pickup) | ~40 KB |
| Player UI | 8-tab control panel with help menus | ~60 KB |
| Admin UI | Toggles, vendor/item management, season creator, reactivation | ~25 KB |
| Collection gallery | Sovereign Intaglio showcase page | ~15 KB |
| Creator handbook | Manufacturing guide for creators | ~20 KB |
| Economy guide | 8-chapter complete guide | ~30 KB |
| three.js module | In-world pickup (raycasting + proximity) | ~7 KB |
sovereign-economy-v1.tar.gz.1 Prerequisites. Node.js 18+, SQLite3, Express.js. Your server needs dbAll, dbGet, dbRun helpers and requireLogin / requireAdmin middleware (adapt to your auth).
2 Extract the package.
tar -xzf sovereign-economy-v1.tar.gz cd sovereign-economy
3 Create the tables.
sqlite3 your-database.db < schema.sql
4 Seed items and settings.
sqlite3 your-database.db < seed_items.sql sqlite3 your-database.db < seed_settings.sql
economy_inventory table needs a durability INTEGER DEFAULT 100 column. If your schema.sql doesn't include it:ALTER TABLE economy_inventory ADD COLUMN durability INTEGER DEFAULT 100;5 Integrate API routes. The routes in server_routes.js reference these helpers — implement or adapt:
getSettings() / setSettings() — key-value settings storeeconomyEnabled(system) — checks economy_{system}_enabled === '1'getItemDef(defId) — fetch from economy_itemsuserOwnsItem(userId, defId, qty) — sum inventoryuserCoins(userId) — sum ledgertransferCoins(from, to, amount, reason) — atomic ledger entriestransferItem(from, to, defId, qty) — atomic FIFO inventory movesendMail(userId, subject, body, itemsJson, coins) — insert into economy_maileconomyRateLimit(userId, action, maxPerMinute) — in-memory throttle6 Add the views. Copy view functions from views.js into your template system. Required: economyPanels, adminEconomy, intaglioGallery, creatorsHandbook, economyGuide.
7 Copy the three.js module. Place economy-pickup.js in your public directory.
8 Start the auction expiry job. Call resolveExpiredAuctions() every 5 minutes via setInterval or your scheduler.
9 Verify. Visit /api/economy/health — all tables should report "ok".
After installation, customize for your world:
economy_currency_name in settings. "Coins", "Credits", "Shards" — whatever fits your world.price_cents in economy_items to match your world's economy scale.CRAFTING_RECIPES array to add your own chains.Your world can synchronize with the sovereign world (this one) at three levels. Choose what fits:
Pull the latest item definitions from the sovereign world to keep your catalog current.
# Export from sovereign: sqlite3 /opt/epistles/data/epistles.db "SELECT def_id, name, description, kind, price_cents, stackable FROM economy_items ORDER BY id;" > items.csv # Import to your world (adapt to your tooling):
Run this monthly, or when new sets are announced. Your local prices and custom items are preserved — only new def_ids are added.
Send items and coins between worlds via API bridge. Both servers need a shared API key.
// On World A: export a gift
POST https://world-b.example.com/api/federation/receive
Headers: { "X-Federation-Key": "shared-secret" }
Body: {
"from_world": "world-a",
"to_user": "player-name-or-id",
"subject": "Gift from World A",
"items": [{ "def_id": "kings-intaglio-seal", "qty": 1 }],
"coins": 1000
}
// On World B: implement /api/federation/receive
// Validate key → look up user → call sendMail() → return { ok: true }
The most ambitious: a unified marketplace across worlds. Listings from all worlds appear in one place.
This requires:
For worlds that want deep integration, follow this protocol:
Each world has a unique world_id (e.g. sovereign-prime, your-world-name). Include it in all cross-world messages.
Item def_ids are globally unique. Prefix custom items with your world: myworld-custom-sword. Sovereign items use unprefixed IDs.
Check manifest.json version before syncing. Major version changes may break compatibility — test in isolation first.
Questions about redistribution? Contact the sovereign world admin.