插件

冻结委托

Last updated January 31, 2026

冻结委托插件允许您冻结Core Asset,在Asset保留在所有者钱包中的同时阻止转移和销毁。适用于无托管质押、市场上架和游戏机制。

您将学到什么

  • 向Asset添加冻结委托插件
  • 冻结和解冻Asset
  • 将冻结权限委托给另一个地址
  • 用例:质押、上架、游戏锁定

摘要

冻结委托是一个Owner管理的插件,可以将Asset冻结在原位。冻结后,Asset在冻结authority解冻之前无法被转移或销毁。

  • 无需将Asset转移到托管即可冻结
  • 将冻结authority委托给程序或其他钱包
  • Authority在转移时被撤销(非永久版本)
  • 使用永久冻结委托进行不可撤销的冻结

范围外

Collection级别的冻结(仅限Asset级别)、永久冻结(参见永久冻结委托)以及Token Metadata冻结权限(不同的系统)。

快速入门

跳转到: 添加插件 · 委托Authority · 冻结 · 解冻

  1. 添加冻结委托插件:addPlugin(umi, { asset, plugin: { type: 'FreezeDelegate', data: { frozen: true } } })
  2. Asset现在已冻结,无法被转移
  3. 准备好时解冻:将插件更新为frozen: false
  4. Authority在转移时被撤销

何时使用冻结 vs 永久冻结

用例冻结委托永久冻结委托
市场上架✅ 最佳选择❌ 过度使用
无托管质押✅ 最佳选择✅ 也可以
灵魂绑定代币❌ 转移时撤销✅ 最佳选择
Collection范围冻结❌ 仅限Asset✅ 支持Collection
租赁协议✅ 最佳选择✅ 也可以
选择冻结委托当authority应在所有权变更时重置。
**选择永久冻结委托**当authority必须永久保持。

常见用例

  • 无托管质押:在不转移到托管的情况下冻结质押的NFT
  • 市场上架:在没有托管账户的情况下锁定待售NFT
  • 游戏物品锁定:在游戏过程中临时锁定物品
  • 租赁协议:在租出期间锁定NFT
  • 治理:在投票期间锁定代币
  • 抵押品:锁定用作贷款抵押品的NFT
  • 锦标赛:在比赛参与期间锁定NFT

适用范围

MPL Core Asset
MPL Core Collection
如需Collection级别的冻结,请改用永久冻结委托

参数

参数
frozenbool

函数

向Asset添加冻结委托插件

addPlugin命令向Asset添加冻结委托插件。此插件允许冻结Asset,防止转移和销毁。

向MPL Core Asset添加冻结插件

import { publicKey } from '@metaplex-foundation/umi'
import { addPlugin } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
await addPlugin(umi, {
asset: assetAddress,
plugin: { type: 'FreezeDelegate', data: { frozen: true } },
}).sendAndConfirm(umi)

委托冻结Authority

approvePluginAuthority命令将冻结authority委托给不同的地址。这允许另一个地址在保持所有权的同时冻结和解冻Asset。

委托冻结Authority

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

更新冻结委托插件

冻结委托插件可以更新以更改Asset的冻结状态。这与下面显示的冻结Asset解冻已冻结的Asset函数相同。

冻结Asset

freezeAsset命令冻结Asset,防止其被转移或销毁。这对于无托管质押或市场上架很有用。

冻结MPL Core Asset

import { publicKey } from '@metaplex-foundation/umi'
import { freezeAsset, fetchAsset } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const assetAccount = await fetchAsset(umi, assetAddress)
const delegateSigner = generateSigner(umi)
await freezeAsset(umi, {
asset: assetAccount,
delegate: delegateSigner.publicKey,
authority: delegateSigner,
}).sendAndConfirm(umi)

解冻已冻结的Asset

thawAsset命令解冻已冻结的Asset,恢复其转移和销毁的能力。

解冻MPL Core Asset

import { publicKey } from '@metaplex-foundation/umi'
import { thawAsset, fetchAsset } from '@metaplex-foundation/mpl-core'
const assetAddress = publicKey('11111111111111111111111111111111')
const assetAccount = await fetchAsset(umi, assetAddress)
const delegateSigner = generateSigner(umi)
await thawAsset(umi, {
asset: assetAccount,
delegate: delegateSigner,
}).sendAndConfirm(umi)

常见错误

Asset is frozen

您尝试转移或销毁已冻结的Asset。冻结authority必须先解冻它。

Authority mismatch

只有冻结委托authority才能冻结/解冻Asset。检查谁拥有插件authority。

Plugin not found

Asset没有冻结委托插件。请先使用addPlugin添加它。

注意事项

  • Owner管理:需要所有者签名才能添加
  • Authority在Asset转移时自动撤销
  • 冻结的Asset仍然可以更新(允许元数据更改)
  • 如果您需要authority在转移后仍然保持,请使用永久冻结委托
  • 冻结是即时的 - 没有确认期

快速参考

冻结状态

状态可以转移可以销毁可以更新
未冻结
已冻结

Authority行为

事件Authority结果
Asset转移Authority被撤销
插件被移除Authority消失
解冻Authority保留

常见问题

我可以冻结不属于我的Asset吗?

不可以。冻结委托是Owner管理的,只有所有者才能添加它。添加后,您可以将authority委托给另一个地址。

冻结委托和永久冻结委托有什么区别?

冻结委托的authority在转移时会被撤销。永久冻结委托的authority永久存在,且只能在创建时添加。

冻结的Asset可以被销毁吗?

不可以。冻结的Asset会阻止转移和销毁。如果您想销毁它,请先解冻Asset。

我可以一次冻结整个Collection吗?

使用普通冻结委托不可以(仅限Asset)。请改用Collection上的永久冻结委托 - 它支持Collection级别的冻结,可以一次冻结该Collection中的所有Asset。请注意,永久冻结委托只能在Collection创建时添加。

冻结会影响元数据更新吗?

不会。Asset所有者或update authority仍然可以在冻结状态下更新元数据(名称、URI)。只有转移和销毁会被阻止。

如何实现无托管质押?

  1. 将冻结委托插件添加为您的质押程序作为authority
  2. 当用户质押时:冻结Asset
  3. 当用户取消质押时:解冻Asset
  4. NFT永远不会离开用户的钱包

相关插件

术语表

术语定义
冻结委托Owner管理的插件,阻止转移和销毁
已冻结转移和销毁被阻止的Asset状态
解冻取消冻结Asset以允许再次转移
委托Authority被授权冻结/解冻Asset的账户
无托管无需转移到持有账户即可质押/上架
Owner管理需要所有者签名才能添加的插件类型