-
Notifications
You must be signed in to change notification settings - Fork 0
Add Metaplex skill and official Core fetch flow #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,119 @@ | ||
| --- | ||
| name: metaplex | ||
| description: Metaplex development on Solana — NFTs, tokens, compressed NFTs, candy machines, token launches. Use when working with Token Metadata, Core, Bubblegum, Candy Machine, Genesis, or the mplx CLI. | ||
| license: Apache-2.0 | ||
| metadata: | ||
| author: metaplex-foundation | ||
| version: "0.1.0" | ||
| openclaw: {"emoji":"💎","os":["darwin","linux","win32"],"requires":{"bins":["node"]},"homepage":"https://developers.metaplex.com"} | ||
| --- | ||
|
|
||
| # Metaplex Development Skill | ||
|
|
||
| ## Overview | ||
|
|
||
| Metaplex provides the standard infrastructure for NFTs and tokens on Solana: | ||
| - **Core**: Next-gen NFT standard (recommended for new NFT projects) | ||
| - **Token Metadata**: Fungible tokens + legacy NFTs/pNFTs | ||
| - **Bubblegum**: Compressed NFTs (cNFTs) using Merkle trees — massive scale at minimal cost | ||
| - **Candy Machine**: NFT drops with configurable minting rules | ||
| - **Genesis**: Token launch protocol with fair distribution + liquidity graduation | ||
|
|
||
| ## Tool Selection | ||
|
|
||
| > **Prefer CLI over SDK** for direct execution. Use SDK only when user specifically needs code. | ||
|
|
||
| | Approach | When to Use | | ||
| |----------|-------------| | ||
| | **CLI (`mplx`)** | Default choice - direct execution, no code needed | | ||
| | **Umi SDK** | User needs code — default SDK choice. Covers all programs (TM, Core, Bubblegum, Genesis) | | ||
| | **Kit SDK** | User specifically uses @solana/kit, or asks for minimal dependencies. Token Metadata only — no Core/Bubblegum/Genesis support | | ||
|
|
||
| ## Task Router | ||
|
|
||
| > **IMPORTANT**: You MUST read the detail file for your task BEFORE executing any command or writing any code. The command syntax, required flags, setup steps, and batching rules are ONLY in the detail files. Do NOT guess commands from memory. | ||
|
|
||
| | Task Type | Read This File | | ||
| |-----------|----------------| | ||
| | Any CLI operation (shared setup) | `./references/cli.md` | | ||
| | CLI: Core NFTs/Collections | `./references/cli.md` + `./references/cli-core.md` | | ||
| | CLI: Token Metadata NFTs | `./references/cli.md` + `./references/cli-token-metadata.md` | | ||
| | CLI: Compressed NFTs (Bubblegum) | `./references/cli.md` + `./references/cli-bubblegum.md` | | ||
| | CLI: Candy Machine (NFT drops) | `./references/cli.md` + `./references/cli-candy-machine.md` | | ||
| | CLI: Token launch (Genesis) | `./references/cli.md` + `./references/cli-genesis.md` | | ||
| | CLI: Fungible tokens | `./references/cli.md` (toolbox section) | | ||
| | SDK setup (Umi) | `./references/sdk-umi.md` | | ||
| | SDK: Core NFTs | `./references/sdk-umi.md` + `./references/sdk-core.md` | | ||
| | SDK: Token Metadata | `./references/sdk-umi.md` + `./references/sdk-token-metadata.md` | | ||
| | SDK: Compressed NFTs (Bubblegum) | `./references/sdk-umi.md` + `./references/sdk-bubblegum.md` | | ||
| | SDK: Token Metadata with Kit | `./references/sdk-token-metadata-kit.md` | | ||
| | SDK: Token launch (Genesis) | `./references/sdk-umi.md` + `./references/sdk-genesis.md` | | ||
| | Account structures, PDAs, concepts | `./references/concepts.md` | | ||
|
|
||
| ## CLI Capabilities | ||
|
|
||
| The `mplx` CLI can handle most Metaplex operations directly. **Read `./references/cli.md` for shared setup, then the program-specific file.** | ||
|
|
||
| | Task | CLI Support | | ||
| |------|-------------| | ||
| | Create fungible token | ✅ | | ||
| | Create Core NFT/Collection | ✅ | | ||
| | Create TM NFT/pNFT | ✅ | | ||
| | Transfer TM NFTs | ✅ | | ||
| | Transfer fungible tokens | ✅ | | ||
| | Transfer Core NFTs | ❌ SDK only | | ||
| | Upload to Irys | ✅ | | ||
| | Candy Machine drop | ✅ (setup/config/insert — minting requires SDK) | | ||
| | Compressed NFTs (cNFTs) | ✅ (batch limit ~100, use SDK for larger) | | ||
| | Check SOL balance / Airdrop | ✅ | | ||
| | Query assets by owner/collection | ❌ SDK only (DAS API) | | ||
| | Token launch (Genesis) | ✅ | | ||
|
|
||
| ## Program IDs | ||
|
|
||
| ``` | ||
| Token Metadata: metaqbxxUerdq28cj1RbAWkYQm3ybzjb6a8bt518x1s | ||
| Core: CoREENxT6tW1HoK8ypY1SxRMZTcVPm7R94rH4PZNhX7d | ||
| Bubblegum V1: BGUMAp9SX3uS4efGcFjPjkAQZ4cUNZhtHaMq64nrGf9D | ||
| Bubblegum V2: BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY | ||
| Core Candy: CMACYFENjoBMHzapRXyo1JZkVS6EtaDDzkjMrmQLvr4J | ||
| Genesis: GNS1S5J5AspKXgpjz6SvKL66kPaKWAhaGRhCqPRxii2B | ||
| ``` | ||
|
Comment on lines
+74
to
+81
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a language to this fenced block. The Program IDs block is missing a fence language, which trips the current markdownlint rule set. 🤖 Prompt for AI Agents |
||
|
|
||
| ## Quick Decision Guide | ||
|
|
||
| ### NFTs: Core vs Token Metadata | ||
|
|
||
| | Choose | When | | ||
| |--------|------| | ||
| | **Core** | New NFT projects, lower cost (87% cheaper), plugins, royalty enforcement | | ||
| | **Token Metadata** | Existing TM collections, need editions, pNFTs for legacy compatibility | | ||
|
|
||
| ### Compressed NFTs (Massive Scale) | ||
|
|
||
| Use **Bubblegum** when minting thousands+ of NFTs at minimal cost. See `./references/cli-bubblegum.md` (CLI) or `./references/sdk-bubblegum.md` (SDK). | ||
|
|
||
| ### Fungible Tokens | ||
|
|
||
| Always use **Token Metadata**. Read `./references/cli.md` (toolbox section) for CLI commands. | ||
|
|
||
| ### NFT Drops | ||
|
|
||
| Use **Core Candy Machine**. Read `./references/cli.md` + `./references/cli-candy-machine.md`. | ||
|
|
||
| ### Token Launches (Token Generation Event / Fair Launch / Memecoin) | ||
|
|
||
| Use **Genesis**. The **Launch API** (`genesis launch create` / `createAndRegisterLaunch`) is recommended — it handles everything in one step. Two launch types: | ||
| - **`project`** (default): Configurable allocations, 48h deposit, team vesting support | ||
| - **`memecoin`**: Simplified, 1h deposit, hardcoded fund flows — only needs name, symbol, image, and deposit start time | ||
|
|
||
| Read `./references/cli.md` + `./references/cli-genesis.md` (CLI) or `./references/sdk-genesis.md` (SDK). | ||
|
|
||
| ## External Resources | ||
|
|
||
| - Documentation: https://developers.metaplex.com | ||
| - Core: https://developers.metaplex.com/core | ||
| - Token Metadata: https://developers.metaplex.com/token-metadata | ||
| - Bubblegum: https://developers.metaplex.com/bubblegum-v2 | ||
| - Candy Machine: https://developers.metaplex.com/core-candy-machine | ||
| - Genesis: https://developers.metaplex.com/genesis | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,126 @@ | ||
| # Bubblegum CLI Reference | ||
|
|
||
| Commands for creating and managing compressed NFTs (cNFTs) via the `mplx` CLI. | ||
|
|
||
| > **Prerequisites**: Run Initial Setup from `./cli.md` first (RPC, keypair, SOL balance). | ||
| > | ||
| > **Batch limit**: CLI is practical for up to ~100 cNFTs. For larger mints (thousands+), use the Umi SDK (`./sdk-bubblegum.md`) or Candy Machine instead. | ||
|
|
||
| --- | ||
|
|
||
| ## When to Use Bubblegum | ||
|
|
||
| | Use Bubblegum | Use Core Instead | | ||
| |---------------|------------------| | ||
| | Minting thousands+ of NFTs | Small collections (< 1000) | | ||
| | Lowest possible cost per NFT | Need on-chain plugins (royalties, freeze) | | ||
| | Airdrops, loyalty programs, tickets | Marketplace-focused projects | | ||
| | Proof of attendance, credentials | Simple 1/1 NFTs | | ||
|
|
||
| --- | ||
|
|
||
| ## Key Concepts | ||
|
|
||
| ### Merkle Trees | ||
|
|
||
| Bubblegum stores NFTs as leaves in a concurrent Merkle tree. Only the **Merkle root** (a single hash) lives on-chain — the actual NFT data is stored in transactions and indexed by RPC providers via the **DAS API**. | ||
|
|
||
| Each tree has two on-chain accounts: | ||
| - **Merkle Tree Account** — stores the tree structure, change log, and canopy | ||
| - **TreeConfigV2 Account** — PDA tracking tree creator, delegate, capacity, and mint count | ||
|
|
||
| ### Tree Sizing | ||
|
|
||
| | cNFTs | Tree Depth | Canopy Depth | Buffer Size | Tree Cost | Cost per cNFT | | ||
| |-------|-----------|-------------|-------------|-----------|---------------| | ||
| | 16,384 | 14 | 8 | 64 | ~0.34 SOL | ~0.00002 SOL | | ||
| | 65,536 | 16 | 10 | 64 | ~0.71 SOL | ~0.00001 SOL | | ||
| | 262,144 | 18 | 12 | 64 | ~2.10 SOL | ~0.00001 SOL | | ||
| | 1,048,576 | 20 | 13 | 1024 | ~8.50 SOL | ~0.000008 SOL | | ||
| | 16,777,216 | 24 | 15 | 2048 | ~26.12 SOL | ~0.000002 SOL | | ||
| | 1,073,741,824 | 30 | 17 | 2048 | ~72.65 SOL | ~0.00000005 SOL | | ||
|
|
||
| - **Tree Depth** — determines max capacity (2^depth leaves) | ||
| - **Max Buffer Size** — concurrency limit (parallel mints in same block) | ||
| - **Canopy Depth** — cached upper tree nodes; higher = smaller proofs, better composability, but higher rent | ||
|
|
||
| ### Proofs and DAS API | ||
|
|
||
| Operations on existing cNFTs (transfer, burn, update) require a **Merkle proof** to verify the leaf. Proofs are fetched from RPC providers via the DAS API — not from on-chain data. | ||
|
|
||
| --- | ||
|
|
||
| ## Commands | ||
|
|
||
| ```bash | ||
| # Tree management | ||
| mplx bg tree create --wizard # Interactive (recommended) | ||
| mplx bg tree create --maxDepth <N> --maxBufferSize <N> --canopyDepth <N> # Manual | ||
| mplx bg tree list # List trees created via --wizard only | ||
|
|
||
| # cNFT operations | ||
| mplx bg nft create --wizard # Interactive | ||
| mplx bg nft create <TREE> --name <NAME> --uri <URI> # With pre-uploaded metadata | ||
| mplx bg nft create <TREE> --name <NAME> --image <PATH> --description <DESC> # With local files | ||
| mplx bg nft create <TREE> --name <NAME> --uri <URI> --collection <ADDR> # In collection | ||
| mplx bg nft fetch <ASSETID> | ||
| mplx bg nft transfer <ASSETID> <NEWOWNER> | ||
| mplx bg nft burn <ASSETID> | ||
| mplx bg nft update <ASSETID> --name <NAME> | ||
|
|
||
| # Collection for cNFTs (uses MPL Core collections) | ||
| mplx bg collection create --name <NAME> --uri <URI> | ||
| mplx bg collection create --name <NAME> --uri <URI> --royalties <PERCENT> | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## CLI Workflow | ||
|
|
||
| ```bash | ||
| # 1. Create a tree (wizard guides through depth/buffer/canopy selection) | ||
| mplx bg tree create --wizard | ||
|
|
||
| # 2. (Optional) Create a collection for your cNFTs | ||
| mplx bg collection create --name "My Collection" --uri "https://arweave.net/xxx" | ||
|
|
||
| # 3. Mint cNFTs into the tree | ||
| mplx bg nft create <TREE_NAME_OR_ADDRESS> --name "My cNFT" --image ./image.png --description "A compressed NFT" | ||
|
|
||
| # 4. Transfer (requires DAS-compatible RPC, not available on localnet) | ||
| mplx bg nft transfer <ASSETID> <RECIPIENT_ADDRESS> | ||
| ``` | ||
|
|
||
| For batch minting, chain commands: | ||
| ```bash | ||
| mplx bg nft create <TREE> --name "cNFT #1" --uri "<URI_1>" && \ | ||
| mplx bg nft create <TREE> --name "cNFT #2" --uri "<URI_2>" && \ | ||
| mplx bg nft create <TREE> --name "cNFT #3" --uri "<URI_3>" | ||
| ``` | ||
|
|
||
| --- | ||
|
|
||
| ## Localnet Limitations | ||
|
|
||
| Only tree creation (`mplx bg tree create`) and minting (`mplx bg nft create`) work on localhost/localnet. Operations that require DAS API -- fetch, transfer, burn, update -- do NOT work on localnet because the test validator does not support DAS. | ||
|
|
||
| --- | ||
|
|
||
| ## Program IDs | ||
|
|
||
| ``` | ||
| Bubblegum V1: BGUMAp9SX3uS4efGcFjPjkAQZ4cUNZhtHaMq64nrGf9D | ||
| Bubblegum V2: BGUMAp9Gq7iTEuizy4pqaxsTyUCBK68MDfK752saRPUY | ||
| ``` | ||
|
Comment on lines
+111
to
+114
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add a language to this fenced block. The Program IDs block is unlabeled, so it fails the current markdownlint configuration. 🧰 Tools🪛 markdownlint-cli2 (0.21.0)[warning] 111-111: Fenced code blocks should have a language specified (MD040, fenced-code-language) 🤖 Prompt for AI Agents |
||
|
|
||
| --- | ||
|
|
||
| ## Cost Comparison | ||
|
|
||
| | Standard | Cost per NFT | Accounts | Best For | | ||
| |----------|-------------|----------|----------| | ||
| | **Bubblegum** | ~$0.000005 | 0 (shared tree) | Massive scale | | ||
| | **Core** | ~0.0029 SOL | 1 | Small-medium collections | | ||
| | **Token Metadata** | ~0.022 SOL | 3-4 | Fungibles, legacy | | ||
|
|
||
| Bubblegum is ~98% cheaper than Token Metadata and ~90% cheaper than Core at scale. The trade-off is that cNFT operations require DAS API access for proof fetching. | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update this review note to match the current PR state.
These bullets still say no local skill installation was applied and only upstream fixes remain, but this PR now vendors a local Metaplex skill under
.agents/skills/metaplex/and addsskills-lock.json. Leaving the old conclusion here will give future agents stale memory.🤖 Prompt for AI Agents