跳到正文
Skillpedia
API 与服务器(后端)7.0k · #13641

magicblock

它能做什么

这项技能涵盖 MagicBlock,这是一套用于快速、低延迟应用的 Solana 工具。它说明 Ephemeral Rollups、委托账户、预言机、随机数和私密支付,适合选择和调试 MagicBlock 功能的开发者。

适用场景

  • ✓当你想构建快速、实时的 Solana 应用,例如游戏的时候。
  • ✓当你需要在 Solana 上使用随机数、预言机数据或私密支付时。
  • ✓当 MagicBlock 集成出现故障,你需要排查帮助的时候。

技能链接

https://github.com/internet-court/internet-court-skill/blob/main/vendored/magicblock/magicblock-dev/SKILL.md

复制后粘贴给你的 AI(Claude、ChatGPT 或 Cursor),让它按照说明操作。

使用方法

最简单的方法:复制下面的消息,粘贴给你的 AI。它会读取这个技能并按说明操作。

可直接粘贴的消息

请用这个技能帮我:https://github.com/internet-court/internet-court-skill/blob/main/vendored/magicblock/magicblock-dev/SKILL.md 阅读该链接中的 SKILL.md 文件,并在我的任务中按照它的说明来做。
想让你的 AI 自己找到这样的技能吗?安装免费的 Skillpedia MCP:只需一行,每次任务前它都会在 15,000+ 个技能中搜索。1 分钟完成安装 →

可以这样问 AI

“我正在开发一款快速的 Solana 游戏,想知道 MagicBlock Ephemeral Rollups 是否适合它。”

每周 5 个新技能,1 分钟读完。

工作原理

智能体会说明哪款 MagicBlock 产品适合你的需求,然后帮助设计账户设置和集成。它也会帮助调试委托问题,因为被委托的账户在主 Solana 链上看起来会有所不同。

技术内容(原始 SKILL.md)

作者在 GitHub 上的英文原文。

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
常见问题

什么是 Ephemeral Rollup?

这是一个速度更快的层,被委托的账户在其中持续运行,其状态可以再结算回 Solana。

临时账户可以保存我的最终余额吗?

不可以。临时账户从不提交到 Solana,因此不能作为余额或结果的唯一副本。

我还需要加载其他 Solana 技能吗?

需要。该技能要求与通用的 Solana 开发技能配合使用,以处理项目搭建、钱包和测试。

详情

作者的原始描述

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.

repo: internet-court/internet-court-skill

热度

GitHub 星标
7.0k
排名
#13641
许可证
—
更新时间
2026/10/26

这个技能有用吗?

0

登录 后即可投票。

评论

  • …

同一仓库的更多技能

相似技能