プラグイン

プラグインのデリゲートと取り消し

Last updated January 31, 2026

このガイドでは、Core Assetsでプラグイン権限をデリゲートおよび取り消す方法を説明します。プラグインの制御を他のアドレスに移譲したり、プラグインデータを永続的に不変にしたりします。

学べること

  • プラグイン権限を別のアドレスにデリゲート
  • デリゲートされた権限を取り消し
  • プラグインタイプによる取り消し動作の違いを理解
  • プラグインデータを不変にする

概要

approvePluginAuthority()でプラグイン権限をデリゲートし、revokePluginAuthority()で取り消します。プラグインタイプによって取り消し動作が異なります。

  • Owner Managed: Owner authorityに戻る
  • Authority Managed: UpdateAuthorityに戻る
  • authorityをNoneに設定するとプラグインが不変になる
  • Owner ManagedプラグインはAsset転送時に自動取り消し

対象外

プラグインの削除(プラグインの削除を参照)、プラグインの追加(プラグインの追加を参照)、永続的なプラグイン権限変更。

クイックスタート

ジャンプ先: 権限をデリゲート · 権限を取り消し · 不変にする

  1. 新しいauthorityアドレスでapprovePluginAuthority()を呼び出す
  2. 取り消すにはrevokePluginAuthority()を呼び出す
  3. 不変にするにはauthorityをNoneに設定

権限のデリゲート

プラグインは、Delegate Authority命令の更新で別のアドレスにデリゲートできます。デリゲートされたプラグインにより、メインのauthority以外のアドレスがそのプラグインの機能を制御できます。

プラグイン権限のデリゲート

import { publicKey } from '@metaplex-foundation/umi'
import { approvePluginAuthority } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const delegate = publicKey('33333333333333333333333333333')
await approvePluginAuthority(umi, {
asset: assetAddress,
plugin: { type: 'Attributes' },
newAuthority: { type: 'Address', address: delegate },
}).sendAndConfirm(umi)

権限の取り消し

プラグインの権限を取り消すと、取り消されるプラグインタイプによって異なる動作が発生します。

  • Owner Managedプラグイン: Owner Managedプラグインからアドレスが取り消されると、プラグインはデフォルトでOwner authorityタイプに戻ります。
  • Authority Managedプラグイン: Authority Managedプラグインからアドレスが取り消されると、プラグインはデフォルトでUpdateAuthority authorityタイプに戻ります。

誰がプラグインを取り消せるか?

Owner Managedプラグイン

  • Owner Managedプラグインはオーナーによって取り消すことができ、デリゲートを取り消してpluginAuthorityタイプをOwnerに設定します。
  • プラグインのデリゲートされたAuthorityは自分自身を取り消すことができ、その後プラグインauthorityタイプはOwnerに設定されます。
  • 転送時、Owner Managedプラグインのデリゲートされた権限は自動的に取り消され、Owner Authorityタイプに戻ります。

Authority Managedプラグイン

  • AssetのUpdate Authorityはデリゲートを取り消すことができ、pluginAuthorityタイプをUpdateAuthorityに設定します。
  • プラグインのデリゲートされたAuthorityは自分自身を取り消すことができ、その後プラグインauthorityタイプはUpdateAuthorityに設定されます。 プラグインとそのタイプのリストはプラグイン概要ページで確認できます。

プラグイン権限の取り消し

import { publicKey } from '@metaplex-foundation/umi'
import { revokePluginAuthority } from '@metaplex-foundation/mpl-core'
await revokePluginAuthority(umi, {
asset: asset.publicKey,
plugin: { type: 'Attributes' },
}).sendAndConfirm(umi)

Asset転送時のデリゲートリセット

すべてのOwner ManagedプラグインはAsset転送時にデリゲートされた権限が取り消され、Owner authorityタイプに戻ります。 これには以下が含まれます:

  • Freeze Delegate
  • Transfer Delegate
  • Burn Delegate

プラグインデータを不変にする

プラグインのauthorityをNone値に更新すると、プラグインのデータが実質的に不変になります。

警告 - これを行うと、プラグインデータは不変になります。注意して進めてください!

プラグインを不変にする

import {
approvePluginAuthority
} from '@metaplex-foundation/mpl-core'
await approvePluginAuthority(umi, {
asset: asset.publicKey,
plugin: { type: 'FreezeDelegate' },
newAuthority: { type: 'None' },
}).sendAndConfirm(umi)

一般的なエラー

Authority mismatch

このプラグインをデリゲートまたは取り消す権限がありません。現在のauthorityのみがデリゲートでき、オーナー/authorityのみが取り消せます。

Plugin not found

Asset/Collectionにこのプラグインタイプがアタッチされていません。

Cannot revoke None authority

None authorityのプラグインは不変です。取り消すauthorityがありません。

注意事項

  • デリゲートは制御を移譲しますが、元のauthorityの取り消し能力は削除されません
  • authorityをNoneに設定することは永続的で不可逆です
  • Owner ManagedプラグインはAssetが新しいオーナーに転送されると自動取り消しされます
  • 取り消しはauthorityをデフォルトタイプ(OwnerまたはUpdateAuthority)に戻します

クイックリファレンス

プラグインタイプ別の取り消し動作

プラグインタイプ取り消し先
Owner ManagedOwner authority
Authority ManagedUpdateAuthority

誰がデリゲート/取り消しできるか

アクションOwner ManagedAuthority Managed
デリゲートオーナーUpdate Authority
取り消しオーナーまたはデリゲートUpdate Authorityまたはデリゲート

FAQ

取り消しと削除の違いは何ですか?

取り消しはプラグインを制御する人のみを変更します—プラグインとそのデータは残ります。削除はプラグインを完全に消去します。

複数のアドレスにデリゲートできますか?

いいえ。各プラグインは一度に1つのauthorityのみを持ちます。新しいアドレスにデリゲートすると、以前のauthorityが置き換えられます。

Assetを転送するとデリゲートされたプラグインはどうなりますか?

Owner Managedプラグインは自動的にOwner authorityに戻ります。Authority Managedプラグインは変更されません。

authorityをNoneに設定したものを元に戻せますか?

いいえ。authorityをNoneに設定すると、プラグインは永続的に不変になります。これは元に戻せません。

デリゲートは自分自身を取り消せますか?

はい。デリゲートされたauthorityは自分のアクセスを取り消すことができ、制御はデフォルトのauthorityタイプに戻ります。

関連操作

用語集

用語定義
デリゲートプラグインの一時的な制御を与えられたアドレス
取り消しデリゲートされた権限を削除し、デフォルトに戻す
None Authorityプラグインを不変にする特別なauthorityタイプ
自動取り消し転送時のOwner Managedプラグインの自動取り消し
Plugin Authorityプラグインを制御する現在のアドレス