passportxyz / passport

Passport allows users to prove their identity through a secure, decentralized UI
Other
981 stars 456 forks source link

Model Based Detection #2246

Open erichfi opened 8 months ago

erichfi commented 8 months ago

Model Based Detection API Roadmap

Objective: This roadmap outlines the strategic plan for the phased expansion of the Model Based Verification API. The aim is to integrate additional models to provide nuanced verification services, allowing developers to verify user integrity without direct user action.

Current Implementation:

Planned Models:

Later:

Issues to Include:

  1. Integrate zkSync and NFT Scoring Models into API Analysis Endpoint

    • Issue ID: #2459
    • Description: Integrate zkSync and NFT scoring models into the existing API analysis endpoint to enhance verification capabilities.
    • Include OP and Polygon too.
    • Maybe have a parameter to specify which models you care about
    • Rate limit per request or per model request?
  2. Evaluate Operational Costs for zkSync and NFT Scoring Integration in API

    • Issue ID: #2460
    • Description: Analyze the operational costs associated with the integration of zkSync and NFT scoring models into the API to ensure cost-effectiveness and sustainability.
  3. Setting up Separate Rate Limits for the Endpoint

    • Issue ID: https://github.com/gitcoinco/passport/issues/2540
    • Description: Implement rate limits for the new endpoint to manage usage effectively while allowing flexibility for future adjustments. The initial rate limit should be reasonable, with potential for future adjustments. For example, X calls per day or Y calls per month.
    • Separate ratelimits on MBD from rest of APIs.
    • Stricter rate limits on MBD with two tiers.
      • @lebraat two put together recommendations for the lowest limit and higher limit.
      • will communicate costs of api call per model

Considerations and Best Practices:

Open Questions:

Timeline and Milestones:

Collaboration and Feedback:

Jkd-eth commented 6 months ago

@erichfi per a conversation with @lebraat today. I think we should add the NFT & L2 activity models to the endpoint sooner than later, so what we can test them as part of the 'beta' and then determine changes to be made + the aggregate score or model after

erichfi commented 6 months ago

@Jeremy-Gitcoin, acknowledged. Let's discuss more.

erichfi commented 5 months ago

Issues to include:

lebraat commented 5 months ago

Hey team!

Had a chat with Kyle today and came up with a baseline rate limit that we are both pretty comfortable with.

I recommend that we also introduce a couple additional rate limits so that we can keep partners on a short leash if they want an elevation. I believe this will help us as we test out different pricing options, by not letting partners get used to high limits.

Tier 2 and 3 are the same as the higher tiers that we've set for the Passport API, while the base tier is set to 50 requests per 15 minutes. I feel like tier 2 would be great for smaller campaigns, while tier 3 would effectively support larger.

Tier Rate limit Maximum requests per day
Base Tier 50 requests per 15 minutes 4800 requests per day
Tier 2 350 requests per 15 minutes 33600 requests per day
Tier 3 2000 requests per 15 minutes 192000 requests per day

One key requirement will be that these rate limits will be completely separate from the Passport API.

Thoughts?

erichfi commented 5 months ago

At least for internal purposes, we should get a bulk scoring function into model based detection APIs. E.g, submit CSV and then get the scores back.