Economy

Withdraw & Banknotes

Mint Denarius, Auctoritas, Civitas, or Aureus into physical, tradable banknotes — secured by serials and HMAC.

Banknotes are physical, tradable items that represent a fixed amount of currency. Mint one with /withdraw, hand it to another player, drop it in a chest, or stash it in your vault — then the holder redeems it (right-click or a slash command) to fold the value back into a wallet balance. Banknotes power Imperium's player-to-player currency trades, large-denomination bets, and high-value gifts. They are also one of the most security-hardened systems in the plugin: every note is signed, serialised, and atomic-burned on redeem to make duplication impossible.

Supported Currencies

Each currency mints as a distinct item with its own material, colour, symbol, and denomination limits. The defaults:

CurrencyMaterialMin WithdrawMax WithdrawSymbol
Denarius (money)Gold Nugget1,0001B (1.0E9)
Auctoritas (tokens)Sunflower10010M (1.0E7)
Civitas (beacons)Beacon101M (1,000,000)
Aureus (gc)Emerald1100K (100,000)🪙

Amounts below the minimum or above the maximum are refused before any balance is touched, so you can't accidentally mint a worthless note or hit a precision ceiling.

Withdrawing Currency

To mint a banknote, run /withdraw withdraw <amount> <currency>. The amount accepts plain numbers and the suffixes k, m, and b — so 10k, 1.5m, and 2.5b all work.

  1. The system validates the amount is within the per-currency min/max.
  2. Your balance is checked — if you don't have enough, the mint is refused (no partial withdrawal).
  3. A 2-second global cooldown prevents spam-clicking mints.
  4. Currency is atomically removed from your wallet.
  5. A fresh serial is INSERTed into banknote_serials — if that INSERT fails, the mint aborts and your wallet is refunded.
  6. The banknote item is created, signed, and added to your inventory. If your inventory is full, the mint aborts and refunds.

/withdraw withdrawall <currency> is the quick version: it withdraws your entire balance of that currency as a single note, subject to the minimum and maximum.

Banknote Anatomy

A minted banknote carries everything needed to verify and redeem it, baked into its persistent data container:

  • Display name: "<Currency> Banknote" (e.g. "Denarius Banknote").
  • Lore: amount (with symbol), currency, owner name, issue date, and a "RIGHT-CLICK to redeem" hint.
  • Serial: a random UUID, persisted server-side as the single source of truth.
  • Signature: an HMAC-SHA256 over currency|amount|owner|serial, keyed by the server's signature_salt.

The lore is human-readable; the serial and signature are what the plugin actually trusts. Even if someone edits the lore to claim a fake amount, the signature won't match and the redeem is refused.

Redeeming Banknotes

There are three ways to redeem:

  • Right-click the note in your hand — instant redeem of that single note.
  • /withdraw hand — same thing, for the note in your main hand.
  • /withdraw redeem <currency>bulk-redeem every banknote of that currency in your inventory at once.

The redeem flow is deliberately credit-first: your wallet is credited and verified, then the serial is burned, then the item is destroyed. If anything fails mid-flow — a DB hiccup, a race with another redeemer — the credit is reversed and the note is left intact in your inventory. You never lose money to a transient failure.

Security: Serials, Signatures, and Anti-Dupe

Banknotes are a prime dupe target, so the system is layered. Each layer closes a specific historical exploit:

LayerWhat it stops
Unique serialEvery minted note gets a random UUID serial persisted to banknote_serials before the item is created.
HMAC-SHA256 signatureBinds currency, amount, owner, and serial with a server-side salt so tampering with the item is detectable.
Atomic serial burnOn redeem, a conditional UPDATE (WHERE redeemed_at IS NULL) is the single atomic decision — exactly one concurrent redeemer wins.
Credit-first redemptionYour balance is credited and verified BEFORE the serial is burned — a DB failure leaves the note intact, not destroyed.
Stack refusalA banknote stack with amount > 1 is refused at redeem — only single-count notes ever mint, so a stack can only exist via a dupe.
Configurable cooldownA short per-player global_cooldown (default 2s) slows bulk minting and smooths DB load.

The serial burn is the load-bearing wall. Two players (or one player with two windows) trying to redeem the same serial at the same instant both run the conditional UPDATE — but only one transaction sees updated == 1 and commits. The other rolls back, has its credit reversed, and keeps the note (with a clear "already redeemed" error).

Inspecting Your Banknotes

Before redeeming, you can audit what you're carrying:

  • /withdraw check <currency> — total value, note count, average per note, and inventory slots used.
  • /withdraw view <currency> — a richer breakdown showing each denomination and how many of each you hold.

Both commands only count notes whose serial and signature are valid — corrupted or tampered notes are silently excluded from the totals so the figures you see are redeemable.

Lifespan and Storage

Banknotes are plain items, so they follow normal item rules: they can be stored in chests, ender chests, the player vault, cells, the auction house, or traded face-to-face. The configured banknote_lifespan_days (default 365) caps how long a serial stays valid in the database; a hard cap of max_banknotes_per_inventory (default 2304, i.e. 64 stacks) prevents runaway minting from swamping the table.

The signature_salt is generated once (random UUID + long) when the server first starts and stored in withdraw.yml. Rotating it invalidates every existing note, so treat it as a permanent secret.

Permissions

  • imperiummc.withdraw.create — required to mint banknotes (default: true).
  • imperiummc.withdraw.redeem — required to redeem banknotes (default: true).

Both are on by default for players. Servers that want to restrict minting (e.g. to a donor perk) can flip imperiummc.withdraw.create off without affecting redemption.

Command Reference

CommandWhat it does
/withdraw withdraw <amount> <currency>Mint a single banknote (aliases: w, create, make). Suffixes k/m/b allowed.
/withdraw withdrawall <currency>Withdraw your entire balance of that currency as one note (aliases: wa, all, max).
/withdraw redeem <currency>Redeem ALL banknotes of that currency in your inventory at once (aliases: r, cash, claim).
/withdraw redeemall <currency>Same as redeem — bulk-redeem every matching note (aliases: ra, cashall).
/withdraw handRedeem the single banknote held in your main hand (aliases: h, mainhand, mh).
/withdraw check <currency>Show total value and count of a currency's banknotes in your inventory (aliases: c, value, count).
/withdraw view <currency>Detailed breakdown of denominations you hold (aliases: v, list, inventory).
/withdraw helpIn-game command reference (aliases: ?, commands, guide).
/withdraw infoBanknote feature summary (alias: about).

Tab-completion offers common amounts (1000, 10k, 100k, …) and the four currency names. Aliases are extensive: w, wa, r, h, c, v for the most-used subcommands.

Tips

  1. Use banknotes for big trades. Handing over a 100M Denarius note is faster and safer than /pay in chunks.
  2. Right-click to redeem. It's the fastest path — no command needed.
  3. Check before you redeem. /withdraw check denarius confirms the total you're about to fold in.
  4. Store value in the vault. A banknote in your vault survives a death — keep a reserve there.
  5. Don't stack notes. A stack of > 1 is refused at redeem (anti-dupe). Keep them as single items.
  6. Bulk redeem by currency. /withdraw redeem denarius sweeps every Denarius note in one shot.

Banknotes turn Imperium's digital currencies into physical, giftable, tradeable items — without ever exposing the economy to duplication. They are the foundation of trust for every high-value player transaction.