MagicBlock

Mempire uses three MagicBlock capabilities. Each solves a problem the base layer genuinely could not, and each is described here with what it does not do as well.

Ephemeral rollups (ER)

A Solana slot is roughly 400ms. The simulation ticks every 50ms. Committing every card play to the base layer would mean a card landing several ticks after it was played, which is not a real-time game.

So the match log is delegated to an ephemeral rollup. While it is delegated, card plays are written to the rollup at rollup speed, and the base layer treats the account as owned by the delegation program. When the match ends, state commits back and the account undelegates.

What stays on Solana the entire time: the escrow and the payout. A delegated match log can never strand a pot, because the pot was never on the rollup.

match starts   → delegate the match log to the ER
during play    → card plays land on the ER, ~50ms
match ends     → commit and undelegate
settlement     → the base-layer program pays the winner

Permissioned state (PER)

An ephemeral rollup is readable. A match log that anybody could write to is a match log anybody could stuff with card plays that were never made.

The log is therefore sealed to its two players for the duration of the match, using MagicBlock's permission program. Only the two seat holders can append. Sealing and unsealing are separate instructions from ending the match, which matters more than it sounds: folding the permission close into end_log made settlement depend on an optional account being present, and settlement must never be able to fail for a reason unrelated to settlement.

Unsealing is not idempotent once the permission account is closed — the transaction is rejected before the instruction runs, because the account it references no longer exists.

Verifiable randomness (VRF)

Chests need randomness that neither the player nor the developer can steer. Math.random() in a client is worth nothing here; a server roll asks you to trust a server.

Chest opening requests randomness from MagicBlock's VRF and resolves in a callback. Both the chest tier and the specific cards inside it derive from that one seed — the drops run through xoshiro256** with rejection sampling, so the same seed always yields the same cards and no card is more likely than it should be from a modulo bias.

The seed is displayed in the opening ceremony. A verifiable roll that nobody can see the input to has not verified anything to the player.

On cost: VRF requested on an ephemeral rollup is free. The same request on the base layer costs 0.0008 SOL. Chests roll on the rollup.

What MagicBlock is not doing here

  • It is not holding stakes. Escrow and payout are base-layer Solana.
  • It is not deciding match outcomes. Both clients run the simulation, and the state hash decides whether they agreed.
  • It is not a trust assumption for value. If the rollup vanished mid-match, the match would void and the escrow would return both stakes.

Endpoints the client talks to are listed under deployed contracts.