smart-accounts-kit
Skill này làm gì
Skill này bao quát MetaMask Smart Accounts Kit, cho phép dApp tạo tài khoản thông minh, gửi các user operation gộp và yêu cầu quyền có phạm vi. Skill giải thích ba loại tài khoản và cách ủy quyền hoạt động, dành cho lập trình viên xây tính năng ví.
Khi nào nên dùng
- ✓Khi bạn muốn người dùng có tài khoản thông minh với các tùy chọn ký linh hoạt.
- ✓Khi bạn muốn một bot phía máy chủ thay mặt người dùng hành động bằng ủy quyền.
- ✓Khi bạn muốn yêu cầu quyền có phạm vi giới hạn từ tiện ích mở rộng MetaMask.
Liên kết skill
https://github.com/internet-court/internet-court-skill/blob/main/vendored/metamask/smart-accounts-kit/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 muốn dApp của mình yêu cầu MetaMask một quyền giới hạn để một bot có thể hành động thay người dùng.”
5 skill mới mỗi tuần. Đọc chỉ 1 phút.
Cách hoạt động
Agent chọn loại tài khoản phù hợp với ứng dụng của bạn, thiết lập các signer, rồi dùng kit để tạo, ký hoặc đổi ủy quyền và yêu cầu quyền. Agent cũng có thể thiết lập tài trợ gas thông qua paymaster.
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.
MetaMask Smart Accounts Kit
When to use
- You want to create ERC-4337 smart accounts (Hybrid, MultiSig, or Stateless7702)
- You want to send user operations or batch transactions via bundlers
- You want to configure signers (EOA, passkey/WebAuthn, multisig, wallet client)
- You want to implement gas abstraction with paymasters
- You want to create, sign, or redeem delegations (ERC-7710)
- You want to request Advanced Permissions via MetaMask extension (ERC-7715)
- You want to build automated backend services (DCA bots, keeper services) using delegations
- You want to implement session accounts for AI agents or automated trading
- You want to set up parallel user operations with nonce keys
Installation
npm install @metamask/smart-accounts-kit permissionless
Which smart account type to use
| Name | Usage |
|---|---|
| Hybrid | A flexible account with EOA, wallet client, and passkey (WebAuthn) signers. The most flexible option for standard dApp users. |
| MultiSig | Requires multiple signers to meet a threshold before transactions execute. Best for treasury, DAO, or shared custody use cases. |
| Stateless7702 | Upgrades an existing EOA to a smart account using EIP-7702 while keeping the same address. Best for users with existing embedded EOAs. |
If the user hasn't specified which implementation they need, present the options.
Delegations vs Advanced Permissions
| Name | Usage |
|---|---|
| Delegations (ERC-7710) | You create, sign, and manage delegations programmatically. The delegator is a smart account you control. You handle the full lifecycle: creation, signing, storage, and redemption. |
| Advanced Permissions (ERC-7715) | You request permissions from a MetaMask user through a human-readable UI in the extension. MetaMask creates and enforces the delegations internally. The user can review and adjust parameters before approving. |
Advanced Permissions use delegations under the hood — ERC-7715 creates ERC-7710 delegations internally. If the user hasn't specified which to use, present the options.
API references
| Use case | Reference | Workflows |
|---|---|---|
| Create a smart account | toMetaMaskSmartAccount | Create hybrid account, Create multisig account, Create 7702 account |
| Create a delegation | createDelegation | Create delegation, Create redelegation |
| Request ERC-7715 permissions | requestExecutionPermissions | Request permissions, Redeem — smart account, Redeem — EOA |
Workflows
| Use case | Workflow |
|---|---|
| Create a Hybrid smart account | Create hybrid account |
| Create a MultiSig smart account | Create multisig account |
| Create a Stateless7702 smart account | Create 7702 account |
| Create and sign a delegation | Create delegation |
| Create a delegation chain (redelegation) | Create redelegation |
| Redeem a delegation when the delegate is a smart account | Redeem delegation — smart account |
| Redeem a delegation when the delegate is an EOA | Redeem delegation — EOA |
| Request ERC-7715 Advanced Permissions | Request permissions |
| Redelegate an ERC-7715 permission context | Create redelegation for permissions |
| Redeem ERC-7715 permissions when the session account is a smart account | Redeem permissions — smart account |
| Redeem ERC-7715 permissions when the session account is an EOA | Redeem permissions — EOA |
Important notes
- Always use caveats — never create unrestricted delegations.
- Deploy the delegator first — the account must be deployed before redeeming delegations.
- Function call scope defaults to
Câu hỏi thường gặp
Loại tài khoản nào phù hợp với đa số người dùng dApp?
Tài khoản Hybrid, hỗ trợ signer EOA, wallet client và passkey, được mô tả là lựa chọn linh hoạt nhất.
Tài khoản MultiSig dùng để làm gì?
Nó cần nhiều signer phê duyệt giao dịch, phù hợp với kho quỹ, DAO hoặc các trường hợp lưu ký chung.
Stateless7702 là gì?
Nó nâng cấp một ví hiện có thành tài khoản thông minh nhưng vẫn giữ nguyên địa chỉ.
Chi tiết
Mô tả gốc của tác giả
Build dApps with MetaMask Smart Accounts Kit — ERC-4337 smart accounts, delegations, and Advanced Permissions (ERC-7715)
Độ phổ biến
- Sao GitHub
- 7.0k
- Vị trí xếp hạng
- #13642
- 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ủ.