magicblock
Skill này làm gì
Skill này bao quát MagicBlock, bộ công cụ Solana dành cho ứng dụng nhanh và độ trễ thấp. Skill giải thích Ephemeral Rollups, tài khoản được ủy quyền, oracle, số ngẫu nhiên và thanh toán riêng tư, dành cho lập trình viên chọn và gỡ lỗi các tính năng của MagicBlock.
Khi nào nên dùng
- ✓Khi bạn muốn xây một ứng dụng Solana nhanh, thời gian thực như một trò chơi.
- ✓Khi bạn cần số ngẫu nhiên, dữ liệu oracle hoặc thanh toán riêng tư trên Solana.
- ✓Khi tích hợp MagicBlock gặp lỗi và bạn cần trợ giúp khắc phục.
Liên kết skill
https://github.com/internet-court/internet-court-skill/blob/main/vendored/magicblock/magicblock-dev/SKILL.mdSao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.
Cách dùng
Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.
Tin nhắn có sẵn để dán
Dành cho Claude Code, Codex hoặc Cursor: chạy lệnh trong thư mục dự án của bạn và skill sẽ được cài đặt.
Tải tệp SKILL.md về và thả vào thư mục skill của agent.
Ví dụ cách nhờ AI
“Tôi đang làm một trò chơi Solana nhanh và muốn biết Ephemeral Rollups của MagicBlock có phù hợp không.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent giải thích sản phẩm MagicBlock nào phù hợp với nhu cầu của bạn, rồi giúp thiết kế cách thiết lập tài khoản và tích hợp. Agent cũng giúp gỡ lỗi các vấn đề ủy quyền, vì tài khoản được ủy quyền trông khác trên chuỗi Solana chính.
Nội dung kỹ thuật (SKILL.md gốc)
Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.
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
Câu hỏi thường gặp
Ephemeral Rollup là gì?
Đó là một lớp nhanh hơn, nơi tài khoản được ủy quyền tiếp tục chạy, còn trạng thái của nó có thể được quyết toán lại về Solana.
Tài khoản tạm thời có thể giữ số dư cuối cùng của tôi không?
Không. Tài khoản tạm thời không bao giờ được ghi nhận lên Solana, nên không thể là bản duy nhất lưu số dư hay kết quả.
Tôi có nên tải thêm skill Solana khác không?
Có. Skill khuyên kết hợp với skill phát triển Solana chung để dựng khung dự án, ví và kiểm thử.
Chi tiết
Mô tả gốc của tác giả
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.
Độ phổ biến
- Sao GitHub
- 7.0k
- Vị trí xếp hạng
- #13641
- Giấy phép
- —
- Cập nhật
- 26/10/2026
Bình luận
- …
Thêm skill từ kho mã này
internet-court
7.0kGiúp agent của bạn thanh toán, thuê hoặc giao dịch an toàn với một agent AI khác hoặc dịch vụ trả phí, và chỉ đến hướng dẫn chuyên sâu phù hợp.
genlayer-erc7710-connector
7.0kGiúp agent của bạn kết nối kết quả đánh giá AI với hệ thống quyền hạn, để một đánh giá xấu có thể hạn chế hoặc hủy quyền của agent.
genlayer-intelligent-contracts
7.0kGiúp agent của bạn xác định quy tắc, bằng chứng và đầu ra của một AI judge kiểm tra xem agent khác có làm đúng nhiệm vụ được ủy quyền hay không.
x402-erc7710
7.0kGiúp agent của bạn trả tiền cho dịch vụ web theo từng yêu cầu, và thiết lập chi tiêu định kỳ nằm trong ngân sách quyền hạn.
Skill tương tự
api-connector-builder
280kGiúp agent của bạn xây dựng kết nối API mới theo đúng mẫu đã có, dùng khi bạn cần thêm một tích hợp mà không tạo cách làm mới.
api-design
280kGiúp agent của bạn thiết kế REST API theo các thực hành tốt nhất, hữu ích để định nghĩa cách API giao tiếp, hiển thị lỗi và tổ chức dữ liệu.
backend-patterns
280kGiúp agent của bạn với các mẫu kiến trúc phía máy chủ và tối ưu cơ sở dữ liệu, hữu ích khi xây dựng hoặc rà soát code chạy trên máy chủ.