申し訳ありませんが、このページはお使いの言語では提供されていません。

XRP Ledger Dev Portalをさまざまな言語で提供するよう取り組んでいますが、すべてのページがすべての言語で提供されているわけではありません。ご協力いただける場合は、ぜひ貢献をお願いいたします

NFTokenMint

[Source] The XLS-20 standard for NFTs has a preliminary implementation that can be used in test networks, but is not yet available as an amendment to the XRP Ledger protocol. An amendment may be included in a future XRP Ledger release.

The NFTokenMint transaction creates a NFToken and adds it to the relevant NFTokenPage object of the NFTokenMinter as a NFToken object. A required parameter to this transaction is the Token field specifying the actual token. This transaction is the only opportunity the NFTokenMinter has to specify any token fields that are defined as immutable (for example, the Flags).

If the transaction is successful, the newly minted token is owned by the account (the minter account) that executed the transaction. If needed, the server creates a new NFTokenPage for the account and applies a reserve charge.

Example NFTokenMint JSON

{
  "TransactionType": "NFTokenMint",
  "Account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
  "Issuer": "rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2",
  "TransferFee": 314,
  "NFTokenTaxon": 0,
  "Flags": 8,
  "Fee": 10,
  "URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
  "Memos": [
        {
            "Memo": {
                "MemoType":
                  "687474703A2F2F6578616D706C652E636F6D2F6D656D6F2F67656E65726963",
                "MemoData": "72656E74"
            }
        }
    ]
}

This transaction assumes that the issuer, rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2, has set the NFTokenMinter field in its AccountRoot to rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B, thereby authorizing that account to mint tokens on its behalf.

NFTokenMint Fields

In addition to the common fields, a NFTokenMint transaction uses the following fields:

Field JSON Type Internal Type Description
NFTokenTaxon Number UInt32 The taxon associated with the token. The taxon is generally a value chosen by the minter of the token. A given taxon can be used for multiple tokens. Taxon identifiers greater than 0xFFFF'FFFF are disallowed.
Issuer String AccountID (Optional) The issuer of the token, if the sender of the account is issuing it on behalf of another account. This field must be omitted if the account sending the transaction is the issuer of the NFToken. If provided, the issuer's AccountRoot object must have the NFTokenMinter field set to the sender of this transaction (this transaction's Account field).
TransferFee Number UInt16 (Optional) The value specifies the fee charged by the issuer for secondary sales of the NFToken, if such sales are allowed. Valid values for this field are between 0 and 9999 inclusive, allowing transfer rates of between 0.00% and 99.99% in increments of 0.01. If this field is provided, the transaction MUST have the tfTransferable flag enabled.
URI String Blob (Optional) Up to 256 bytes of arbitrary data. In JSON, this should be encoded as a string of hexadecimal. The hex must be capitalized, not lowercase. You can use the xrpl.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 NFToken. The contents could decode to an HTTP or HTTPS URL, an IPFS URI, a magnet link, immediate data encoded as an RFC2379 "data" URL , or even an issuer-specific encoding. The URI is NOT checked for validity.

NFTokenMint Flags

Transactions of the NFTokenMint type support additional values in the Flags field, as follows:

Flag Name Hex Value Decimal Value Description
tfBurnable 0x00000001 1 Allow the issuer (or an entity authorized by the issuer) to destroy the minted NFToken. (The NFToken's owner can always do so.)
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 Automatically create trust lines from the issuer to hold transfer fees received from transferring the minted NFToken.
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.

Embedding additional information

If you need to specify additional information during minting (for example, details identifying a property by referencing a particular plat , a vehicle by specifying a VIN , or other object-specific descriptions) you can use a transaction memo. Memos are a part of the signed transaction and are available from historical archives, but are not stored in the ledger's state data.

Issuing on behalf of another account

If you want to issue an NFT for another account there are two things you must do. Given that Account A is your account and Account B is the account for which you want to mint a NFToken:

  1. Set the NFTokenMinter account setting on Account B to be Account A. (This says that Account B trusts Account A to create NFTs on their behalf.)
  2. When you mint the NFToken, set the Issuer field to Account B.

Example of NFTokenMint with an issuer

{
  "TransactionType": "NFTokenMint",
  "Account": "rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B",
  "Issuer": "rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2",
  "TransferFee": 314,
  "NFTokenTaxon": 0,
  "Flags": 8,
  "Fee": 10,
  "URI": "697066733A2F2F62616679626569676479727A74357366703775646D37687537367568377932366E6634646675796C71616266336F636C67747179353566627A6469",
  "Memos": [
        {
            "Memo": {
                "MemoType":
                  "687474703A2F2F6578616D706C652E636F6D2F6D656D6F2F67656E65726963",
                "MemoData": "72656E74"
            }
        }
    ]
}

This transaction assumes that the issuer, rNCFjv8Ek5oDrNiMJ3pw6eLLFtMjZLJnf2, has set the NFTokenMinter field in its AccountRoot to rvYAfWj5gh67oV6fW32ZzP3Aw4Eubs59B, thereby authorizing that account to mint tokens on its behalf.

Error Cases

  • If the TransferFee field is not within the acceptable range (0 to 9999 inclusive) the transaction fails with temBAD_NFTOKEN_TRANSFER_FEE.
  • If the URI field is longer than 256 bytes, the transaction fails with temMALFORMED.
  • If the Issuer field refers to an account that does not exist, the transaction fails with tecNO_ISSUER.
  • If account referenced by the Issuer field has not authorized this transaction's sender (using the NFTokenMinter setting) to mint NFTokens on their behalf, the transaction fails with tecNO_PERMISSION.
  • If the owner would not meet the updated reserve requirement after minting the token, the transaction fails with tecINSUFFICIENT_RESERVE. Note that new NFTokens only increase the owner's reserve if it requires a new NFTokenPage object, which can each hold up to 32 NFTokens.
  • If the Issuer's MintedNFTokens field maxes out, the transaction fails with tecMAX_SEQUENCE_REACHED. This is only possible if 232-1 NFTokens have been minted in total by the issuer or on their behalf.