插件

Update Delegate 插件

Last updated April 28, 2026

Update Delegate 插件允许您向附加地址授予更新权限。当第三方需要修改 Asset 元数据或管理合集成员资格而不持有主要更新权限时很有用。

您将学到

  • 向 Asset 和 Collection 添加 Update Delegate 插件
  • 向附加地址授予更新权限
  • 了解附加委托方可以和不可以做什么
  • 更新和管理委托方列表
  • 作为委托方向 Collection 添加和移除 Asset

摘要

Update Delegate 是一个权限管理插件,允许更新权限向其他地址授予更新权限。附加委托方可以修改大多数 Asset 数据,但不能更改核心权限设置。

  • 向第三方授予更新权限
  • 添加多个附加委托方
  • 适用于 Asset 和 Collection
  • 具有 Collection 权限的委托方可以管理合集成员资格
  • 委托方不能修改根更新权限

范围外

永久更新委托、所有者级别权限(这是权限管理的)和 Token Metadata 更新权限(不同系统)不在范围内。

快速开始

跳转到: 添加到 Asset · 更新委托方 · Collection · 合集成员资格

  1. 使用委托地址添加 Update Delegate 插件
  2. 可选添加附加委托方
  3. 委托方现在可以更新 Asset 元数据

何时使用 Update Delegate

场景解决方案
第三方需要更新元数据✅ Update Delegate
游戏程序需要修改属性✅ Update Delegate(委托给程序)
多个团队成员需要更新访问权限✅ 附加委托方
永久不可撤销的更新访问权限❌ 不支持(使用多签权限)
所有者应控制更新❌ 使用默认权限
使用 Update Delegate 当您需要向程序或第三方授予更新权限而不转移根权限时。

常见用例

  • 第三方服务:允许平台代您更新元数据
  • 游戏程序:授予您的游戏程序修改 Asset 属性的权限
  • 团队协作:多个团队成员可以更新而无需共享密钥
  • 市场:允许市场更新与挂单相关的元数据
  • 动态内容:自动更新 Asset 数据的服务

兼容性

MPL Core Asset
MPL Core Collection

参数

additionalDelegatespublickey[]

additionalDelegates

附加委托方允许您向 updateDelegate 插件添加多个委托方。 附加委托方可以做更新权限能做的一切,除了:

  • 添加或更改附加委托方数组(除了移除自己)。
  • 更改 updateAuthority 插件的插件权限。
  • 更改 Collection 的根更新权限。

向 Asset 添加 Update Delegate 插件

向 MPL Core Asset 添加 Update Delegate 插件

import { publicKey } from '@metaplex-foundation/umi'
import { addPlugin } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const delegate = publicKey('22222222222222222222222222222222')
await addPlugin(umi, {
asset: assetAddress,
plugin: {
type: 'UpdateDelegate',
authority: { type: 'Address', address: delegate },
additionalDelegates: [],
},
}).sendAndConfirm(umi)

更新 Update Delegate 插件

Update Delegate 插件可以更新以修改附加委托方列表或更改插件权限。

更新 Asset 上的 Update Delegate 插件

import { publicKey } from '@metaplex-foundation/umi'
import { updatePlugin } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const newDelegate = publicKey('33333333333333333333333333333333')
const existingDelegate = publicKey('22222222222222222222222222222222')
await updatePlugin(umi, {
asset: assetAddress,
plugin: {
type: 'UpdateDelegate',
additionalDelegates: [existingDelegate, newDelegate], // 添加或删除委托方
},
}).sendAndConfirm(umi)

更新 Collection 上的 Update Delegate 插件

更新 Collection 上的 Update Delegate 插件

import { publicKey } from '@metaplex-foundation/umi'
import { updateCollectionPlugin } from '@metaplex-foundation/mpl-core'
const collectionAddress = publicKey('11111111111111111111111111111111')
const delegate1 = publicKey('22222222222222222222222222222222')
const delegate2 = publicKey('33333333333333333333333333333333')
await updateCollectionPlugin(umi, {
collection: collectionAddress,
plugin: {
type: 'UpdateDelegate',
additionalDelegates: [delegate1, delegate2], // 更新后的委托方列表
},
}).sendAndConfirm(umi)

使用 Update Delegate 管理 Collection 成员资格

CollectionUpdateDelegate 插件授予无需根更新权限签名即可向 Collection 添加和移除 Asset 的权限。这是游戏服务器将 Asset 分配到公会、或发行平台直接向 Collection 铸造等程序和服务的主要模式。

  • 移除 — 仅需 Collection UpdateDelegate 即可从 Collection 中移除 Asset。
  • 添加 — 向 Collection 添加 Asset 需要 Collection UpdateDelegate 以及对 Asset 的权限(作为其更新权限,或通过 Asset 的 UpdateDelegate 插件)。

控制成员资格的是 CollectionUpdateDelegate 插件,而非 Asset 的。仅拥有 Asset 上的委托方权限无法添加或移除 Collection 成员,需要 Collection 侧的权限。

作为 Collection Update Delegate 向 Collection 添加 Asset

签名者必须在 Collection 的 UpdateDelegate additionalDelegates 数组中注册,并且还需要对 Asset 的权限(作为 Asset 的更新权限,或作为 Asset UpdateDelegate 插件中的委托方)。

1import { publicKey } from '@metaplex-foundation/umi'
2import {
3 update,
4 fetchAsset,
5 updateAuthority,
6} from '@metaplex-foundation/mpl-core'
7
8const assetId = publicKey('11111111111111111111111111111111')
9const collectionId = publicKey('22222222222222222222222222222222')
10
11const asset = await fetchAsset(umi, assetId)
12
13// umi.identity must be in the Collection's UpdateDelegate additionalDelegates
14// AND hold the Asset's update authority (or be in the Asset's UpdateDelegate additionalDelegates)
15await update(umi, {
16 asset,
17 newCollection: collectionId,
18 newUpdateAuthority: updateAuthority('Collection', [collectionId]),
19}).sendAndConfirm(umi)
20
21console.log('Asset added to collection')

作为 Collection Update Delegate 从 Collection 中移除 Asset

签名者只需在 Collection 的 UpdateDelegate additionalDelegates 数组中注册即可。移除 Asset 不需要 Asset 级别的权限。

1import { publicKey } from '@metaplex-foundation/umi'
2import {
3 update,
4 fetchAsset,
5 fetchCollection,
6 collectionAddress,
7 updateAuthority,
8} from '@metaplex-foundation/mpl-core'
9
10const assetId = publicKey('11111111111111111111111111111111')
11
12const asset = await fetchAsset(umi, assetId)
13
14const currentCollectionId = collectionAddress(asset)
15if (!currentCollectionId) {
16 throw new Error('Asset does not belong to a collection')
17}
18const collection = await fetchCollection(umi, currentCollectionId)
19
20// collectionDelegate only needs to be in the Collection's UpdateDelegate additionalDelegates
21const collectionDelegate = umi.identity // replace with your delegate signer if different
22await update(umi, {
23 asset,
24 collection,
25 newUpdateAuthority: updateAuthority('Address', [umi.identity.publicKey]),
26 authority: collectionDelegate,
27}).sendAndConfirm(umi)
28
29console.log('Asset removed from collection')

常见错误

Authority mismatch

只有更新权限(或现有插件权限)可以添加/修改 Update Delegate 插件。

Cannot modify root authority

附加委托方不能更改根更新权限或修改附加委托方列表(除了移除自己)。

注意事项

  • 权限管理:更新权限可以在没有所有者签名的情况下添加
  • 附加委托方拥有几乎完整的更新权限
  • Collection UpdateDelegate 可以从 Collection 中移除 Asset,并可添加其有权限的 Asset
  • 委托方不能更改根更新权限
  • 委托方不能修改附加委托方列表(除了移除自己)
  • 适用于 Asset 和 Collection

快速参考

Asset Update Delegate 权限

操作允许?
更新名称/URI
添加插件
更新插件
删除插件
更改根更新权限
修改附加委托方❌(除了自我移除)
更改插件权限

Collection Update Delegate 权限

操作允许?
从 Collection 中移除任何 Asset
将有权限的 Asset 添加到 Collection
更新 Collection 元数据
更新 Collection 插件
更改 Collection 的根更新权限
修改 Collection 的附加委托方❌(除了自我移除)

常见问题

附加委托方可以做什么?

几乎所有更新权限可以做的事情:更新元数据、添加/删除插件等。他们不能更改根更新权限、修改附加委托方列表或更改 Update Delegate 插件权限。

附加委托方可以添加更多委托方吗?

不可以。只有根更新权限(或插件权限)可以添加或删除附加委托方。

如何将自己从附加委托方中移除?

附加委托方可以通过更新插件时不在 additionalDelegates 数组中包含自己的地址来将自己从列表中移除。

附加委托方有数量限制吗?

没有硬性限制,但更多委托方会增加账户大小和租金。请保持列表合理。

Update Delegate 在 Collection 上有效吗?

是的。向 Collection 添加 Update Delegate 允许委托方更新 Collection 元数据和 Collection 级别的插件。

Collection Update Delegate 可以向 Collection 添加或移除 Asset 吗?

可以。注册在 Collection 的 UpdateDelegate 插件中的委托方可以从 Collection 中移除任何 Asset,并可以将其有权限的 Asset 添加到 Collection 中。请参阅使用 Update Delegate 管理 Collection 成员资格

从 Collection 中移除 Asset 时,Collection Update Delegate 需要 Asset 的权限吗?

不需要。仅凭 Collection 级别的委托方权限即可从 Collection 中移除 Asset。只有在添加 Asset 时才需要 Asset 级别的权限。

相关插件

术语表

术语定义
Update Delegate用于授予更新权限的权限管理插件
附加委托方具有更新权限的额外地址
权限管理由更新权限控制的插件类型
根更新权限Asset/Collection 的主要更新权限