🌐 REDISTRIBUTE THE SOVEREIGN ECONOMY

Deploy the full package in your own world — and synchronize with this one
PackageInstallConfigure SynchronizeFederateTerms

📦 WHAT'S IN THE PACKAGE

The Sovereign Economy is a complete, self-contained virtual marketplace. Here's everything included:

ComponentWhatSize
Database schema10 tables (items, inventory, ledger, trades, auctions, vendors, mail, spawns, seasons, pass progress)~2 KB
Item seeds50 Sovereign Intaglio items with prices and descriptions~8 KB
Crafting recipes6 recipes (ore → refined → alloy → tools)~1 KB
API routes34 endpoints (trading, auctions, vendors, crafting, mail, pass, sinks, pickup)~40 KB
Player UI8-tab control panel with help menus~60 KB
Admin UIToggles, vendor/item management, season creator, reactivation~25 KB
Collection gallerySovereign Intaglio showcase page~15 KB
Creator handbookManufacturing guide for creators~20 KB
Economy guide8-chapter complete guide~30 KB
three.js moduleIn-world pickup (raycasting + proximity)~7 KB
Download: The export package is generated on demand. Contact the sovereign (this server's admin) for the latest sovereign-economy-v1.tar.gz.

⚙️ INSTALLATION: New World Setup

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
Note: The 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:

6 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".

🎛️ CONFIGURATION: Make It Yours

After installation, customize for your world:

Keep the core mechanics. The security model (server-authoritative, escrow, atomic transfers) and the sink-before-faucet principle are what keep the economy stable. Customize the surface, preserve the engine.

🔄 SYNCHRONIZATION: Stay Connected

Your world can synchronize with the sovereign world (this one) at three levels. Choose what fits:

Level 1: Item Definition Sync (one-way)

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.

Level 2: Cross-World Mail

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 }
Security: Federation keys must be long, random, and rotated. Never commit them to code. Rate-limit federation endpoints aggressively (5/min). Log every cross-world transfer.

Level 3: Shared Auction House (two-way)

The most ambitious: a unified marketplace across worlds. Listings from all worlds appear in one place.

This requires:

Recommendation: Start with Level 1. Add Level 2 when you have active players. Level 3 is for mature federations with trusted operators.

🤝 FEDERATION PROTOCOL

For worlds that want deep integration, follow this protocol:

Identity

Each world has a unique world_id (e.g. sovereign-prime, your-world-name). Include it in all cross-world messages.

Item Namespace

Item def_ids are globally unique. Prefix custom items with your world: myworld-custom-sword. Sovereign items use unprefixed IDs.

Trust Model

Version Compatibility

Check manifest.json version before syncing. Major version changes may break compatibility — test in isolation first.

📜 TERMS OF REDISTRIBUTION

The Sovereign Economy is shared freely for anyone building virtual worlds. The King's terms:
  • Attribution. Credit "Sovereign Economy" and link back to the origin world.
  • Share improvements. If you fix a bug or add a feature, share it back. The federation grows stronger together.
  • No paywalling the core. You may charge for your world, your items, your premium features. You may not charge for the economy engine itself.
  • Keep the Iron Law. Sinks before faucets. If you fork the economy, preserve the anti-inflation design.
  • Nothing was deleted. This package was built additively. Honor that — build upon it, don't strip it down.

Questions about redistribution? Contact the sovereign world admin.