From d56ec59845ced5bb423f56ddfd9ccd9332364ee6 Mon Sep 17 00:00:00 2001 From: Filippo Date: Thu, 16 Feb 2023 16:03:39 +0100 Subject: [PATCH 01/10] Removed content requested by Jegor --- docs/learn/learn-nft-pallets.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index cac6414ff0f7..f4510a7cd89a 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -174,8 +174,7 @@ user will not have to worry about all technicalities. that gets updated over time (sort of a rank) with a consequent upgrade in membership permissions. - A collection is managed by the [Issuer, the Admin and the Freezer](./learn-assets.md#creation-and-management). Those roles can be - changed anytime, and there will be the option to attach - [multiple accounts per role](https://github.com/paritytech/substrate/pull/12437). + changed anytime. - Setting metadata for an item or collection (metadata includes all essential information about the item or the collection). Metadata could consist of any arbitrary data like the IPFS hash. - Setting or re-setting the price of an item. From f11150481afffe14431f504dabf136f42f9dd7ab Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Tue, 14 Mar 2023 14:43:05 +0100 Subject: [PATCH 02/10] added more info provided by Jegor --- docs/learn/learn-nft-pallets.md | 40 +++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index f4510a7cd89a..956e346d5051 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -26,6 +26,46 @@ The pallet comes with a new way to configure NFTs, as well as configure collecti Pallet-level [feature flags](https://github.com/paritytech/substrate/pull/12367) allow disabling functionalities that are not needed in the runtime. +### Roles + +Setting up a collection implies different roles with different permissions: + +- Owner: + + - destroy collection (to destroy the collection, there should be 0 items left) + - redeposit + - set_team: + - set_collection_max_supply + - lock_collection - (make non-transferable, fix max supply, lock collection metadata/attributes) + -> one time call + +- Admin: + - set_attribute/set_metadata (in the CollectionOwner namespace) + - set_attributes_pre_signed + - lock_item_properties - (lock item metadata/attributes) -> one time call + +Note that an Admin account cannot burn or transfer items it does not own. + +- Freezer: + + - lock_item_transfer + - unlock_item_transfer + +- Issuer + - mint + - force_mint (with custom item config) + - mint_pre_signed + - update_mint_settings + +For simple collections, the same account has all the roles by default, but for complex collections +each role can be taken by separate accounts with their own responsibilities (e.g. items issuance). +Key can be simply rotated for those roles. The owner's account is used to setup the collection, and +its private key is kept in cold storage. + +Those roles can also be set to `none` without the ability to change them back. This is useful when a +collection is created and all the items are minted without the possibility to mint any more items, +or change the metadata, or disable some item's transfer. + ### Creating a Collection You can use the NFTs pallet to create NFT collections. In the Polkadot-JS UI, go to Developer > From 15b7620e090ba79413a007577b4d4de66d41095d Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Wed, 15 Mar 2023 09:55:27 +0100 Subject: [PATCH 03/10] added more detailed info --- docs/learn/learn-nft-pallets.md | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index 956e346d5051..c3ebbfdd1e30 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -32,30 +32,31 @@ Setting up a collection implies different roles with different permissions: - Owner: - - destroy collection (to destroy the collection, there should be 0 items left) - - redeposit - - set_team: - - set_collection_max_supply - - lock_collection - (make non-transferable, fix max supply, lock collection metadata/attributes) - -> one time call + - destroy collection (to destroy the collection, there should be 0 items left). + - redeposit: re-evaluate the deposit on some items. + - set team: change the Issuer, Admin, Freezer of a collection. + - set collection max supply: set the maximum number of items for a collection. + - lock collection: this can include making the items of a collection non-transferable, fix its max + supply, lock collection metadata and attributes. - Admin: - - set_attribute/set_metadata (in the CollectionOwner namespace) - - set_attributes_pre_signed - - lock_item_properties - (lock item metadata/attributes) -> one time call + - set attribute and metadata of a collection. + - set attributes pre-signed: set attributes for an item by providing the pre-signed approval. + - lock item properties: lock item metadata and/or attributes. Note that an Admin account cannot burn or transfer items it does not own. - Freezer: - - lock_item_transfer - - unlock_item_transfer + - lock item transfer: lock the possibility to transfer an item for all holders. + - unlock item transfer: lift a previous lock to transfer an item for all holders. - Issuer - mint - - force_mint (with custom item config) - - mint_pre_signed - - update_mint_settings + - force mint (with custom item config): mint an item of a particular collection from a privileged + origin. + - mint pre-signed: mint an item by providing the pre-signed approval. + - update mint settings. For simple collections, the same account has all the roles by default, but for complex collections each role can be taken by separate accounts with their own responsibilities (e.g. items issuance). From 24621600e8c7046e407e2f99e5693ccf209c3025 Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Wed, 15 Mar 2023 09:56:45 +0100 Subject: [PATCH 04/10] minor edits --- docs/learn/learn-nft-pallets.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index c3ebbfdd1e30..a429884df462 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -44,7 +44,7 @@ Setting up a collection implies different roles with different permissions: - set attributes pre-signed: set attributes for an item by providing the pre-signed approval. - lock item properties: lock item metadata and/or attributes. -Note that an Admin account cannot burn or transfer items it does not own. +:::info Note that an Admin account cannot burn or transfer items it does not own. ::: - Freezer: @@ -53,8 +53,8 @@ Note that an Admin account cannot burn or transfer items it does not own. - Issuer - mint - - force mint (with custom item config): mint an item of a particular collection from a privileged - origin. + - force mint (with custom item configuration): mint an item of a particular collection from a + privileged origin. - mint pre-signed: mint an item by providing the pre-signed approval. - update mint settings. From 7d5de68fdda9981db2b9ccdf442abb51bd8792a9 Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Wed, 15 Mar 2023 10:03:54 +0100 Subject: [PATCH 05/10] grammar check --- docs/learn/learn-nft-pallets.md | 50 ++++++++++++++++----------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index a429884df462..e029a2dd1fc7 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -24,7 +24,7 @@ on Westmint, which provides a multitude of functions to interact with NFTs. The pallet comes with a new way to configure NFTs, as well as configure collections and items. Pallet-level [feature flags](https://github.com/paritytech/substrate/pull/12367) allow disabling -functionalities that are not needed in the runtime. +functionalities not needed in the runtime. ### Roles @@ -34,21 +34,21 @@ Setting up a collection implies different roles with different permissions: - destroy collection (to destroy the collection, there should be 0 items left). - redeposit: re-evaluate the deposit on some items. - - set team: change the Issuer, Admin, Freezer of a collection. + - set team: change the collection’s Issuer, Admin, Freezer. - set collection max supply: set the maximum number of items for a collection. - - lock collection: this can include making the items of a collection non-transferable, fix its max - supply, lock collection metadata and attributes. + - lock collection: this can include making a collection’s items non-transferable, fixing its max + supply, and locking collection metadata and attributes. - Admin: - set attribute and metadata of a collection. - set attributes pre-signed: set attributes for an item by providing the pre-signed approval. - - lock item properties: lock item metadata and/or attributes. + - lock item properties: lock item metadata and attributes. :::info Note that an Admin account cannot burn or transfer items it does not own. ::: - Freezer: - - lock item transfer: lock the possibility to transfer an item for all holders. + - lock item transfer: lock the possibility of transferring an item for all holders. - unlock item transfer: lift a previous lock to transfer an item for all holders. - Issuer @@ -58,14 +58,14 @@ Setting up a collection implies different roles with different permissions: - mint pre-signed: mint an item by providing the pre-signed approval. - update mint settings. -For simple collections, the same account has all the roles by default, but for complex collections -each role can be taken by separate accounts with their own responsibilities (e.g. items issuance). -Key can be simply rotated for those roles. The owner's account is used to setup the collection, and -its private key is kept in cold storage. +For simple collections, the same account has all the roles by default. Still, for complex +collections separate accounts can take each role with their responsibilities (e.g. items issuance). +The key can be rotated for those roles. The owner's account is used to setup the collection, and its +private key is kept in cold storage. Those roles can also be set to `none` without the ability to change them back. This is useful when a -collection is created and all the items are minted without the possibility to mint any more items, -or change the metadata, or disable some item's transfer. +collection is created, and all the items are minted without the possibility of minting any more +items, or change the metadata, or disable some item's transfer. ### Creating a Collection @@ -113,9 +113,9 @@ Everything is unlocked by default (bitflag value `0`). :::info -Metadata, attributes, and settings of an item or collection can be locked. The user can decide what -to lock. Also, unauthorized and/or unprivileged transfers can be prevented by locking mechanism -(unprivileged actions can be re-allowed anytime). +An item or collection’s metadata, attributes, and settings can be locked. The user can decide what +to lock. Also, a locking mechanism can prevent unauthorized and unprivileged transfers (unprivileged +actions can be re-allowed anytime). ::: @@ -151,8 +151,8 @@ go to Developer > Chain State > Storage, select the `nfts.account` extrinsic, an account owning the NFT and the collection ID. You can also see all your collections by selecting the `collectionAccount` extrinsic. -When a new collection is created, a new ID will be generated and assigned to that collection. When a -collection is destroyed, no one can pick up the collection ID again (including the owner). +When a new collection is created, a new ID will be generated and assigned to it. When a collection +is destroyed, and no one can pick up the collection ID again (including the owner). ### Minting an NFT @@ -175,8 +175,8 @@ When you have a collection ID and an item ID you need to: to upload the file you want to mint. - After uploading your file, get the [Content Identifier (CID)](https://docs.ipfs.tech/concepts/content-addressing/#what-is-a-cid). - This is a unique string of letters and numbers that will act as a marker to link the data uploaded - onto [IPFS](https://ipfs.tech/#how) to the collection or item ID you own. + This unique string of letters and numbers will act as a marker to link the data uploaded onto + [IPFS](https://ipfs.tech/#how) to the collection or item ID you own. - Prepare the metadata file and add your CID (see below): ``` @@ -188,14 +188,14 @@ When you have a collection ID and an item ID you need to: ``` - Upload the metadata file to Pinata and get the updated CID. -- You can add the CID after minting your NFT on the Polkadot-JS UI. Go to Developer > Extrinsics and - select the `nfts.setCollectionMetadata` (for collections) or `nfts.setMetadata` (for single NFTs) - extrinsic. Under the `data: Bytes` field you can enter the CID or upload the metadata file. +- After minting your NFT on the Polkadot-JS UI, you can add the CID. Go to Developer > Extrinsics + and select the `nfts.setCollectionMetadata` (for collections) or `nfts.setMetadata` (for single + NFTs) extrinsic. Under the `data: Bytes` field you can enter the CID or upload the metadata file. The collection can be created and its item minted before uploading the NFT file and related metadata. The minting process on-chain will assign a collection and item ID to your account. Those IDs will later be populated with NFT files, metadata, and attributes. Once you upload the NFT files -and related data, the extrinsics mentioned above can be used to update a collection or item. +and related data, the abovementioned extrinsics can be used to update a collection or item. :::info NFT/DEX/Asset Portal @@ -214,8 +214,8 @@ user will not have to worry about all technicalities. attributes of an NFT. An example could be that all Polkadot fellowship members have an NFT badge that gets updated over time (sort of a rank) with a consequent upgrade in membership permissions. - A collection is managed by the - [Issuer, the Admin and the Freezer](./learn-assets.md#creation-and-management). Those roles can be - changed anytime. + [Issuer, the Admin, and the Freezer](./learn-assets.md#creation-and-management). Those roles can + be changed anytime. - Setting metadata for an item or collection (metadata includes all essential information about the item or the collection). Metadata could consist of any arbitrary data like the IPFS hash. - Setting or re-setting the price of an item. From 90e4ddb8875f9c7529f0e03b95629dd91799f3b2 Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Wed, 15 Mar 2023 10:04:50 +0100 Subject: [PATCH 06/10] minor fix banner From 3c5cf1a9f916c98ceb9d6cae2a0e2a4a109b8269 Mon Sep 17 00:00:00 2001 From: filippoweb3 Date: Wed, 15 Mar 2023 10:05:22 +0100 Subject: [PATCH 07/10] bug fix prettier banner --- docs/learn/learn-nft-pallets.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index e029a2dd1fc7..91376683e1c9 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -44,7 +44,11 @@ Setting up a collection implies different roles with different permissions: - set attributes pre-signed: set attributes for an item by providing the pre-signed approval. - lock item properties: lock item metadata and attributes. -:::info Note that an Admin account cannot burn or transfer items it does not own. ::: +:::info + +Note that an Admin account cannot burn or transfer items it does not own. + +::: - Freezer: From 0d98e5cd039acb4360fd6944f0ad268eddd77af5 Mon Sep 17 00:00:00 2001 From: Filippo <110459737+filippoweb3@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:05:40 +0100 Subject: [PATCH 08/10] Update docs/learn/learn-nft-pallets.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> --- docs/learn/learn-nft-pallets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index 91376683e1c9..a6d1c33e53a8 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -52,7 +52,7 @@ Note that an Admin account cannot burn or transfer items it does not own. - Freezer: - - lock item transfer: lock the possibility of transferring an item for all holders. + - lock item transfer: lock all holders from the possibility of transferring an item. - unlock item transfer: lift a previous lock to transfer an item for all holders. - Issuer From c0dfef575e722e8e87998bac8287250ded51e3ca Mon Sep 17 00:00:00 2001 From: Filippo <110459737+filippoweb3@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:06:03 +0100 Subject: [PATCH 09/10] Update docs/learn/learn-nft-pallets.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> --- docs/learn/learn-nft-pallets.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index a6d1c33e53a8..7c5839f7f771 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -117,8 +117,7 @@ Everything is unlocked by default (bitflag value `0`). :::info -An item or collection’s metadata, attributes, and settings can be locked. The user can decide what -to lock. Also, a locking mechanism can prevent unauthorized and unprivileged transfers (unprivileged + The user can decide to lock an item or collection’s metadata, attributes, and settings. Also, a locking mechanism can prevent unauthorized and unprivileged transfers (unprivileged actions can be re-allowed anytime). ::: From 1a5c1f706a7b005a2de2f6fdbee8373bdddca334 Mon Sep 17 00:00:00 2001 From: Filippo <110459737+filippoweb3@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:06:11 +0100 Subject: [PATCH 10/10] Update docs/learn/learn-nft-pallets.md Co-authored-by: Radha <86818441+DrW3RK@users.noreply.github.com> --- docs/learn/learn-nft-pallets.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/learn/learn-nft-pallets.md b/docs/learn/learn-nft-pallets.md index 7c5839f7f771..0398ca2262c6 100644 --- a/docs/learn/learn-nft-pallets.md +++ b/docs/learn/learn-nft-pallets.md @@ -198,7 +198,7 @@ When you have a collection ID and an item ID you need to: The collection can be created and its item minted before uploading the NFT file and related metadata. The minting process on-chain will assign a collection and item ID to your account. Those IDs will later be populated with NFT files, metadata, and attributes. Once you upload the NFT files -and related data, the abovementioned extrinsics can be used to update a collection or item. +and related data, the above-mentioned extrinsics can be used to update a collection or item. :::info NFT/DEX/Asset Portal