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

Include Rarity/Tier in on-chain metadata Traits #170

Open
austinkline opened this issue Oct 18, 2022 · 5 comments
Open

Include Rarity/Tier in on-chain metadata Traits #170

austinkline opened this issue Oct 18, 2022 · 5 comments

Comments

@austinkline
Copy link
Contributor

austinkline commented Oct 18, 2022

Instructions

Please fill out the template below to the best of your ability and include a label indicating which tool/service you were working with when you encountered the problem.

Issue To Be Solved

TopShot has implemented the NFT Metadata standards which is fantastic! However, there is one very important trait that seems to be missing from which is the rarity of the moment.

Here is a working script to pull traits from a topshot moment

With other similar tickets to pull data that isn't on-chain yet into flow like #167, are there plans to put tier in here as well?

(Optional): Suggest A Solution

Not sure I can give much a solution here right now since I don't know the challenges to doing this, but I am happy to help work that out if possible!

(Optional): Context

Some folks currently pull data from APIs that Dapper owns. These APIs are subject to rate limits and introduce dependencies we would otherwise rather not have. Putting the data on-chain means we have a single source of truth for all traits on an topshot moment rather than having to use multiple sources.

@jrkhan
Copy link
Contributor

jrkhan commented Oct 24, 2022

Hello @austinkline !
I think this turns out to be a bit more involved than #167 as there we had an existing metadata map to backfill. In this case we would need a new resource/contract to hold onto the rarity per moment.
I know something like https://forum.onflow.org/t/flip-cadence-extensions-attachments/3645 would make this a bit more straight forward.
Did you have a time frame in which we needed to have the moment tier?

@austinkline
Copy link
Contributor Author

Hi @jrkhan thanks for the reply, must have missed the notification!

Definitely unfortunate that this is more complex than other backfilled data, I always assumed it would just be an addition to the play metadata.

Did you have a time frame in which we needed to have the moment tier?

The sooner the better, which I know isn't super helpful. To my knowledge there isn't a public api to pull rarity from for topshot moments, which means there isn't a scalable system to pull that data in for all of them.

Extensions would definitely be helpful! Although a timeline in which features like that are out and in use feels pretty far in the future. Is there a good place to discuss how TopShot can bring this data in? Or is it more of a bandwidth issue than anything else?

@austinkline
Copy link
Contributor Author

@jrkhan just following up

In this case we would need a new resource/contract to hold onto the rarity per moment.

Is there a preferred structure to this kind of contract/would folks on your side be amenable to an outside contributor creating it? It sounds like a pretty simple dictionary mapping unless there are "gotchas" regarding the size of the dictionary given how many moments there are in TS and how much it could grow

@jrkhan
Copy link
Contributor

jrkhan commented Nov 14, 2022

Thanks @austinkline

I think a dictionary seems okay - I think it might make sense to have the dictionary keyed by play/set/subedition.
While we have the capability on our backend to have an individual moment override the rarity of the set/play, none currently do so, and there aren't any plans in the near future for this to occur. If this changes in the future we could always add a sparse map of 'overrides' keyed by the individual moment.

Certainly open to outside contribution for this feature - another option would be to create a new label for issues we'd like the Top Shot foundation pod to handle, and we could look to pull it into an upcoming sprint. It think either way, we'll have some work on our side to create a job to backfill rarities for existing moments.

@austinkline
Copy link
Contributor Author

Appreciate the details @jrkhan!

I'd definitely like to drill into how folks at flowty could maybe contribute a contract that can manage this if it isn't in the TopShot pod's sight in the near future. Is there a doc I can reference for how tier is related to play/set/subedition? It sounds like you're suggesting an order where you maintain a few dictionaries and evaluate them in some specific order such as:

  1. overrides (by topshot id or uuid)
  2. play id
  3. set id
  4. subedition id

I'd love to connect and spec this out if folks on your side have the time. Feel free to reach out on twitter of discord (my bio has info) if you're interested!

It think either way, we'll have some work on our side to create a job to backfill rarities for existing moments.

Makes sense yep, data has to be inserted either way 👍

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

No branches or pull requests

2 participants