Scaling solution for performant, composable games and applications.
This repository contains examples of how delegate/undelegate accounts and run transactions in an Ephemeral Rollups. Read more about Ephemeral Rollups here.
To view integrated demos for specific usecases, please look at MagicBlock Starter Kits.
- Anchor Counter — Counter program in Anchor. Tests delegate/undelegate via the TypeScript SDK.
- Rust Counter — Counter program in native Rust. Tests delegate/undelegate natively.
- Pinocchio Counter — Counter program built with Pinocchio (no heap, no Borsh
Vecs). - Pinocchio Ephemeral Permission Counter — Pinocchio counter with ephemeral permission accounts on the ER.
- Pinocchio Private Counter — Pinocchio counter variant exercising private state on the ER.
- Private Counter — Anchor counter gated by an on-rollup ephemeral permission account.
- Session Keys — Counter using gpl-session keys for delegated-signer auth on both base chain and ER.
- Crank Counter — Counter driven by MagicBlock's scheduled crank system.
- Ephemeral Account Chats — Chat program using Anchor "ephemeral accounts" (state lives only on the ER).
- Dummy Token Transfer — Token transferer that can delegate and execute on both the base chain and the ER.
- SPL Tokens — SPL token delegation example with transfers on the ER.
- Private Payments — Next.js demo for MagicBlock private payments.
- Roll Dice — Dice roll using a verifiable random function (VRF) on the ER.
- Pinocchio Roll Dice — Pinocchio (no-Anchor) VRF dice variant.
- Rewards (Delegated VRF) — Rewards distribution program using delegated VRF.
- Rock Paper Scissor — Two-player RPS with hidden moves on the ER until reveal.
- Magic Actions — Execute base-chain actions from inside an Ephemeral Rollup.
- On-Curve Delegation — Delegate on-curve (non-PDA) accounts to the ER and manage their lifecycle.
Older pre-Anchor 1.0 versions of the migrated programs are kept in
00-LEGACY_EXAMPLES. The 00- prefix keeps
these compatibility references listed before the active examples in
alphabetical folder views. These examples are for users who still need the
previous Anchor 0.32.1 implementations while upgrading to the current Anchor 1.0
programs.
The Ephemeral Rollups are currently under testing. Reach out to us on Discord to get access to the testing endpoint.