Plugins

Plugins Overview

Lifecycles

During a Core Assets lifecycle, multiple events can be triggered such as:

  • Creating
  • Transferring
  • Updating
  • Burning
  • Add Plugin
  • Approve Authority Plugin
  • Remove Authority Plugin

Lifecycle events impact the Asset in various ways from creating, to transfers between wallets, all the way through to the Assets destruction. Plugins attached an Asset level or a Collection level will run through a validation process during these lifecycle events to either approve, reject, or force approve the event from execution.

What are Plugins?

A plugin is like an onchain app for your NFT that can either store data or provide additional functionality to the asset.

Types of Plugins

Owner Managed Plugins

Owner managed plugins are plugins that can only be added to an Core Asset if the Asset owner's signature is present in the transaction.

Owner Managed Plugins include but are not limited to:

If an Owner Managed plugin is added to an Asset/Collection without an authority set it will default the authority type to the type of owner.

The authority of owner managed plugins is automatically revoked when they are transferred.

Authority Managed Plugins

Authority managed plugins are plugins that the authority of the MPL Core Asset or Core Collection can add and update at any time.

Authority manages plugins include but are not limited to:

If an Authority Managed plugin is added to an Asset/Collection without an authority argument present then the plugin will default to the authority type of update authority.

Permanent Plugins

Permanent plugins are plugins that may only be added to a Core Asset at the time of creation. If an Asset already exists then Permanent Plugins cannot be added.

Permanent Plugins include but are not limited to:

If an Permanent Plugin is added to an Asset/Collection without an authority set it will default the authority type to the type of update authority.

Collection Plugins

Collection Plugins are plugins that are added at the collection level can have a collection-wide effect. This is particularly useful for royalties because you can assign the royalties plugin to the Collection Asset and all Assets in that collection will now reference that plugin.

Collections only have access to Permanent Plugins and Authority Managed Plugins.

Plugin Priority

If an MPL Core Asset and MPL Core Collection Asset both share the same plugin type then the Asset level plugin and its data will take precedence over the Collection level plugin.

This can be used in creative ways like setting royalties at different levels for a collection of assets.

  • Collection Asset has a Royalties Plugin assigned at 2%
  • A Super Rare MPL Core Asset within the collection has a Royalty Plugin assigned at 5%

In the above case, regular MPL Core Asset sales from the collection will retain a 2% royalty while the Super Rare MPL Core Asset will retain a 5% royalty at sale because it has it's own Royalties Plugin that takes precedence over the Collection Asset Royalties Plugin.

Plugin Table

Plugins and Lifecycle Events

Plugins in MPL Core have the ability to affect the outcome of certain lifecycle actions such as Create, Transfer, Burn, and Update.

Each plugin has the ability to to reject, approve, or force approve an action to a desired outcome.

During lifecycle events the action will work its way down a list of predefined plugins checking and validating against them. If the plugins conditions are validated the lifecycle passes and continues its action.

If a plugin validation fails then the lifecycle will be halted and rejected.

The rules for plugin validation are as follows in this hierarchy of conditions;

  • If there is force approve, always approve
  • Else if there is any reject, reject
  • Else if there is any approve, approve
  • Else reject

The force approve validation is only available on 1st party plugins and on Permanent Delegate plugins.

Force Approve

Force approve is the first check made when checking a plugins validations. The plugins which will force approve validations currently are:

  • Permanent Transfer
  • Pernament Burn
  • Permanent Freeze

These plugins will take precedence with their actions over their non permanent counterparts and other plugins.

Example

If you have an Asset frozen at Asset level with a Freeze Plugin while simultaneously have a Permanent Burn plugin on the Asset, even if the Asset is frozen the burn procedure called via the Pernament Burn plugin with still execute due to the forceApprove nature of permanent plugins.

Create

PluginActionConditions
RoyaltiesCan RejectRuleset

Update

Update currently has no plugin conditions or validations.

Transfer

PluginActionConditions
RoyaltiesCan RejectRuleset
Freeze DelegateCan RejectisFrozen
Transfer DelegateCan ApproveisAuthority
Permanent Freeze DelegateCan RejectisFrozen
Permanent Transfer DelegateCan ApproveisAuthority

Burn

PluginActionConditions
Freeze DelegateCan RejectisFrozen
Burn DelegateCan RejectisAuthority
Permanent Freeze DelegateCan RejectisFrozen
Permanent Burn DelegateCan ApproveisAuthority

Add Plugin

PluginActionConditions
RoyaltiesCan RejectRuleset
Update DelegateCan ApproveisAuthority

Remove Plugin

PluginActionConditions
RoyaltiesCan RejectRuleset
Update DelegateCan ApproveisAuthority

Approve Plugin Authority

Approve currently has no plugin conditions or validations.

Revoke Authority Plugin

Revoke currently has no plugin conditions or validations.

Previous
Deserializing Assets