Skip to main content
ClaudeWave
ES, Spanish
Skill7k estrellas del repoactualizado 2mo ago

magicblock

Design, implement, and debug MagicBlock applications on Solana. Covers Ephemeral Rollups with delegated state; ER/PER architecture and settlement; private payments and token flows; oracles and randomness; scheduling and temporary authority; security and local validation. Use for MagicBlock product selection, integration, cross-product design, or production troubleshooting.

Instalar en Claude Code
Copiar
git clone --depth 1 https://github.com/internet-court/internet-court-skill /tmp/magicblock && cp -r /tmp/magicblock/vendored/magicblock/magicblock-dev ~/.claude/skills/magicblock
Después abre una sesión nueva de Claude Code; el skill carga automáticamente.

SKILL.md

# MagicBlock Development Skill

## Pair with the `solana-dev` skill

Use this skill for MagicBlock-specific concerns: ER/PER, delegation, oracles, Session Keys, cranks, VRF,
Magic Actions, eSPL, and private payments. For general Solana or Anchor work such as scaffolding, PDAs,
account layouts, SPL tokens, clients, wallets, or LiteSVM/Mollusk testing, also load `solana-dev`.

## Key Concepts

**Ephemeral Rollups** enable high-performance, low-latency transactions by locking a delegated
account on the base layer while an ER clone continues to execute under the account's original program
owner. They are useful for gaming, real-time apps, and fast transaction throughput.

**Ephemeral Accounts** are born, used, and closed only inside an ER. They are useful for temporary
high-frequency state, but they never commit to Solana and therefore cannot be the only copy of durable
ownership, balances, rewards, or settlement results.

**Delegation** temporarily assigns the base-layer account to the Delegation Program and clones it into
the ER with its original program owner. Normal program ownership, signer, authority, and account
constraints still apply on the ER; delegation status is a routing and lifecycle concern, not a new
application authorization rule.

**Delegation debugging invariant**: a properly delegated account looks owned by
the delegation program on base, owned by the original program on the ER endpoint
returned by router `getDelegationStatus`, and cloned into the ER with
`delegated=true`.

For the verified SDK v0.16.2 snapshot, use **MagicIntentBundleBuilder** to
schedule commit and commit-and-undelegate intents. Do not use the deprecated
free functions `commit_accounts` and `commit_and_undelegate_accounts`.

**Private Ephemeral Rollups (PER)** gate a delegated account inside a TEE-backed validator with an ER-local `EphemeralPermission`. Delegate only the data account on the base layer, then create, update, and close its permission on the ER with `CreateEphemeralPermissionCpi`, `UpdateEphemeralPermissionCpi`, and `CloseEphemeralPermissionCpi`. Do not create or delegate a separate base-layer permission account.

**Magic Actions** are base-layer instructions scheduled inside an ER transaction via
`MagicIntentBundleBuilder.add_post_commit_actions(...)`. Each attempted base-layer transaction applies
its commit and actions atomically. If any BaseAction fails, the committor removes every BaseAction in
that affected `TransactionStrategy` before retrying its remaining commit strategy; actions in other
transaction/finalize strategies are outside that removal scope. Observe and reconcile every originally
scheduled action: scheduling or eventual commit success alone does not prove that any of them ran.

**Commit sponsorship**: every delegated account gets 10 free commits to base layer by default. To lift
the cap, either re-delegate (refreshes the quota) or attach the validator-scoped `magic_fee_vault` PDA
and a delegated fee payer to the intent bundle. The delegated payer is debited; the fee vault is the
validated destination credited with that commit fee.

**Lamports top-up**: when a delegated account (e.g. a delegated fee payer) needs more lamports on the ER side, use `lamportsDelegatedTransferIx` from the SDK. The transaction is submitted on **base layer** — the Ephemeral SPL Token program creates a single-use lamports PDA, funds it, and delegates it so the ER credits the destination.

**Ephemeral SPL Token** has two surfaces. In the SDK lifecycle model, clients use
`delegateSpl`/`transferSpl`/`undelegateIx`/`withdrawSpl`, and the ER balance appears as a normal SPL token
account at the owner's canonical ATA address, so Anchor programs can use plain SPL Token CPI. In the
direct-program model, contracts use `ephemeral-spl-api` and explicitly work with the eATA/global-vault
PDAs; do not apply the canonical-ATA model to that raw surface.

**Pricing Oracle** republishes supported market feeds for Solana/ER consumers. A safe integration
verifies the expected feed identity, upstream publish-time freshness, value domain, exponent, checked
arithmetic, and user price bounds; successful deserialization alone is not price validation.

**Session Keys** authorize a temporary signer for constrained application actions. Session validity is
separate from SPL token authority: token spending also requires an explicit, bounded token delegate
allowance.

**Architecture**:
```
┌─────────────────┐     delegate      ┌─────────────────────┐
│   Base Layer    │ ───────────────►  │  Ephemeral Rollup   │
│    (Solana)     │                   │    (MagicBlock)     │
│                 │  ◄───────────────  │                     │
└─────────────────┘    undelegate     └─────────────────────┘
     ~400ms                                  ~10-50ms
```

## Default stack

### Programs

Use Anchor with `ephemeral-rollups-sdk`; native and Pinocchio are also supported.

- Use the target repo's existing `ephemeral-rollups-sdk` / Anchor versions unless the task is an explicit upgrade
- The SDK feature flag selects the Anchor range: `anchor` for Anchor 1.x programs, or `anchor-compat` for Anchor >=0.28,<1.0 programs

**Required macros:**

- `#[ephemeral]` on the program module, **before** `#[program]` — injects the `process_undelegation` callback (the delegation program CPIs into it to return the account) and the commit/undelegate intent builders. Commit and undelegation require it; delegation itself does not. Include it on any program that delegates so its accounts can later be undelegated.
- `#[delegate]` and `#[commit]` on the respective delegation/commit account contexts.
- `#[vrf]` on a VRF *request* context **and** `#[vrf_callback]` on the VRF *callback* context — the
  callback macro authenticates fulfillment. Enable the `vrf` feature on `ephemeral-rollups-sdk`.
  SDK v0.16.2 re-exports VRF, so new Anchor code does not need a direct
  `ephemeral-vrf-sdk` dependency. See [vrf.md](references/vrf.md).

**Non-Anchor programs:** use t
0g-computeSkill

0G Compute Network guide for decentralized AI inference, fine-tuning, and GPU services. Covers chatbots, image generation, speech-to-text, SDK integration (0g-serving-broker), processResponse API, broker.inference methods, CLI commands (0g-compute-cli), and account management. Use this skill for any 0G compute, 0G AI, or decentralized GPU question.

agent-walletSkill

Give the AI agent its own EVM wallet with admin-controlled policies the agent CANNOT bypass even under prompt injection. Encrypted keystore (AES-256-GCM, scrypt KDF), policy file the agent has no tool to write, deterministic policy gate on every signing operation, optional local HTTP dashboard. Triggers: agent wallet, give the agent a wallet, agent address, fund the agent, agent autonomy, policy gate, kill switch, agent permissions, bounded autonomy, ERC-4337 alternative, session-key alternative.

agentic-walletSkill

Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.

alkahest-developerSkill

Help developers write code that interacts with Alkahest escrow contracts using the TypeScript, Rust, or Python SDK

alkahest-userSkill

Interact with Alkahest escrow contracts as a buyer, seller, or oracle using the CLI

altllm-portal-api-keysSkill

Use this skill when the user asks to list, create, inspect, update, disable, re-enable, or revoke AltLLM Portal API keys for external agents or applications. Do NOT use for wallet login, billing history, or payment links.

altllm-portal-authSkill

Use this skill when the user asks to log in or out with a wallet session, fetch a wallet sign-in challenge, verify an externally signed challenge, or troubleshoot AltLLM Portal wallet login for the local altllm CLI. Do NOT use for API key management, billing history, or payment links.

altllm-portal-billingSkill

Use this skill when the user asks to inspect AltLLM Portal balance, redeem a promo code, review billing transactions, or view usage analytics by period, model, or API key using the local altllm CLI. Do NOT use for API key lifecycle management or payment-link execution.