MPL Coreでのプリントエディション
Last updated January 31, 2026
はじめに
エディションとは?
エディションは同じ「マスターエディション」のコピーです。概念を理解するために、物理的な絵画を思い浮かべると役立ちます:マスターエディションは最初の絵画で、エディション(プリントとも呼ばれる)はその絵画のコピーです。
CoreでのEditions
MPL Core Editionサポートはメインネットリリース後すぐに追加されました。Token Metadata Editionsとは異なり、エディション番号と供給量は強制されず、情報提供のみです。 Coreでエディション概念を実現するために、2つのプラグインが使用されます:CollectionのMaster EditionとAsset(プリント)のEdition。階層は次のようになります:
Candy Machineを使用したEditionの作成
Editionを作成・販売する最も簡単な方法は、Core Candy Machineを活用することです。 以下のコードは、Master Edition CollectionとEditionをプリントするCandy Machineを作成します。
Edition GuardとMaster Edition Collectionを持つCandy Machineの作成
まず、必要なすべての関数をインポートし、RPCとWalletでUmiをセットアップします:
import {
create,
mplCandyMachine,
} from "@metaplex-foundation/mpl-core-candy-machine";
import {
createCollection,
ruleSet
} from "@metaplex-foundation/mpl-core";
import crypto from "crypto";
import {
generateSigner,
keypairIdentity,
} from "@metaplex-foundation/umi";
import { createUmi } from "@metaplex-foundation/umi-bundle-defaults";
// 選択したRPCエンドポイントを使用
const umi = createUmi("http://127.0.0.1:8899").use(mplCandyMachine());
// あなたのキーペアまたはWallet Adapterを使用
const keypair = generateSigner(umi);
umi.use(keypairIdentity(keypair));
このセットアップ後、Master Editionプラグインを持つCollectionを作成できます。maxSupplyフィールドはプリントするEditionの数を決定します。プラグインのnameとuriフィールドは、Collection名とuriに加えて使用できます。 使いやすさのために、Royaltyプラグインも追加します。
const collectionSigner = generateSigner(umi);
await createCollection(umi, {
collection: collectionSigner,
name: "Master Edition",
uri: "https://example.com/master-edition.json",
plugins: [
{
type: "MasterEdition",
maxSupply: 100,
// 親コレクションと同じにしたい場合はnameとuriは不要
name: undefined,
uri: undefined,
},
{
type: "Royalties",
basisPoints: 500,
creators: [{ address: umi.identity.publicKey, percentage: 100 }],
ruleSet: ruleSet("None"),
}
]
}).sendAndConfirm(umi);
Collectionの作成後、hiddenSettingsとeditionガードを使用してCandy Machineを作成できます。
hiddenSettingsは、ミントされたすべてのAssetsに同じ、または類似の名前とメタデータを割り当てるために使用されます。$ID$変数を使用すると、ミント時にミントされたAssetのインデックスに置き換えられます。editionガードは、AssetsにEditionプラグインを追加するために使用されます。Edition番号はミントされたAssetごとに増加し、editionStartOffsetの番号から始まります。
// EditionsのNameとオフチェーンメタデータ
const editionData = {
name: "Edition Name",
uri: "https://example.com/edition-asset.json",
};
// editionsは使用しないがCandy Machineが必要とする
// ハッシュを作成
const string = JSON.stringify(editionData);
const hash = crypto.createHash("sha256").update(string).digest();
const candyMachine = generateSigner(umi);
const createIx = await create(umi, {
candyMachine,
collection: collectionSigner.publicKey,
collectionUpdateAuthority: umi.identity,
itemsAvailable: 100,
hiddenSettings: {
name: editionData.name,
uri: editionData.uri,
hash,
},
guards: {
edition: { editionStartOffset: 0 },
// ... 追加のGuards
},
})
await createIx.sendAndConfirm(umi);
これで完了です! ユーザーはあなたのCandy MachineからEditionをミントできます。
Core Candy MachineなしでEditionを作成
MPL Core EditionsにはCore Candy Machineの使用を強く推奨します。Candy MachineはEditionsの作成と正しい番号付けを処理します。
Core Candy MachineなしでEditionを作成するには:
- Master Editionプラグインを使用してCollectionを作成
Master EditionプラグインでMPL Core Collectionを作成
import { generateSigner, publicKey } from '@metaplex-foundation/umi'
import {
createCollection,
ruleSet,
} from '@metaplex-foundation/core'
const collectionSigner = generateSigner(umi)
const creator1 = publicKey('11111111111111111111111111111111')
const creator2 = publicKey('22222222222222222222222222222222')
await createCollection(umi, {
collection: collectionSigner,
name: "Master Edition",
uri: "https://example.com/master-edition.json",
plugins: [
{
type: "MasterEdition",
maxSupply: 100,
// 親コレクションと同じにしたい場合はnameとuriは不要
name: undefined,
uri: undefined,
},
{
type: "Royalties",
basisPoints: 500,
creators: [
{ address: creator1, percentage: 50 },
{ address: creator2, percentage: 50 }
],
ruleSet: ruleSet("None"),
}
]
}).sendAndConfirm(umi);
- Editionプラグインを持つAssetsを作成。プラグイン内の番号を増加させることを忘れないでください。
EditionプラグインでMPL Core Assetを作成
import { publicKey } from '@metaplex-foundation/umi'
import {
create,
} from '@metaplex-foundation/mpl-core'
const asset = generateSigner(umi)
const result = create(umi, {
asset: asset,
name: 'My Nft',
uri: 'https://example.com/my-nft',
collection: collectionSigner.publicKey,
plugins: [
{
type: 'Edition',
number: 1,
}
],
}).sendAndConfirm(umi)
