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

[Proposal] Integrate RabbitHole as a Data Provider #1436

Open
ZKentin opened this issue Mar 3, 2023 · 11 comments
Open

[Proposal] Integrate RabbitHole as a Data Provider #1436

ZKentin opened this issue Mar 3, 2023 · 11 comments
Labels
Data Provider Contribute to Sismo Hub by creating a new Data Provider

Comments

@ZKentin
Copy link

ZKentin commented Mar 3, 2023

Integrate RabbitHole as a Data Provider will enable to create new Groups from holders of a specific RabbitHole Quest NFT.

Specifications

{
  "name": "RabbitHole",
  "iconUrl": "",
  "providerClassName": "RabbitHoleProvider",
  "functions": [
    {
      "name": "Get holders of quest NFT",
      "functionName": "TODO",
      "countFunctionName": "TODO",
      "description": "Returns all holders of a specific RabbitHole quest",
      "args": [
        {
          "name": "quest",
          "argName": "TODO",
          "type": "string",
          "required": "true",
          "example": "TODO",
          "description": "A specific quest identifier"
        }
      ]
    }
  ]
}

Tips on how to integrate the Data Provider

RabbitHole NFTs are non-transferrable ERC-721 NFTs.

All contracts are deployed with the same addresses on Goerli, Mainnet and Optimism.

It is important to rely on the Quest Id from RabbitHole Receipt NFT contract address to extract the list of addresses.

They don’t have an API, so the easiest way is by using BigQuery & Etherscan.

Have a look at Sismo documentation to understand what is a Data Provider, and checkout the tutorial to know how to integrate a Data Provider.

Have fun!

@ZKentin ZKentin added the Data Provider Contribute to Sismo Hub by creating a new Data Provider label Mar 3, 2023
@sampolgar
Copy link
Contributor

I can see they're on Polygon too https://polygonscan.com/token/0xec3a9c7d612e0e0326e70d97c9310a5f57f9af9e

@MartinGbz
Copy link
Contributor

Hey @sampolgar , good catch!
I also verified and indeed some of their quests can sometimes be minted on Polygon too!
So you also need to fetch these addresses :)

@sampolgar
Copy link
Contributor

Copying correspondence here from DM

Current options are either Dune or Alchemy or others we haven't looked into
Alchemy needs to query 100 NFT at a time to loop through and retrieve NFT metadata info for filtering - this takes a long time 30 mins - 1 hour and many API call.
Dune is simple, I created a Dune Analytics query https://dune.com/queries/2452001 but it can be expensive to run if many people are running it
The Quest ID is part of the NFT metadata therefore, not available in an RPC provider or Big Query, etc. This is also unavailable from ANKR. This is my understanding, I could be wrong
Current breakdown between chains is approx
Polygon: 40,000
Optimisim: 206000
Ethereum: 4800
I'm waiting for next steps

@polux0
Copy link

polux0 commented May 10, 2023

Hey, @sampolgar, @MartinGbz! Just wanted to notify you that I'll be finishing integration ( https://github.com/polux0/sismo-rabbithole-provider )

Any advice/comment is more than welcome :)

@MartinGbz
Copy link
Contributor

MartinGbz commented May 19, 2023

@sampolgar Just a precision, this can be done with BigQuery (we can get the questId with BigQuery) but the main problem is that BigQuery is not available on Optimism.
I'll keep this issue open, in case someone find another solution.

@MartinGbz
Copy link
Contributor

Hey @polux0 sorry for the late answer,
I saw that you make your own repo for this, did you follow our technical documentation or our Tutorial to do it?
Because your repo is not a fork of the Sismo Hub, so you can't create a PR on it, so it's complicated for me to review your work.
Can you make a fork of the Sismo Hub, integrate your change to it (following the instructions of the docs), and then create a PR?
Thanks! 😁

@sampolgar
Copy link
Contributor

@MartinGbz is Sismo wanting "holders of the token" or "addresses that completed a certain quest" - because holding the token doesn't necessarily mean they've completed the quest (because a user could buy the token)

@MartinGbz
Copy link
Contributor

We want only the holders of the tokens (not the addresses that completed the quest)

And, for info: I've just noticed that there is a questIdForTokenId function in the contract. So maybe this can work:

  • get all tokens from all chains with their associated tokenId
  • for each tokenId call questIdForTokenId so we can map a tokenId for a questId
  • then filter the tokenId with the questId asked

But I don't know the cost of doing this in time (we can use ANKR RPC it's fastest with the API key)

@sampolgar
Copy link
Contributor

ANKR can call 90,000 call per minute: #1434 (comment)
So approx 2 minutes

@MartinGbz
Copy link
Contributor

Okay so let's do it like this!

@MartinGbz
Copy link
Contributor

📢 Recap and Current State of the Issue - Integrating RabbitHole as a Data Provider

🔧 Previous Solutions & remarks (last month by sampolgar):

  • RabbitHole is also on Polygon.
  • Alchemy requires querying 100 NFTs at a time which takes a long time (30 mins - 1 hour) and many API calls.
  • Dune is simpler but can be expensive.
  • The current breakdown between chains is approx. Polygon: 40,000, Optimism: 206,000, Ethereum: 4,800. So we can't use Big Query because optimism is not available on it.

🛠 Side Integration Work (last month by polux0):

Polux0 has been working on the integration and has created a separate repository for it.
But the repo is not a fork of the Sismo Hub, so it need to be one in order to then create a PR.

🔍 Solution found (3 weeks ago by sampolgar and MartinGbz):

Sismo needs "holders of the tokens" not "addresses that completed a certain quest".

A possible solution:

  • Get all tokens from all chains with their associated tokenID
  • For each tokenID, call questIdForTokenId to map a tokenID to a questId
  • Filter the tokenID with the questId asked.

ANKR can be used as it can make 90,000 calls per minute. So the group generation will be around 2 minutes, which is ok.

👉 Next Steps:

  • Implement the solution discussed by @MartinGbz and @sampolgar for mapping tokenID to questId and filtering.
  • Looking forward the @polux0 solution

Thank you all for your valuable inputs and collaboration! 🙌
Looking forward to getting this integration finalized.

If there are any further suggestions or ideas, please share them here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Data Provider Contribute to Sismo Hub by creating a new Data Provider
Projects
None yet
Development

No branches or pull requests

4 participants