mirror of
https://github.com/XRPLF/xrpl-dev-portal.git
synced 2025-11-27 23:25:51 +00:00
Reorg tokens & stablecoin use case
wip fix links fix 2 links trim and add topics Add checklist, rename sc subtopics Fix internal links Add DEX/AMM Add graphics reorg files reorg/rename Fix blurb Remove old JA files edits per review review changes rename output file name of index files to match the folder name Update output file and parent filenames add reusable links snippet fix broken links Update Ja file Move path.md to same location in i18n folder Revert naming for nft-collections page Rename to match files in En and Ja update links to reflect updated file name Rename nft-auctions under Ja folder and update links throughout Rename nftoken-authorized-minting and update links throughout Fix links Rename the nft-fixed-supply Ja file to match the reorg in English and update links Move nft-reserve-requirements file in Ja and update links Fix some more broken links Fix more broken links by renaming html files back Stablecoin reorg: fix various issues Remove nfts_by_issuer method (unreleased) page Remove redundant parent: attrs from config file Fix syntax highlighting of Authorizing Another Minter js Fix config/frontmatter errors
This commit is contained in:
59
content/concepts/tokens/nfts/authorizing-another-minter.md
Normal file
59
content/concepts/tokens/nfts/authorizing-another-minter.md
Normal file
@@ -0,0 +1,59 @@
|
||||
---
|
||||
html: nftoken-authorized-minting.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: You can assign another account to mint NFTs in your stead.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# Authorizing Another Minter
|
||||
|
||||
Each account can have 0 or 1 authorized minter that can mint NFTs on its behalf. By authorizing a minter, a creator can allow a different account to mint NFTs for them, which allows them to focus on making more NFTs.
|
||||
|
||||
## Assigning an Authorized Minter
|
||||
|
||||
You set the authorized minter with an `AccountSet` transaction.
|
||||
|
||||
```js
|
||||
tx_json = {
|
||||
"TransactionType": "AccountSet",
|
||||
"Account": "rrE5EgHN4DfjXhR9USecudHm7UyhTYq6m",
|
||||
"NFTokenMinter": "r3riWB2TDWRmwmT7FRKdRHjqm6efYu4s9C",
|
||||
"SetFlag": xrpl.AccountSetAsfFlags.asfAuthorizedNFTokenMinter
|
||||
}
|
||||
```
|
||||
|
||||
`NFTokenMinter` is an account ID of an account on the same XRP Ledger instance. The `asfAuthorizedNFTokenMinter` flag authorizes the `NFTokenMinter` account to mint NFTs on behalf of the `Account`.
|
||||
|
||||
*Note*: The `asfAuthorizedNFTokenMinter` flag is used only in the `AccountSet` transaction. It indicates whether the transaction affects the presence or value of the NFTokenMinter field on an account root. Specifically, there is no corresponding flag on the AccountRoot.
|
||||
|
||||
## Unassigning an Authorized Minter
|
||||
|
||||
To remove an authorized minter, use the `AccountSet` transaction and clear the `asfAuthorizedNFTokenMinter` flag.
|
||||
|
||||
```js
|
||||
tx_json = {
|
||||
"TransactionType": "AccountSet",
|
||||
"Account": "rrE5EgHN4DfjXhR9USecudHm7UyhTYq6m",
|
||||
"ClearFlag": xrpl.AccountSetAsfFlags.asfAuthorizedNFTokenMinter
|
||||
}
|
||||
```
|
||||
|
||||
## Minting an NFT for Another Account
|
||||
|
||||
You mint tokens for another account using the standard `NFTokenMint` transaction. The difference is that you must include the `Issuer` field, the account ID of the account for which you are minting the NFT.
|
||||
|
||||
```js
|
||||
const transactionBlob = {
|
||||
"TransactionType": "NFTokenMint",
|
||||
"Account": "r3riWB2TDWRmwmT7FRKdRHjqm6efYu4s9C",
|
||||
"URI": xrpl.convertStringToHex("ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf4dfuylqabf3oclgtqy55fbzdi"),
|
||||
"Flags": 8,
|
||||
"TransferFee": 5000,
|
||||
"NFTokenTaxon": 0,
|
||||
"Issuer": "rrE5EgHN4DfjXhR9USecudHm7UyhTYq6m", // Needed when minting for another
|
||||
// account.
|
||||
}
|
||||
```
|
||||
|
||||
When you or a broker sells the NFT, the TransferFee (percentage of sale) is credited to your issuing account.
|
||||
|
||||
39
content/concepts/tokens/nfts/batch-minting.md
Normal file
39
content/concepts/tokens/nfts/batch-minting.md
Normal file
@@ -0,0 +1,39 @@
|
||||
---
|
||||
html: nftoken-batch-minting.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Minting NFTs in batches.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
|
||||
# Batch Minting
|
||||
|
||||
There are two common approaches to minting NFTs in batches: mint on demand and scripted minting.
|
||||
|
||||
## Mint On Demand (Lazy Minting)
|
||||
|
||||
When using a mint on demand model, you and potential customers make buy or sell offers for initial sales of an NFT off the XRP Ledger. When you are ready to start the initial sale, you mint the token, create a sell offer or accept a buy offer, then complete the transaction.
|
||||
|
||||
### Benefits
|
||||
|
||||
* There is no reserve requirement for holding unsold NFTs.
|
||||
* You mint NFTs in real time when you know that it will sell. <!-- STYLE_OVERRIDE: will -->
|
||||
|
||||
### Downside
|
||||
|
||||
Any market activity before the initial sale of the NFT is not recorded on the XRP Ledger. This might not be an issue for some applications.
|
||||
|
||||
## Scripted Minting
|
||||
|
||||
Use a program or script to mint many tokens at once. You might find that [Tickets](tickets.html) help you submit transactions in parallel, up to a current limit of 200 transactions in one group.
|
||||
|
||||
For a practical example, see the [Batch Mint NFTs Using JavaScript](batch-mint-nfts-using-javascript.html) tutorial.
|
||||
|
||||
### Benefits
|
||||
|
||||
* NFTs are minted ahead of time.
|
||||
* Market activity for the initial sale of the NFT is captured on the ledger.
|
||||
|
||||
### Downside
|
||||
|
||||
You need to meet the [reserve requirement](reserves.html) for all of the NFTs you mint. As a rule of thumb, this is roughly 1/12th XRP per NFT at the current reserve rate. In the event that you do not have enough XRP in reserve, your mint transactions fail until you get more XRP.
|
||||
17
content/concepts/tokens/nfts/collections.md
Normal file
17
content/concepts/tokens/nfts/collections.md
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
html: nft-collections.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: You can mint NFTs as collections using the NFT Taxon field.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# Minting NFTs into Collections
|
||||
|
||||
You can use the `NFTokenTaxon` field to group NFTs into collections. As the minter, you can choose any numeric value from `0x0` to `0xFFFFFFFF`and assign it to NFTs as you create them. The significance of the taxon is entirely up to you.
|
||||
|
||||
For example, for your first collection, you might set the `NFTokenTaxon` to `1`. You might have a collection of NFTs with taxon values of `316`, `420`, or `911`. You might use taxons that start with a digit to indicate the type of NFT (for example, all Real Estate NFTs have a taxon that starts with `2`).
|
||||
|
||||
While the `NFTokenTaxon` field is required, you can set the value to `0` if you don't intend to create a collection.
|
||||
|
||||
See [NFTokenTaxon](nftoken.html#nftokentaxon).
|
||||
|
||||
22
content/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md
Normal file
22
content/concepts/tokens/nfts/guaranteeing-a-fixed-supply.md
Normal file
@@ -0,0 +1,22 @@
|
||||
---
|
||||
html: nft-fixed-supply.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Use a new account to mint a fixed number of NFTs, then black hole the account.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# Guaranteeing a Fixed Supply of NFTs
|
||||
|
||||
For some projects, you might want to guarantee that no more than a fixed number of NFTs are minted from an issuing account.
|
||||
|
||||
To guarantee a fixed number of NFTs:
|
||||
|
||||
1. Create and fund a new account, the _Issuer_. This account is the issuer of the tokens within the collection. See [Creating Accounts](accounts.html#creating-accounts).
|
||||
1. Use `AccountSet` to assign your operational wallet as an authorized minter for the issuer. See [Authorizing Another Account to Mint Your NFTs](nftoken-authorized-minting.html).
|
||||
1. Use your operational account to mint the tokens using `NFTokenMint`. The operational wallet holds all of the tokens minted for the Issuer. See [Batch Minting](nftoken-batch-minting.html).
|
||||
1. Use `AccountSet` to remove your operational wallet as an authorized minter for the Issuer.
|
||||
1. “Blackhole” the Issuer account. See [Disable Master Key Pair](disable-master-key-pair.html).
|
||||
|
||||
At this point, it is impossible for any new tokens to be minted with the issuer’s address as the issuing account.
|
||||
|
||||
**Caution** Once you "blackhole" the account, no one, including you, receives transfer fees for future sales of the NFTs.
|
||||
46
content/concepts/tokens/nfts/index.md
Normal file
46
content/concepts/tokens/nfts/index.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
html: non-fungible-tokens.html
|
||||
parent: tokens.html
|
||||
blurb: Introduction to XRPL NFTs.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
|
||||
# Non-Fungible Tokens
|
||||
|
||||
The XRP Ledger natively supports non-fungible tokens (NFTs, or “nifties” in the vernacular). Non-fungible tokens serve to encode ownership of unique physical, non-physical, or purely digital goods, such as works of art or in-game items.
|
||||
|
||||
_(Added by the [NonFungibleTokensV1_1 amendment][].)_
|
||||
|
||||
To represent digital assets similar to these, use the XRP Ledger's Non-Fungible Tokens feature (sometimes referred to by its standards draft number, [XLS-20](https://github.com/XRPLF/XRPL-Standards/discussions/46)).
|
||||
|
||||
## NFTs on the XRP Ledger
|
||||
|
||||
On the XRP Ledger, an NFT is represented as a [NFToken][] object. An NFT is a unique, indivisible unit that is not used for payments. Users can mint (create), hold, buy, sell, and burn (destroy) NFTs.
|
||||
|
||||
The ledger stores up to 32 NFTa owned by the same account in a single [NFTokenPage object][] to save space. As a result, the owner's [reserve requirement](reserves.html) for NFTs only increases when the ledger needs to make a new page to store additional tokens.
|
||||
|
||||
Accounts can also name a _Broker_ or an _Authorized Minter_ who can sell or mint NFTs on their behalf.
|
||||
|
||||
NFTs have several immutable settings that are defined when the token is minted. These include:
|
||||
|
||||
- Identifying data that uniquely defines the token.
|
||||
- Whether the issuer can burn the token, regardless of who currently holds it.
|
||||
- Whether the holder of the token can transfer it to others. (An NFT can always be sent to or from the issuer directly.)
|
||||
- If transfers are allowed, the issuer can charge a transfer fee as a percentage of the sale price.
|
||||
- Whether the holder can sell the NFT for [fungible token](trust-lines-and-issuing.html) amounts, or only for XRP.
|
||||
|
||||
## NFT Lifecycle
|
||||
|
||||
Anyone can create a new NFT using the [NFTokenMint transaction][]. The NFT lives on the [NFTokenPage object][] of the issuing account. Either the owner or an interested party can send a [NFTokenCreateOffer transaction][] to propose buying or selling the NFT; the ledger tracks the proposed transfer as a [NFTokenOffer object][], and deletes the `NFTokenOffer` when either side accepts or cancels the offer. If the NFT is transferable, it can be traded multiple times between accounts.
|
||||
|
||||
You can destroy an NFT you own using the [NFTokenBurn transaction][]. If the issuer minted the token with the `tfBurnable` flag enabled, the issuer can also burn the token, regardless of the current owner. (This could be useful, for example, for a token that represents a ticket to an event that is used up at some point.)
|
||||
|
||||

|
||||
|
||||
For more info about transferring NFTs, see [Trading NFTs on the XRP Ledger](non-fungible-token-transfers.html).
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
51
content/concepts/tokens/nfts/nft-apis.md
Normal file
51
content/concepts/tokens/nfts/nft-apis.md
Normal file
@@ -0,0 +1,51 @@
|
||||
---
|
||||
html: nft-apis.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Specialized APIs let you access useful NFT metadata.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# NFT APIs
|
||||
|
||||
This page lists the transactions and requests associated with NFTs as a handy reference.
|
||||
|
||||
## NFT Ledger Entries
|
||||
|
||||
- [NFToken][] data type - The NFT object stored on the ledger.
|
||||
- Ledger Entries
|
||||
- [NFTokenOffer entry][] - An offer to buy or sell an NFT.
|
||||
- [NFTokenPage entry][] - An NFT page holds a maximum of 32 NFTs. In practice, each NFT page typically holds 16-24 NFTs.
|
||||
|
||||
## NFT Transactions
|
||||
|
||||
- [NFTokenMint][] - Create an NFT.
|
||||
|
||||
- [NFTokenCreateOffer][] - Create an offer to buy or sell an NFT.
|
||||
|
||||
- [NFTokenCancelOffer][] - Cancel an offer to buy or sell an NFT.
|
||||
|
||||
- [NFTokenAcceptOffer][] - Accept an offer to buy or sell an NFT.
|
||||
|
||||
- [NFTokenBurn][] - Permanently destroy an NFT.
|
||||
|
||||
## NFT requests
|
||||
|
||||
- [account_nfts method][] - Get a list of non-fungible tokens owned by an account.
|
||||
- [nft_buy_offers method][] - Get a list of buy offers for a specified NFToken object.
|
||||
- [nft_sell_offers method][] - Get a list of sell offers for a specified NFToken object.
|
||||
- [subscribe method][] - Listen for updates about a particular subject. For example, a marketplace can publish real-time updates on the status of NFTs listed on their platform.
|
||||
- [unsubscribe method][] - Stop listening for updates about an NFT.
|
||||
|
||||
## Clio
|
||||
|
||||
[Clio servers](the-clio-server.html) also provide the following APIs related to NFTs:
|
||||
|
||||
- [nft_info](nft_info.html) - Get current status information about the specified NFT.
|
||||
- [nft_history](nft_history.html) - Get past transaction metadata for the specified NFT.
|
||||
|
||||
You can access a public Clio server by sending a request to its URL and Clio port (typically 51233). Public Clio API servers come with no SLAs nor any responsibility to be fixed on priority. If your business use case requires continual monitoring and information requests, consider setting up your own Clio server instance. See [install-clio-on-ubuntu](install-clio-on-ubuntu.html).
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
28
content/concepts/tokens/nfts/payload-storage.md
Normal file
28
content/concepts/tokens/nfts/payload-storage.md
Normal file
@@ -0,0 +1,28 @@
|
||||
---
|
||||
html: nft-storage.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Storage options for the payload of your NFT.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# NFT Payload Storage
|
||||
|
||||
NFTs are created on the blockchain. But the payload of the NFT, including media, metadata, and attributes can be stored in a variety of ways, including on the XRP Ledger; decentralized, off the XRP Ledger; and centralized, off the XRP Ledger.
|
||||
|
||||
## On the XRP Ledger
|
||||
|
||||
If your data is smaller than 256 bytes, you can consider using a `data://` URI and embedding it directly in the URI field. This has the advantage of storing the data in a reliable, persistent, and responsive database.
|
||||
|
||||
## Decentralized, off the XRP Ledger
|
||||
|
||||
You can use any of the existing decentralized storage solutions for your NFT metadata.
|
||||
|
||||
IPFS and Arweave offer solutions for decentralization. However, fetching the metadata efficiently can be a problem. Querying IPFS or Arweave directly to fetch metadata is not fast enough for modern websites that require immediate responses from users that are scrolling through multiple pages of NFTs that include high-quality media.
|
||||
|
||||
See the blog post [NFT Payload Storage Options](https://dev.to/ripplexdev/nft-payload-storage-options-569i) for some examples of cloud storage solutions.
|
||||
|
||||
## Centralized, off the XRP Ledger
|
||||
|
||||
You can use the URI field to point to a webserver you maintain from which the payload is served.
|
||||
|
||||
As an alternative, and to save space on the ledger, you can set the `Domain` field of the issuer using `AccountSet` and treat the NFT ID of the token as a path on that domain. For example, if the NFT has an ID of `123ABC` and the domain on the issuer is `example.com`, you could serve the payload from `example.com/tokens/123ABC`.
|
||||
68
content/concepts/tokens/nfts/reserve-requirements.md
Normal file
68
content/concepts/tokens/nfts/reserve-requirements.md
Normal file
@@ -0,0 +1,68 @@
|
||||
---
|
||||
html: nft-reserve-requirements.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Understand reserve requirements for minting and holding NFTs.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# NFT Reserve Requirements
|
||||
|
||||
Minting, holding, and offering NFTs for sale require XRP held in reserve. The reserve charges can add up quickly. Understanding the reserve requirements can help you choose the best approach for your business case.
|
||||
|
||||
## Base Reserve
|
||||
|
||||
Your account must set aside a base reserve, currently 10 XRP. The base reserve XRP amount is subject to change. See [Base Reserve and Owner Reserve](reserves.html#base-reserve-and-owner-reserve).
|
||||
|
||||
## Owner Reserve
|
||||
|
||||
For each object you own on the XRP Ledger, there is an owner reserve, currently 2 XRP. This is to discourage users from spamming the ledger with unnecessary data, and to encourage them to clean up any data that is no longer necessary. The owner reserve amount is subject to change. See [Base Reserve and Owner Reserve](reserves.html#base-reserve-and-owner-reserve).
|
||||
|
||||
For NFTs, the _object_ does not refer to the individual NFTs, but to the `NFTokenPage` objects owned by the account. `NFTokenPage` objects can store up to 32 NFTs.
|
||||
|
||||
However, NFTs are not packed into pages to minimize space used. If you have 64 NFTs, it's not necessarily true that you have only 2 `NFTokenPage` objects.
|
||||
|
||||
A good rule of thumb is to assume, on average, that each `NFTokenPage` stores 24 NFTs.
|
||||
Therefore, you can estimate the reserve requirements for minting or owning _N_ NFTs as (24N)/2, or 1/12 of one XRP per NFT.
|
||||
|
||||
The following table provides examples of how much the total owner reserve might be, depending on the number of NFTs owned and the number of pages holding them.
|
||||
|
||||
| NFTs Owned | Best Case | Typical Case | Worst Case |
|
||||
|:------------|:----------|:-------------|:-----------|
|
||||
| 32 or fewer | 2 XRP | 2 XRP | 2 XRP |
|
||||
| 50 | 4 XRP | 6 XRP | 8 XRP |
|
||||
| 200 | 14 XRP | 18 XRP | 26 XRP |
|
||||
| 1000 | 64 XRP | 84 XRP | 126 XRP |
|
||||
|
||||
## `NFTokenOffer` Reserve
|
||||
|
||||
Each `NFTokenOffer` object costs the account placing the offer one incremental reserve. As of this writing, the incremental reserve is 2 XRP. The reserve can be recovered by cancelling the offer. The reserve is also recovered if the offer is accepted, which removes the offer from the XRP Ledger.
|
||||
|
||||
**Tip** After you sell an NFT, as a courtesy, cancel any stale `NFTokenOffer` objects on behalf of your bidders to give them back their reserve. You can do this with [NFTokenCancelOffer](nftokencanceloffer.html) transactions.
|
||||
|
||||
## Practical Considerations
|
||||
|
||||
When minting, holding, and offering to buy and sell NFTs, the reserve requirements can add up quickly. This can result in your account going below the reserve requirement during a transaction. Going below the requirement can limit your ability to trade on the XRPL. See [Going Below the Reserve Requirement](reserves.html#going-below-the-reserve-requirement).
|
||||
|
||||
If you create a new account, mint an NFT, and create an `NFTokenSellOffer` on the XRP Ledger, that requires a minimum reserve of 14 XRP.
|
||||
|
||||
| Reserve Type | Amount |
|
||||
|:--------------------|--------:|
|
||||
| Base | 10 XRP |
|
||||
| NFToken Page | 2 XRP |
|
||||
| NFToken Offers | 2 XRP |
|
||||
| Total | 14 XRP |
|
||||
| | |
|
||||
|
||||
**Note** While not a reserve requirement, keep in mind that you would want to have at least 1 XRP above your reserves to cover the trivial fee for each transaction in the mint and sell process (typically 12 drops, or .000012 XRP).
|
||||
|
||||
If you were to mint 200 NFTs and create an `NFTokenSellOffer`for each, that would require as much as 436 XRP held in reserve.
|
||||
|
||||
| Reserve Type | Amount |
|
||||
|:--------------------|--------:|
|
||||
| Base | 10 XRP |
|
||||
| NFToken Pages | 26 XRP |
|
||||
| NFToken Offers | 400 XRP |
|
||||
| Total | 436 XRP |
|
||||
| | |
|
||||
|
||||
If the required reserves exceed the amount you are comfortable setting aside, consider using the mint-on-demand model to reduce the number of NFTs and offers you hold at any one time. For details, see [Batch Minting](nftoken-batch-minting.html).
|
||||
63
content/concepts/tokens/nfts/running-an-nft-auction.md
Normal file
63
content/concepts/tokens/nfts/running-an-nft-auction.md
Normal file
@@ -0,0 +1,63 @@
|
||||
---
|
||||
html: nftoken-auctions.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: You can assign another account to mint NFTs in your stead.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
# Running an NFT Auction
|
||||
|
||||
There are several ways to run an auction, each with advantages and disadvantages.
|
||||
|
||||
## Run the Auction Off the XRPL, Complete the Purchase on XRPL
|
||||
|
||||
This flow is the most straightforward. Note that the `NFTokenOffer` objects can always be canceled by their creator, so it's not possible to implement a binding offer.
|
||||
|
||||
1. Store your bids in a private database.
|
||||
2. You take a cut of the winning bid.
|
||||
3. Send the buyer/seller the XRPL transaction to complete the purchase.
|
||||
|
||||
## Run the Auction in Brokered Mode, with a Reserve
|
||||
|
||||
Run the auction in brokered mode, as an auction with a reserve.
|
||||
|
||||

|
||||
|
||||
1. The seller creates the NFT, then sets the auction reserve price using `NFTokenCreateOffer`, specifying the broker account as the destination.
|
||||
1. The bidders make offers using `NFTokenCreateOffer`, setting the broker account as the destination.
|
||||
1. The broker selects the winning bid, completes the sale using `NFTokenAcceptOffer`, collecting the broker fee. Then the broker cancels any losing bids using `NFTokenCancelOffer`.
|
||||
|
||||
**Pros:**
|
||||
|
||||
- The entire auction happens on the XRPL, including your broker fee.
|
||||
- The seller represents their reserve price on-chain.
|
||||
- This is _close_ to a binding offer, from the buyside.
|
||||
|
||||
**Cons:**
|
||||
|
||||
- There must be implicit trust between the seller and the broker that the broker will not take more than some previously agreed-upon rate. If the reserve was 1 XRP and the winning bid was 1000 XRP, there is no on-chain mechanism to prevent the broker from taking 999 XRP as profit, leaving only the reserve profits for the seller.
|
||||
|
||||
A major mitigating factor of this downside is that if this behavior were to happen, brokers would lose their entire market share, which sellers should understand.
|
||||
|
||||
## Run the Auction in Brokered Mode, without a Reserve.
|
||||
|
||||
This is the most complex workflow of the three.
|
||||
|
||||

|
||||
|
||||
1. The seller creates an NFT using `NFTokenMint`.
|
||||
1. The bidders make offers using `NFTokenCreateOffer`, setting the broker as the destination.
|
||||
1. The broker selects the winning bid, subtracts the amount to be collected as a fee, then requests the seller sign a sell offer for this amount via `NFTokenCreateOffer`.
|
||||
1. The seller signs the requested offer, setting the broker as the destination.
|
||||
1. The broker completes the sale using `NFTokenAcceptOffer`, and receives the broker fee.
|
||||
1. The broker cancels any remaining bids using `NFTokenCancelOffer`.
|
||||
|
||||
**Pros:**
|
||||
|
||||
- This flow requires absolutely no trust among participants, making it the option most people expect on the blockchain.
|
||||
- Sellers know exactly how much the broker takes from them in fees and must agree to it on the chain.
|
||||
|
||||
**Cons:**
|
||||
|
||||
- After the auction is complete, the sale is contingent on the seller agreeing to the final bid amount and broker fee amount. This means that sellers can back out of an otherwise complete auction or that sellers can delay settlement due to being distracted or not seeing some notification.
|
||||
- After the auction is complete, a seller can refuse the winning bid, instead selling to someone else.
|
||||
76
content/concepts/tokens/nfts/trading.md
Normal file
76
content/concepts/tokens/nfts/trading.md
Normal file
@@ -0,0 +1,76 @@
|
||||
---
|
||||
html: non-fungible-token-transfers.html
|
||||
parent: non-fungible-tokens.html
|
||||
blurb: Trading NFTs in direct or brokered mode.
|
||||
labels:
|
||||
- Non-fungible Tokens, NFTs
|
||||
---
|
||||
|
||||
# Trading NFTs
|
||||
|
||||
You can transfer NFTs between accounts on the XRP Ledger. You can offer to buy or sell an NFT, or accept offers from other accounts to buy an NFT you own. You can even give away an NFT by offering to sell it at a price of 0. All offers are created using [NFTokenCreateOffer transaction][].
|
||||
|
||||
_(Added by the [NonFungibleTokensV1_1 amendment][].)_
|
||||
|
||||
## Reserve Requirements
|
||||
|
||||
Every `NFTokenOffer` object requires that your account increase its owner reserve, currently 2 XRP per `NFTokenSellOffer` and 2 XRP per `NFTokenBuyOffer`. This is to prevent accounts from spamming the ledger with offers they don't intend to complete.
|
||||
|
||||
See [NFT Reserve Requirements](nft-reserve-requirements.html).
|
||||
|
||||
## Sell Offers
|
||||
|
||||
### Create a Sell Offer
|
||||
|
||||
As the owner of an NFT, you can create a sell offer using a [NFTokenCreateOffer transaction][] with the `tfSellToken` flag. You provide the `NFTokenID` and the `Amount` you are willing to accept in payment. You can optionally specify an `Expiration` date, after which the offer is no longer valid, and a `Destination` account, which is the only account that is allowed to buy the NFT.
|
||||
|
||||
### Accept a Sell Offer
|
||||
|
||||
To buy an NFT that is offered for sale, you use a `NFTokenAcceptOffer` transaction. You provide the owner account and specify the `NFTokenOfferID` of the `NFTokenOffer` object you choose to accept.
|
||||
|
||||
## Buy Offers
|
||||
|
||||
### Create a Buy Offer
|
||||
|
||||
Any account can offer to buy an NFT. You can create a buy offer using [NFTokenCreateOffer][] _without_ the `tfSellToken` flag. You provide the `Owner` account, `NFTokenID`, and the `Amount` of your offer.
|
||||
|
||||
### Accept a Buy Offer
|
||||
|
||||
Use the `NFTokenAcceptOffer` transaction to transfer an NFT. Provide the `NFTokenOfferID` and the owner account to complete the transaction.
|
||||
|
||||
## Trading Modes
|
||||
|
||||
When trading an NFT, you can choose between a _direct_ transaction between a buyer and seller or a _brokered_ transaction, where a third party account matches a sell and buy offer to arrange the trade.
|
||||
|
||||
Trading in direct mode gives the seller control over the transfer. The seller can either post an NFT for sale so that anyone can buy it, or sell an NFT to a specific account. The seller receives the entire price for the NFT.
|
||||
|
||||
In brokered mode, the seller allows a third party account to broker the sale of the NFT. The broker account collects a broker fee for the transfer at an agreed upon rate. This happens as one transaction, paying the broker and seller from the buyer’s funds without requiring an up front investment by the broker.
|
||||
|
||||
### When to Use Brokered Mode
|
||||
|
||||
If an NFT creator has the time and patience to seek out the right buyers, the creator keeps all proceeds from the sale. This works fine for a creator who sells few NFTs at variable prices.
|
||||
|
||||
On the other hand, creators might not want to spend their time selling their creations when they could spend the time creating. Instead of handling each individual sale, the sales work can be turned over to a third-party broker account.
|
||||
|
||||
Using a broker offers several advantages. For example:
|
||||
|
||||
* The broker can act as an agent, working to maximize the selling price of the NFT. If the broker is paid a percentage of the sale price, the higher the price, the more the broker earns.
|
||||
* The broker can act as a curator, organizing NFTs based on a niche market, price point, or other criteria. This can attract groups of buyers who might not otherwise discover a creator’s work.
|
||||
* The broker can act as a marketplace, similar to Opensea.io, to handle the auction process at the application layer.
|
||||
|
||||
### Brokered Sale Workflows
|
||||
|
||||
In the most straightforward workflow, a creator mints a new NFT. The creator initiates a sell offer, entering the minimum acceptable sale price and setting the broker as the destination. Potential buyers make bids for the NFT, setting the broker as the destination for the bid. The broker selects a winning bid and completes the transaction, taking a broker’s fee. As a best practice, the broker then cancels any remaining buy offers for the NFT.
|
||||
|
||||

|
||||
|
||||
Another potential workflow would give the creator more control over the sale. In this workflow, the creator mints a new NFT. Bidders create their offers, setting the broker as the destination. The broker selects the winning bid, subtracts their broker fee, and uses `NFTokenCreateOffer` to request that the creator sign off on the offer. The creator signs the requested offer, setting the broker as the destination. The broker completes the sale using `NFTokenAcceptOffer`, retaining the broker fee. The broker cancels any remaining bids for the NFT using `NFTokenCancelOffer`.
|
||||
|
||||

|
||||
|
||||
The same workflows can be used when an owner resells an NFT created by another account.
|
||||
|
||||
<!--{# common link defs #}-->
|
||||
{% include '_snippets/rippled-api-links.md' %}
|
||||
{% include '_snippets/tx-type-links.md' %}
|
||||
{% include '_snippets/rippled_versions.md' %}
|
||||
Reference in New Issue
Block a user