기능

압축된 NFT 업데이트

Last updated June 19, 2026

Summary

Updating a compressed NFT modifies its metadata using the updateMetadataV2 instruction. This page covers update authority rules for collection-based and tree-based cNFTs.

  • Update cNFT metadata (name, URI, creators, royalties) using updateMetadataV2
  • Collection authority updates cNFTs that belong to a collection
  • Tree authority updates cNFTs that do not belong to a collection
  • Changes are reflected in the merkle tree and indexed by DAS API providers
  • updateMetadataV2에 ...assetWithProof를 전개해 getAssetWithProof.currentMetadata(리프 정규)를 사용

updateMetadataV2 명령어는 압축된 NFT의 메타데이터를 수정하는 데 사용할 수 있습니다. 머클 루트가 업데이트되어 데이터의 전파된 해시를 반영하고, Metaplex DAS API를 준수하는 RPC 제공업체는 cNFT의 인덱스를 업데이트합니다.

메타데이터는 압축된 NFT가 컬렉션의 확인된 항목인지 여부에 따라 두 권한 중 하나에 의해 업데이트될 수 있습니다.

업데이트 권한

cNFT는 두 가지 가능한 업데이트 권한을 가집니다: 트리 소유자, 또는 (컬렉션에 속한 경우) 컬렉션 권한.

컬렉션 권한

cNFT가 컬렉션에 속한 경우 해당 cNFT의 업데이트 권한은 컬렉션의 권한이 됩니다. cNFT를 업데이트할 때 업데이트 함수에 coreCollection 인수를 전달해야 합니다.

권한은 현재 umi 신원에서 추론됩니다. 권한이 현재 umi 신원과 다른 경우 authority 인수를 서명자 타입으로 전달하거나 나중에 서명하기 위해 noopSigner를 생성해야 합니다.

await updateMetadataV2(umi, {
...
authority: collectionAuthority,
coreCollection: publicKey("11111111111111111111111111111111"),
}).sendAndConfirm(umi)

트리 권한

cNFT가 컬렉션에 속하지 않는 경우 cNFT의 업데이트 권한은 cNFT가 속한 트리의 권한이 됩니다. 이 경우 업데이트 함수에서 coreCollection 인수를 생략합니다.

권한은 현재 umi 신원에서 추론됩니다. 권한이 현재 umi 신원과 다른 경우 authority 인수를 서명자 타입으로 전달하거나 나중에 서명하기 위해 noopSigner를 생성해야 합니다.

cNFT 업데이트

압축된 NFT 업데이트

import {
getAssetWithProof,
updateMetadataV2,
UpdateArgsArgs,
} from '@metaplex-foundation/mpl-bubblegum'
import { some } from '@metaplex-foundation/umi'
// 도우미를 사용하여 자산과 증명을 가져옵니다.
const assetWithProof = await getAssetWithProof(umi, assetId, {
truncateCanopy: true,
})
// 그런 다음 NFT의 메타데이터를 업데이트하는 데 사용할 수 있습니다.
const updateArgs: UpdateArgsArgs = {
name: some('새 이름'),
uri: some('https://updated-example.com/my-nft.json'),
}
await updateMetadataV2(umi, {
...assetWithProof,
leafOwner,
updateArgs,
// 선택적 매개변수. 권한이 현재 umi 신원과 다른 서명자 타입인 경우
// 여기에 해당 서명자를 할당합니다.
authority: <Signer>,
// 선택적 매개변수. cNFT가 컬렉션에 속한 경우 여기에 전달합니다.
coreCollection: publicKey("22222222222222222222222222222222"),
}).sendAndConfirm(umi)

쓰기 명령용 리프 메타데이터

getAssetWithProof는 metadata(DAS 표시 / 해석 비율)와 currentMetadata(리프 정규 MetadataArgsV2Args, 상속 시 65535)를 모두 반환합니다. 쓰기 시 ...assetWithProof를 전개하고 표시용 metadata를 currentMetadata로 전달하지 마세요. UI에는 metadata / rpcAsset, 상속 감지에는 inherited를 사용하세요.

자산을 읽을 때 DAS 응답 필드 안내는 상속 로열티 읽기를 참조하세요.

상속된 로열티

updateArgs.sellerFeeBasisPoints를 some(SELLER_FEE_BASIS_POINTS_INHERIT)로 설정하면 cNFT를 상속 로열티로 전환할 수 있습니다. 컬렉션에는 Royalties 플러그인이 있어야 하며 업데이트된 메타데이터의 creators 배열은 비어 있어야 합니다.

상속 로열티에서 명시적인 비율로 되돌리려면 — 예를 들어 cNFT를 컬렉션에서 제거하기 전에 — 원하는 basis points를 전달하세요:

1import {
2 getAssetWithProof,
3 updateMetadataV2,
4 UpdateArgsArgs,
5 mplBubblegum,
6} from '@metaplex-foundation/mpl-bubblegum'
7import { dasApi } from '@metaplex-foundation/digital-asset-standard-api'
8import { keypairIdentity, publicKey, some } from '@metaplex-foundation/umi'
9import { createUmi } from '@metaplex-foundation/umi-bundle-defaults'
10import { readFileSync } from 'fs'
11
12// getAssetWithProof calls getAsset and getAssetProof, so this needs a
13// DAS-capable RPC. The public Solana endpoints do not serve DAS methods.
14const umi = createUmi('YOUR_DAS_ENABLED_RPC_URL')
15 .use(mplBubblegum())
16 .use(dasApi())
17
18// The leaf owner or an authorised delegate must sign the update.
19const keypair = umi.eddsa.createKeypairFromSecretKey(
20 new Uint8Array(JSON.parse(readFileSync('./keypair.json', 'utf8')))
21)
22umi.use(keypairIdentity(keypair))
23
24const assetId = publicKey('YOUR_ASSET_ID')
25const collectionPublicKey = publicKey('YOUR_COLLECTION_ADDRESS')
26
27const assetWithProof = await getAssetWithProof(umi, assetId, {
28 truncateCanopy: true,
29})
30
31// Switch from inherited royalties to an explicit seller fee before removing
32// the cNFT from its collection.
33const updateArgs: UpdateArgsArgs = {
34 sellerFeeBasisPoints: some(550), // explicit 5.5%
35}
36
37// Spread includes currentMetadata (leaf-canonical). Do not pass metadata here.
38await updateMetadataV2(umi, {
39 ...assetWithProof,
40 updateArgs,
41 coreCollection: collectionPublicKey,
42}).sendAndConfirm(umi)
43
44// Leaf seller fee updated from inherit sentinel (65535) to 550 basis points

Notes

  • The update authority depends on whether the cNFT belongs to a collection. Collection cNFTs use the collection authority; standalone cNFTs use the tree authority.
  • updateMetadataV2에 ...assetWithProof를 전개해 리프 정규 currentMetadata로 검증할 수 있게 하세요.
  • Use some() for fields you want to update and omit fields you want to keep unchanged.
  • Inherited seller fees require an empty leaf-level creators array and a collection with the Royalties plugin.

FAQ

압축된 NFT의 메타데이터를 업데이트할 수 있는 사람은 누구인가요?

cNFT가 컬렉션에 속한 경우 컬렉션 권한만 업데이트할 수 있습니다. 컬렉션에 속하지 않은 경우 트리 권한(트리 생성자 또는 위임자)이 업데이트할 수 있습니다.

cNFT에서 업데이트할 수 있는 필드는 무엇인가요?

UpdateArgsArgs에 정의된 이름, URI, seller fee basis points 및 기타 메타데이터 필드를 업데이트할 수 있습니다. 변경하려는 필드에는 some('newValue')를 사용하세요.

업데이트 시 컬렉션을 전달해야 하나요?

예, cNFT가 컬렉션에 속한 경우. 컬렉션의 공개 키와 함께 coreCollection 매개변수를 전달하세요. 컬렉션 권한이 트랜잭션에 서명해야 합니다.

컬렉션에서 로열티를 상속하는 cNFT를 업데이트하려면 어떻게 해야 하나요?

updateMetadataV2에 ...assetWithProof를 전개하면 상속 시 currentMetadata에 온체인 센티널이 들어갑니다. 상속 로열티로 전환하려면 updateArgs.sellerFeeBasisPoints에 some(SELLER_FEE_BASIS_POINTS_INHERIT)를, 벗어나려면 명시적인 숫자를 사용하세요.

Glossary

TermDefinition
updateMetadataV2The Bubblegum V2 instruction for modifying compressed NFT metadata
Collection AuthorityThe update authority of the MPL-Core collection, authorized to update cNFTs in that collection
Tree AuthorityThe tree creator or delegate, authorized to update cNFTs that do not belong to a collection
UpdateArgsArgsThe TypeScript type defining which metadata fields to update, using Option wrappers
currentMetadata기존 리프 메타데이터에 대한 updateMetadataV2의 IDL 인자; ...assetWithProof 전개 시 getAssetWithProof.currentMetadata가 제공됨
SELLER_FEE_BASIS_POINTS_INHERITSentinel value 65535 indicating royalties are inherited from the MPL-Core collection