diff --git a/docs/concepts/tokens/nfts/dynamic-nfts.md b/docs/concepts/tokens/nfts/dynamic-nfts.md new file mode 100644 index 0000000000..c2f2cf79dc --- /dev/null +++ b/docs/concepts/tokens/nfts/dynamic-nfts.md @@ -0,0 +1,32 @@ +--- +seo: + description: Create NFTs with the option of changing the URI to update its referenced data object. +labels: + - Non-fungible Tokens, NFTs +--- + +# Dynamic Non-Fungible Tokens (dNFTs) + +Standard NFTs are immutable. Some use cases would benefit from the capability to update the referenced data object after the initial minting of an NFT. For example, a concert ticket for a postponed event could be updated with an alternate date, or a virtual trading card for an athlete could be periodically updated with current statistics. Dynamic Non-Fungible Tokens (dNFTs) provide the flexibility required for these use cases. + +## Creating a dNFT + +When minting a new NFT, set the `tfMutable` flag (`0x00000010`) to enable the ability to update the NFT's `URI` field. + +## Modifying a dNFT + +Use the `NFTokenModify` transaction to update the URI field of a dNFT. Provide the `Account` of the issuer or an authorized minter, the `Owner` of the dNFT, the `NFTokenID`, and the `URI` to the new object data. + +### Sample NFTokenModify Transaction + +```json +{ + "TransactionType": "NFTokenModify", + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Owner": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Sequence": 33, + “NFTokenID”: “0008C350C182B4F213B82CCFA4C6F59AD76F0AFCFBDF04D5A048C0A300000007", + "URI": "697066733A2F2F62616679626569636D6E73347A736F6C686C6976346C746D6E356B697062776373637134616C70736D6C6179696970666B73746B736D3472746B652F5665742E706E67", + } +``` \ No newline at end of file diff --git a/docs/references/protocol/transactions/types/nftokenmint.md b/docs/references/protocol/transactions/types/nftokenmint.md index f91028798f..377689f527 100644 --- a/docs/references/protocol/transactions/types/nftokenmint.md +++ b/docs/references/protocol/transactions/types/nftokenmint.md @@ -1,6 +1,4 @@ --- -html: nftokenmint.html -parent: transaction-types.html seo: description: Use TokenMint to issue new NFTs. labels: @@ -62,6 +60,7 @@ Transactions of the NFTokenMint type support additional values in the [`Flags` f | `tfOnlyXRP` | `0x00000002` | 2 | The minted `NFToken` can only be bought or sold for XRP. This can be desirable if the token has a transfer fee and the issuer does not want to receive fees in non-XRP currencies. | | `tfTrustLine` | `0x00000004` | 4 | **DEPRECATED** Automatically create [trust lines](../../../../concepts/tokens/fungible-tokens/index.md) from the issuer to hold transfer fees received from transferring the minted `NFToken`. The [fixRemoveNFTokenAutoTrustLine amendment][] makes it invalid to set this flag. | | `tfTransferable` | `0x00000008` | 8 | The minted `NFToken` can be transferred to others. If this flag is _not_ enabled, the token can still be transferred _from_ or _to_ the issuer, but a transfer to the issuer must be made based on a buy offer from the issuer and not a sell offer from the NFT holder. | +| `tfMutable` | `0x00000010` | 16 | The `URI` field of the minted `NFToken` can be updated using the `NFTokenModify` transaction. | ## Embedding additional information diff --git a/docs/references/protocol/transactions/types/nftokenmodify.md b/docs/references/protocol/transactions/types/nftokenmodify.md new file mode 100644 index 0000000000..ee2e01fc4a --- /dev/null +++ b/docs/references/protocol/transactions/types/nftokenmodify.md @@ -0,0 +1,39 @@ +--- +seo: + description: Modify a dynamic NFT. +labels: + - Non-fungible Tokens, NFTs +title: + - NFTokenModify +--- +# NFTokenModify +[[Source]](https://github.com/XRPLF/rippled/blob/master/src/xrpld/app/tx/detail/NFTokenMint.cpp "Source") + +`NFTokenModify` is used to change the `URI` field of an NFT to point to a different URI in order to update the supporting data for the NFT. The NFT must have been minted with the `tfMutable` flag set. See [Dynamic Non-Fungible Tokens](../../../../concepts/tokens/nfts/dynamic-nfts.md). + +## Example {% $frontmatter.seo.title %} JSON + + +```json +{ + "TransactionType": "NFTokenModify", + "Account": "rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh", + "Owner": "rogue5HnPRSszD9CWGSUz8UGHMVwSSKF6", + "Fee": "10", + "Sequence": 33, + “NFTokenID”: “0008C350C182B4F213B82CCFA4C6F59AD76F0AFCFBDF04D5A048C0A300000007", + "URI": "697066733A2F2F62616679626569636D6E73347A736F6C686C6976346C746D6E356B697062776373637134616C70736D6C6179696970666B73746B736D3472746B652F5665742E706E67" + } +``` + +{% raw-partial file="/docs/_snippets/tx-fields-intro.md" /%} + +| Field | JSON Type | [Internal Type][] | Description | +|:------------------|:--------------------|:------------------|:-------------------| +| `TransactionType` | String | UINT16 | Type is `NFTokenModify`. | +| `Account` | String | AccountID | The unique address of either the issuer or an authorized minter of the NFT. | +| `Owner` | String | AccountID | Address of the owner of the NFT. | +| `NFTokenID` | String | Hash 256 | Composite field that uniquely identifies the token. | +| `URI` | String | Blob | _(Optional)_ Up to 256 bytes of arbitrary data. In JSON, this should be encoded as a string of hexadecimal. You can use the [`xrpl.convertStringToHex`](https://js.xrpl.org/modules.html#convertStringToHex) utility to convert a URI to its hexadecimal equivalent. This is intended to be a URI that points to the data or metadata associated with the NFT. The contents could decode to an HTTP or HTTPS URL, an IPFS URI, a magnet link, immediate data encoded as an [RFC 2379 "data" URL](https://datatracker.ietf.org/doc/html/rfc2397), or even an issuer-specific encoding. The URI is not checked for validity. | + +{% raw-partial file="/docs/_snippets/common-links.md" /%} diff --git a/sidebars.yaml b/sidebars.yaml index 4c6084c22c..3a4903bd0b 100644 --- a/sidebars.yaml +++ b/sidebars.yaml @@ -134,6 +134,7 @@ - page: docs/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md - page: docs/concepts/tokens/nfts/nft-apis.md - page: docs/concepts/tokens/nfts/non-transferable-tokens.md + - page: docs/concepts/tokens/nfts/dynamic-nfts.md - page: docs/concepts/tokens/transfer-fees.md - page: docs/concepts/tokens/decentralized-exchange/index.md expanded: false @@ -387,6 +388,7 @@ - page: docs/references/protocol/transactions/types/nftokencanceloffer.md - page: docs/references/protocol/transactions/types/nftokencreateoffer.md - page: docs/references/protocol/transactions/types/nftokenmint.md + - page: docs/references/protocol/transactions/types/nftokenmodify.md - page: docs/references/protocol/transactions/types/offercancel.md - page: docs/references/protocol/transactions/types/offercreate.md - page: docs/references/protocol/transactions/types/oracledelete.md