Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lowering Deposit Requirements on Polkadot and Kusama Asset Hub #45

Merged
Merged
Changes from 36 commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
d3f3e16
Init 000x-assethub.md
poppyseedDev Nov 2, 2023
4c90e8e
Update 000x-assethub.md - initial text
poppyseedDev Nov 2, 2023
a1c6854
Implementing prices 000x-assethub.md
poppyseedDev Nov 2, 2023
316cd45
Update 000x-assethub.md
poppyseedDev Nov 7, 2023
7d5e9c3
Update 000x-assethub.md
poppyseedDev Nov 7, 2023
0a217aa
Update 000x-assethub.md - adding usernames
poppyseedDev Nov 7, 2023
4ba607f
Update 000x-assethub.md
poppyseedDev Nov 7, 2023
d40dffd
Update text/000x-assethub.md Update headline
poppyseedDev Nov 7, 2023
6d297fb
Update 000x-assethub.md
poppyseedDev Nov 7, 2023
0e49a4f
Update 000x-assethub.md - added vikiival as contributor
poppyseedDev Nov 8, 2023
3b48582
Update text/000x-assethub.md
poppyseedDev Nov 16, 2023
cef02e1
Update text/000x-assethub.md
poppyseedDev Nov 16, 2023
88c0f69
:memo: wording
vikiival Jan 9, 2024
cfc84ed
Merge remote-tracking branch 'origin/main' into feat/grammar-x-pricing
vikiival Jan 9, 2024
a15b1bd
:memo: :zap: calculations
vikiival Jan 9, 2024
edf6758
:memo: update author name
vikiival Jan 9, 2024
4079c29
:zap: :memo: pricing for kusama asset hub
vikiival Jan 9, 2024
e9a81d4
:memo: wording
vikiival Jan 9, 2024
28e217a
:memo: :bug: wording
vikiival Jan 9, 2024
9541841
Update text/000x-assethub.md
poppyseedDev Jan 9, 2024
5b34f67
Update text/000x-assethub.md
poppyseedDev Jan 9, 2024
4237d37
Merge pull request #1 from poppyseedDev/feat/grammar-x-pricing
poppyseedDev Jan 9, 2024
a3d3cb1
Update 000x-assethub.md
poppyseedDev Jan 9, 2024
731d0c1
Update 000x-assethub.md
poppyseedDev Jan 10, 2024
d16fa29
Update 000x-assethub.md
poppyseedDev Jan 11, 2024
c464459
Update and rename 000x-assethub.md to 000x-lowering-deposits-assethub.md
poppyseedDev Jan 11, 2024
17b5448
Update 000x-lowering-deposits-assethub.md
poppyseedDev Jan 11, 2024
3328781
Update 000x-lowering-deposits-assethub.md
poppyseedDev Jan 11, 2024
33194da
Update 000x-lowering-deposits-assethub.md changing the ending
poppyseedDev Jan 11, 2024
23b9bab
Merge pull request #2 from poppyseedDev/poppyseedDev-patch-1
poppyseedDev Jan 11, 2024
c6e9970
Update text/000x-lowering-deposits-assethub.md
poppyseedDev Jan 18, 2024
f519da0
::
vikiival Jan 19, 2024
f4fa857
rename with rfc number
joepetrowski Jan 31, 2024
a8dcdf2
break lines
joepetrowski Jan 31, 2024
3ad68dd
change some wording and typos
joepetrowski Jan 31, 2024
759c140
Merge branch 'polkadot-fellows:main' into polkadot-asset-hub
vikiival Jan 31, 2024
823013e
add decision on sigmoid function
joepetrowski Feb 11, 2024
0bb0f60
Apply suggestions from code review
joepetrowski Feb 12, 2024
a7319f0
table format
joepetrowski Feb 12, 2024
c7edfc3
Update text/0045-nft-deposits-asset-hub.md
poppyseedDev Feb 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 227 additions & 0 deletions text/0045-nft-deposits-asset-hub.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
# RFC-0045: Lowering NFT Deposits on Asset Hub

| | |
| --------------- | ----------------------------------------------------------------------------- |
| **Start Date** | 2 November 2023 |
| **Description** | A proposal to reduce the minimum deposit required for collection creation on the Polkadot and Kusama Asset Hubs. |
| **Authors** | [Aurora Poppyseed](https://github.com/poppyseedDev), [Just_Luuuu](https://github.com/justLuuuu), [Viki Val](https://github.com/vikiival) |
poppyseedDev marked this conversation as resolved.
Show resolved Hide resolved

## Summary

This RFC proposes changing the current deposit requirements on the Polkadot and Kusama Asset Hub for
creating an NFT collection, minting an individual NFT, and lowering its corresponding metadata and
attribute deposits. The objective is to lower the barrier to entry for NFT creators, fostering a
more inclusive and vibrant ecosystem while maintaining network integrity and preventing spam.

## Motivation

The current deposit of 10 DOT for collection creation (along with 0.01 DOT for item deposit and 0.2
DOT for metadata and attribute deposits) on the Polkadot Asset Hub and 0.1 KSM on Kusama Asset Hub
presents a significant financial barrier for many NFT creators. By lowering the deposit
requirements, we aim to encourage more NFT creators to participate in the Polkadot NFT ecosystem,
thereby enriching the diversity and vibrancy of the community and its offerings.

The initial introduction of a 10 DOT deposit was an arbitrary starting point that does not consider
the actual storage footprint of an NFT collection. This proposal aims to adjust the deposit first to
a value based on the `deposit` function, which calculates a deposit based on the number of keys
introduced to storage and the size of corresponding values stored.

Further, it suggests some directions for a future of calculating deposits variably based on adoption
and/or market conditions. There is a discussion on tradeoffs of setting deposits too high or too
low.

### Requirements

- Deposits SHOULD be derived from `deposit` function, adjusted by correspoding pricing mechansim.
ggwpez marked this conversation as resolved.
Show resolved Hide resolved

## Stakeholders

- **NFT Creators**: Primary beneficiaries of the proposed change, particularly those who found the
current deposit requirements prohibitive.
- **NFT Platforms**: As the facilitator of artists' relations, NFT marketplaces have a vested
interest in onboarding new users and making their platforms more accessible.
- **dApp Developers**: Making the blockspace more accessible will encourage developers to create and
build unique dApps in the Polkadot ecosystem.
- **Polkadot Community**: Stands to benefit from an influx of artists, creators, and diverse NFT
collections, enhancing the overall ecosystem.

Previous discussions have been held within the [Polkadot
Forum](https://forum.polkadot.network/t/polkadot-assethub-high-nft-collection-deposit/4262), with
artists expressing their concerns about the deposit amounts.

## Explanation

This RFC proposes a revision of the deposit constants in the configuration of the NFTs pallet on the
Polkadot Asset Hub. The new deposit amounts would be determined by a standard deposit formula.

As of v1.1.1, the Collection Deposit is 10 DOT and the Item Deposit is 0.01 DOT (see
[here](https://github.com/polkadot-fellows/runtimes/blob/v1.1.1/system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs#L687)).

Based on the storage footprint of these items, this RFC proposes changing them to:

```rust
pub const NftsCollectionDeposit: Balance = system_para_deposit(1, 130);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is more than one storage item, so to be really precise it should be something in the form of system_para_deposit(1, x) + system_para_deposit(1, y) (Collection and CollectionRoleOf) but i dont want to block this RFC much longer.
Guess this approximates it well enough for now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there are two items then we should probably be consistent. It should still be a large reduction (from 10 to 0.4 instead of 0.2).

Broadly speaking though, and w/r/t the idea of finding an "optimal" deposit, it can never be perfect. As long as you can't start adding more storage items for free (i.e. deposit is directly proportional to storage items added) then it's well-designed. Factors of 2x are just not significant (and it's a bit arrogant to think we can get it so precise). I think probably 10x is the best we can hope for with these parameters.

pub const NftsItemDeposit: Balance = system_para_deposit(1, 164);
```

This results in the following deposits (calculted using [this
repository](https://github.com/vikiival/rfc-pricing)):

**Polkadot**

| **Name** | **Current Rate (DOT)** | **Proposed Rate (DOT)** |
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
|---------------------------|:----------------------:|:-----------------------:|
| `collectionDeposit` | 10 | 0.20064 |
| `itemDeposit` | 0.01 | 0.20081 |
| `metadataDepositBase` | 0.20129 | 0.20076 |
| `attributeDepositBase` | 0.2 | 0.2 |

Similarly, the prices for Kusama were calculated as:

**Kusama:**

| **Name** | **Current Rate (KSM)** | **Proposed Rate (KSM)** |
joepetrowski marked this conversation as resolved.
Show resolved Hide resolved
|---------------------------|:----------------------:|:-----------------------:|
| `collectionDeposit` | 0.1 | 0.006688 |
| `itemDeposit` | 0.001 | 0.000167 |
| `metadataDepositBase` | 0.006709666617 | 0.0006709666617 |
| `attributeDepositBase` | 0.00666666666 | 0.000666666666 |

### Enhanced Approach to Further Lower Barriers for Entry

This RFC proposes further lowering these deposits below the rate normally charged for such a storage
footprint. This is based on the economic argument that sub-rate deposits are a subsididy for growth
and adoption of a specific technology. If the NFT functionality on Polkadot gains adoption, it makes
it more attractive for future entrants, who would be willing to pay the non-subsidized rate because
of the existing community.

**Proposed Rate Adjustments**

```rust
parameter_types! {
pub const NftsCollectionDeposit: Balance = system_para_deposit(1, 130);
pub const NftsItemDeposit: Balance = system_para_deposit(1, 164) / 40;
pub const NftsMetadataDepositBase: Balance = system_para_deposit(1, 129) / 10;
pub const NftsAttributeDepositBase: Balance = system_para_deposit(1, 0) / 10;
pub const NftsDepositPerByte: Balance = system_para_deposit(0, 1);
}
```

This adjustment would result in the following DOT and KSM deposit values:

| **Name** | **Proposed Rate Polkadot** | **Proposed Rate Kusama** |
|---------------------------|:--------------------------:|:------------------------:|
| `collectionDeposit` | 0.20064 DOT | 0.006688 KSM |
| `itemDeposit` | 0.005 DOT | 0.000167 KSM |
| `metadataDepositBase` | 0.002 DOT | 0.0006709666617 KSM |
| `attributeDepositBase` | 0.002 DOT | 0.000666666666 KSM |

## Drawbacks

Modifying deposit requirements necessitates a balanced assessment of the potential drawbacks.
Highlighted below are cogent points extracted from the discourse on the [Polkadot Forum
conversation](https://forum.polkadot.network/t/polkadot-assethub-high-nft-collection-deposit/4262),
which provide critical perspectives on the implications of such changes.

Adjusting NFT deposit requirements on Polkadot and Kusama Asset Hubs involves key challenges:

1. **State Growth and Technical Concerns**: Lowering deposit requirements can lead to increased
blockchain state size, potentially causing state bloat. This growth needs to be managed to
prevent strain on the network's resources and maintain operational efficiency. As stated earlier,
the deposit levels proposed here are intentionally low with the thesis that future participants
would pay the standard rate.

2. **Network Security and Market Response**: Adapting to the cryptocurrency market's volatility is
crucial. The mechanism for setting deposit amounts must be responsive yet stable, avoiding undue
complexity for users.

3. **Economic Impact on Previous Stakeholders**: The change could have varied economic effects on
previous (before the change) creators, platform operators, and investors. Balancing these
interests is essential to ensure the adjustment benefits the ecosystem without negatively
impacting its value dynamics. However in the particular case of Polkadot and Kusama Asset Hub
this does not pose a concern since there are very few collections currently and thus previous
stakeholders wouldn't be much affected. As of date 9th January 2024 there are 42 collections on
Polkadot Asset Hub and 191 on Kusama Asset Hub with a relatively low volume.

## Testing, Security, and Privacy

### Security concerns

As noted above, state bloat is a security concern. In the case of abuse, governance could adapt by
increasing deposit rates and/or using `forceDestroy` on collections agreed to be spam.

## Performance, Ergonomics, and Compatibility

### Performance

The primary performance consideration stems from the potential for state bloat due to increased
activity from lower deposit requirements. It's vital to monitor and manage this to avoid any
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have monitoring in place?

Copy link
Contributor

@joepetrowski joepetrowski Feb 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe @KarimJedda or someone from KodaDot is tracking NFT activity?

Copy link
Contributor Author

@poppyseedDev poppyseedDev Feb 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @vikiival is in a good position to answer this question, since he created indexer for AssetHub.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Someone from KodaDot is tracking NFT activity?

-- current nfts 9792
select count(*) from nft_entity where burned = false;

-- current collection 98
select count(*) from collection_entity where burned = false;

-- all nfts 9883 (~ 100 burned)
select count(*) from nft_entity;

-- all collections 138 (40 destroyed)
select count(*) from collection_entity;

-- all interactions that is not mint (list, buy, burn) 16_019
select count(*) from event where interaction <> 'MINT';

Top 3 creators on AHP

  [{
    "count": 41,
    "issuer": "15CoYMEnJhhWHvdEPXDuTBnZKXwrJzMQdcMwcHGsVx5kXYvW"
  },
  {
    "count": 24,
    "issuer": "1ULZhwpUPLLg5VRYiq6rBHY8XaShAmBW7kqGBfvHBqrgBcN"
  },
  {
    "count": 6,
    "issuer": "1nYXo6fd1fjVm1ixUwycELfjTyaxxzVHAVgZ8S8H6cZMfY7"
  }]

Data are public via our @subsquid indexer or Typescript API (kodadot/uniquery)

negative impact on the chain's performance. Strategies for mitigating state bloat, including
efficient data management and periodic reviews of storage requirements, will be essential.

### Ergonomics

The proposed change aims to enhance the user experience for artists, traders, and utilizers of
Kusama and Polkadot Asset Hubs, making Polkadot and Kusama more accessible and user-friendly.

### Compatibility

The change does not impact compatibility as a `redeposit` function is already implemented.

## Unresolved Questions

There remain unresolved questions regarding the implementation of a function-based pricing model for
deposits and the feasibility of linking deposits to a USD(x) value. These aspects require further
exploration and discussion to ascertain their viability and potential impact on the ecosystem. See
below.

## Future Directions and Related Material

## Discussion of Other Proposals

Several innovative proposals have been considered to enhance the network's adaptability and manage
deposit requirements more effectively:

### Enhanced Weak Governance Origin Model

The concept of a weak governance origin, controlled by a consortium like a system collective, has
been proposed. This model would allow for dynamic adjustments of NFT deposit requirements in
response to market conditions, adhering to storage deposit norms.

- **Responsiveness**: To address concerns about delayed responses, the model could incorporate
automated triggers based on predefined market indicators, ensuring timely adjustments.
- **Stability vs. Flexibility**: Balancing stability with the need for flexibility is challenging.
To mitigate the issue of frequent changes in DOT-based deposits, a mechanism for gradual and
predictable adjustments could be introduced.
- **Scalability**: The model's scalability is a concern, given the numerous deposits across the
system. A more centralized approach to deposit management might be needed to avoid constant,
decentralized adjustments.

### Function-Based Pricing Model

Another proposal is to use a mathematical function to regulate deposit prices, initially allowing
low prices to encourage participation, followed by a gradual increase to prevent network bloat.

- **Choice of Function**: A logarithmic or sigmoid function is favored over an exponential one, as
these functions increase prices at a rate that encourages participation while preventing
prohibitive costs.
- **Adjustment of Constants**: To finely tune the pricing rise, one of the function's constants
could correlate with the total number of NFTs on Asset Hub. This would align the deposit
requirements with the actual usage and growth of the network.

### Linking Deposit to USD(x) Value

This approach suggests pegging the deposit value to a stable currency like the USD, introducing
predictability and stability for network users.

- **Market Dynamics**: One perspective is that fluctuations in native currency value naturally
balance user participation and pricing, deterring network spam while encouraging higher-value
collections. Conversely, there's an argument for allowing broader participation if the DOT/KSM
value increases.
- **Complexity and Risks**: Implementing a USD-based pricing system could add complexity and
potential risks. The implementation needs to be carefully designed to avoid unintended
consequences, such as excessive reliance on external financial systems or currencies.

Each of these proposals offers unique advantages and challenges. The optimal approach may involve a
combination of these ideas, carefully adjusted to address the specific needs and dynamics of the
Polkadot and Kusama networks.