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

Compressed NFT Standard #126

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

krigga
Copy link
Contributor

@krigga krigga commented Jul 28, 2023

No description provided.

@yungwine
Copy link

Hey @krigga! I like the idea, but I think we should make a standard NFT compressed contract with Merkle proofs instead of Merkle trees. First of all, we should use TON possibilities and TON has a convenient proof verifying technology. Secondly, it should be much cheaper.

I started such development in my fork (currently there is no Merkle Updates implementation for updates, its just an example of how the proof can be verified). So if the community like the idea I can continue development.

I think wallet developers should support exotic cells sending in wallets, because that's a good technology that can find application in many developments. So maybe its better to wait for wallets to support this feature?

For the first time we can use proxy contracts for NFT claiming: User deploys a simple proxy contract and then sends an external message with proof to it which proxy sends to the collection contract. The cost of deployment is offset by the cheapness of proof verification with tvm built-in Merkle Proof validation.

@Naltox
Copy link

Naltox commented Jul 29, 2023

Hey, @yungwine
Absolutely agree on your take on exotic cells.
We actually have implementation of reference contracts using exotic cells, but as you mentioned no wallet currently supports them.
We made your best to make this standard implementation-agnostic, this means that standard does not cover how exactly poofs are implemented.
So there is no reason to change the standard itself, it could be adopted now. When the wallets will support exotic cells we will just change the reference implementation of contracts without changing the standard itself

@purp1le
Copy link

purp1le commented Jul 31, 2023

I don't really understand why it is necessary to put all this in a separate standard. As an implementation of NFT together with merkle tree it is very good, but as a standard it does not add anything new. On ethereum they have been doing token drops with merkle tree for a long time. I think that for a new standard it is necessary to add something conceptually new, and this is not worthy of a separate standard

@Naltox
Copy link

Naltox commented Aug 2, 2023

Hey, @purp1le!

In the world of technology, standards play a crucial role in bringing everyone together. It's not just about showcasing the novelty of ideas; rather, the primary objective is to foster consensus among all the players in the ecosystem. These standards serve as a unifying force, ensuring that we all rally behind a common technology that benefits everybody involved.

@Hiyorimi
Copy link

Hiyorimi commented Aug 2, 2023

This is so long-awaited on TON

@SamDavodi
Copy link

Good

Change the format of the `items` request
Add an optional limit to `count` of the `items` request
@ThirawatChuaiklang
Copy link

Good

@ThirawatChuaiklang
Copy link


Copy link

@kuzimage444 kuzimage444 left a comment

Choose a reason for hiding this comment

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

Это как

```json
{
"metadata": {
"owner": "UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ", // user-friendly url-safe address string
Copy link

Choose a reason for hiding this comment

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

better to use raw address. it helps to avoid using not normalized address comparsion as a string

{
"metadata": {
"owner": "UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ", // user-friendly url-safe address string
"individual_content": "te6cckEBAQEAAgAAAEysuc0=" // base64 BoC serialized Cell
Copy link

Choose a reason for hiding this comment

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

also here you use base64 url-unsafe

NFT Collection smart contract MUST implement:

#### Get-methods
1. `get_nft_api_info()` returns `(int version, cell uri)`. `version` is the version of the API that augments this contract. This standard covers API version 1, see below for description. `uri` is the API URI in `SnakeText` format **not including the version postfix**, and the final API URI must be formed as follows: `decoded-uri + '/v1'`.
Copy link

Choose a reason for hiding this comment

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

wtf? what if decoded-uri is 'http://example.com/index.php?page=metadata'? author should switch urls naming scheme in project only for this feature?


## Augmenting API version 1

Once a user has obtained and decoded the URI using the `get_api_info` get method, verified the version (this standard covers version 1 only) and added the `/v1` postfix, they can use the following methods:
Copy link

Choose a reason for hiding this comment

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

get_api_info or get_nft_api_info?
or maybe it's two independent methods?

"owner": "UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ", // user-friendly url-safe address string
"individual_content": "te6cckEBAQEAAgAAAEysuc0=" // base64 BoC serialized Cell
},
"index": 0
Copy link

Choose a reason for hiding this comment

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

is index should always be integer? what if index is 256-bit long like in domains?


(`:arg` means an argument with name `arg`)

##### 1. `/item/:index`
Copy link

Choose a reason for hiding this comment

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

if you are writting REST style than /items/:index

```json
{
"last_index": 0,
"address": "UQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAJKZ"
Copy link

Choose a reason for hiding this comment

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

same - better to use raw form for avoiding problems. for example nft collection it's 100% a smartcontract but in documentation you used non-bounce form

@mr-tron
Copy link

mr-tron commented Oct 8, 2023

So what about indexes. like tonapi or getgems. should we index compressed collections? if yes it looks like very cheap attack to them. I can make easily collection with 100000 items, deploy it for 0.0001 TON and every index should save all items in db. but attacker even doesn't need to store all this items on his server and easily can generate it on-demand.
Looks like i attacker can stream /dev/urandom to my database.

@krigga
Copy link
Contributor Author

krigga commented Oct 24, 2023

So what about indexes. like tonapi or getgems. should we index compressed collections? if yes it looks like very cheap attack to them. I can make easily collection with 100000 items, deploy it for 0.0001 TON and every index should save all items in db. but attacker even doesn't need to store all this items on his server and easily can generate it on-demand. Looks like i attacker can stream /dev/urandom to my database.

All indexers supporting this standard should come up with their own ways of filtering out malicious compressed NFT collections (for example - whitelists/blacklists, any kind of heuristics, etc) - this standard does not concern itself with that aspect.

@Davidrekrut

This comment was marked as spam.

@Davidrekrut

This comment was marked as spam.

@Godeanstreet
Copy link

@howardpen9
Copy link

Hey @krigga! I like the idea, but I think we should make a standard NFT compressed contract with Merkle proofs instead of Merkle trees. First of all, we should use TON possibilities and TON has a convenient proof verifying technology. Secondly, it should be much cheaper.

I started such development in my fork (currently there is no Merkle Updates implementation for updates, its just an example of how the proof can be verified). So if the community like the idea I can continue development.

I think wallet developers should support exotic cells sending in wallets, because that's a good technology that can find application in many developments. So maybe its better to wait for wallets to support this feature?

For the first time we can use proxy contracts for NFT claiming: User deploys a simple proxy contract and then sends an external message with proof to it which proxy sends to the collection contract. The cost of deployment is offset by the cheapness of proof verification with tvm built-in Merkle Proof validation.

nice

@Osasv
Copy link

Osasv commented Dec 23, 2023 via email

@@ -108,10 +108,12 @@ Example:
}
```

##### 2. `/items/:offset/:count`

Choose a reason for hiding this comment

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


@Ehsanbad
Copy link

Ton Is" Power

Copy link

@Ehsanbad Ehsanbad left a comment

Choose a reason for hiding this comment

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

🔥

@tvorogme
Copy link

tvorogme commented Jan 28, 2024

All indexers supporting this standard should come up with their own ways of filtering out malicious compressed NFT collections

This means that this is not a standard, but a set of guidelines or an example, which in fact will be supported by tonapi&getgems only, because it has no transparent indexing method for new services.

Since the current solution involves paying for indexing to specific services - this is very bad.

If a new wallet enters the ecosystem, it wants to show all the NFTs of a user, but it won't show these, because no collection will carry money to a specific wallet, but there will be disgruntled users who will argue why tonkeeper shows everything and your service don't.

And this works for any new service that would want to support such a thing. When you have atomic payment choices to support a "STANDARD". - it's not good for the ecosystem.

Copy link

@RurikRomanov RurikRomanov left a comment

Choose a reason for hiding this comment

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

👍🏼

@Godeanstreet
Copy link

🙌

@dev4pear
Copy link

cool project!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet