MPL Core에서의 프린트 에디션
Last updated January 31, 2026
시작하기
에디션이란?
에디션은 동일한 "마스터 에디션"의 복사본입니다. 개념을 이해하기 위해 물리적 그림을 생각해보면 도움이 됩니다: 마스터 에디션은 첫 번째 그림이고, 에디션(프린트라고도 함)은 그 그림의 복사본입니다.
Core에서의 에디션
MPL Core 에디션 지원은 메인넷 출시 직후에 추가되었습니다. Token Metadata 에디션과 달리 에디션 번호와 공급량은 강제되지 않으며 정보 제공 목적으로만 사용됩니다. Core에서 에디션 개념을 구현하기 위해 두 개의 플러그인이 사용됩니다: Collection의 Master Edition과 Asset(프린트)의 Edition. 계층 구조는 다음과 같습니다:
Candy Machine을 사용한 에디션 생성
에디션을 생성하고 판매하는 가장 쉬운 방법은 Core Candy Machine을 활용하는 것입니다. 다음 코드는 Master Edition Collection과 에디션을 프린트할 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 필드는 프린트할 에디션 수를 결정합니다. 플러그인의 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는 민팅된 모든 Asset에 동일하거나 유사한 이름과 메타데이터를 할당하는 데 사용됩니다.$ID$변수를 사용하면 민팅 시 민팅된 Asset의 인덱스로 대체됩니다.edition가드는 Asset에 Edition 플러그인을 추가하는 데 사용됩니다. 에디션 번호는 민팅된 Asset마다 증가하며editionStartOffset번호부터 시작합니다.
// 에디션의 이름과 오프체인 메타데이터
const editionData = {
name: "Edition Name",
uri: "https://example.com/edition-asset.json",
};
// 에디션은 사용하지 않지만 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 },
// ... 추가 Guard
},
})
await createIx.sendAndConfirm(umi);
완료되었습니다! 사용자는 Candy Machine에서 에디션을 민팅할 수 있습니다.
Core Candy Machine 없이 에디션 생성
MPL Core 에디션에는 Core Candy Machine 사용을 강력히 권장합니다. Candy Machine은 에디션 생성과 올바른 번호 매기기를 처리합니다.
Core Candy Machine 없이 에디션을 생성하려면:
- 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 플러그인이 있는 Asset 생성. 플러그인 내 번호를 증가시키는 것을 잊지 마세요.
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)
