Building a Command Line Interface for Gitcoin Passport
This is an updated version of my previous proposal. This revised version is based on feedback I’ve received from the Gitcoin community, and a very helpful conversation recently with members of the Gitcoin Passport dev team.
Also, the project is now live on Grants Stack here.
Passport CLI – A command-line tool for Gitcoin Passport (v0.3)
Description
This proposal seeks funding to build a command-line interface (CLI) tool for Gitcoin Passport. The purpose of this tool is to simplify and streamline interaction with the Gitcoin Passport API for developers, and to enhance the overall developer experience for Gitcoin Passport.
The first version of the Passport CLI tool will essentially provide a wrapper for Gitcoin Passport’s existing API functions, to help devs work with Passport’s API without having to write custom applications or scripts.
More specifically, this tool will leverage Gitcoin Passport’s API to allow users to fetch passport scores, fetch stamps for a given Ethereum address, claim web3 stamps, and more, all from their terminal!
Impacted Stakeholders and Expected Outcomes
Developers who seek to build with Gitcoin Passport will benefit from improved productivity and an enhanced development process by using Passport CLI.
Passport CLI will allow developers to access Gitcoin Passport’s API without having to write a script or custom software to fetch user Stamps, submit an address for scoring, and to fetch the Passport score for one or more addresses. The Passport CLI will also allow developers and users to claim web3 stamps via the command–pretty cool!
Additionally, the Gitcoin community will experience increased accessibility and usability of Gitcoin Passport via Passport CLI. This command-line tool will provide a more accessible experience to users who are vision-impaired, as CLI tools work better with screen readers, compared to graphics-rich web interfaces.
Expected outcomes include a boost in Gitcoin Passport’s adoption and a strengthening of its network effects. Passport CLI will be the first tool built in the Gitcoin Passport ecosystem that is built expressly to serve the needs of developers.
Lastly, I have spoken to members of the Gitcoin Passport dev team and they have expressed excitement and support for this project.
Motivation
As a developer actively involved in the Gitcoin community, I’ve identified the need for easier access to Gitcoin Passport’s functionalities. This tool will simplify developers’ interactions with the platform, enhancing productivity and engagement. I assure there are no conflicts of interest with this proposal, and any future concerns will be transparently addressed.
Why the Citizen Grants Program Should Adopt the Proposal
This proposal has been created specifically with Gitcoin’s Essential Intents in mind.
At a glance, the benefits of adopting this proposal and funding the development of the Gitcoin Passport CLI tool are:
-
Prioritizing the developer community by providing tools that empower developers to contribute more effectively.
-
Contributing to financial longevity of the Gitcoin ecosystem by supporting the development of utilities that enhance Gitcoin Passport’s value.
-
Enhancing the network effects of Gitcoin’s current developer ecosystem by streamlining the developer experience and fostering product adoption. One success metric for the project is to be responsible for onboarding 100 new developers to the Gitcoin Passport developer ecosystem over the next six months.
The Citizen Grants Program should back this initiative because it directly supports Gitcoin’s goal of fostering a thriving developer ecosystem. By reducing barriers and improving accessibility, the Passport CLI tool will attract new developers and enhance the productivity of existing ones. This adoption is essential for nurturing innovation within the Gitcoin community, ensuring its growth and relevance in the blockchain sector. The proposal presents a strategic opportunity to strengthen the Gitcoin ecosystem by making it more welcoming and efficient for developers.
Furthermore, the proposal responds to a clear demand within the community for more efficient ways to interact with Gitcoin Passport, demonstrating Gitcoin’s responsiveness to user needs and its dedication to innovation.
By building on the existing infrastructure of Gitcoin Passport and utilizing its public APIs, the Passport CLI tool represents a practical and strategic opportunity to enhance the Gitcoin ecosystem.
Challenges
-
Deploying the Passport CLI will require ongoing maintenance and updates to keep Passport CLI function and aligned with Gitcoin Passport. In the event of any breaking changes to Gitcoin Passport’s API, Passport CLI will need to be updated accordingly. As a part of this proposal, we will co-create a maintenance plan with members of the Gitcoin Passport dev team, which will provide a written protocol in regard to keeping the Passport CLI functional and working, in the event of Passport API breaking changes.
-
Authentication and Signature Generation: A significant technical challenge identified is handling authentication and signature generation for interacting with the Gitcoin Passport’s API. One example of this is that we will need to generate signatures with a user’s wallet, possibly requiring interaction with browser wallet extensions or external tools for signing.
-
Claiming Stamps: Another challenge involves claiming stamps, especially concerning OAuth for Web2 stamps and the authentication flow that might require a browser interaction for user consent. This presents a potential hurdle for a purely CLI-based tool.
We will work closely with the Gitcoin Passport dev team via regular video calls (weekly or bi-weekly) to align with the mission of Gitcoin Passport and Gitcoin’s Essential Intents, and to implement robust solutions for these challenges.
Specifications
This project will be built using Node and TypeScript, with the goal of closely mirroring the tech stack of Gitcoin Passport.
Additionally, we will use the Commander.js library to implement the core command line functionality.
We will utilize environment variables for API key management, emphasizing security through the principle of least privilege. This includes running the CLI tool with user-level permissions, implementing secure API key entry to prevent exposure in command history, and ensuring files generated by the tool have restricted access.
Additionally, we plan to encrypt sensitive data at rest using Node.js’s crypto library and secure data in transit with HTTPS, offering guidance on securing .env files against unauthorized access.
The Gitcoin Passport CLI Tools will be installable via npm and designed to support a wide range of functionalities through a user-friendly command-line interface.
Proposed Feature Set
This feature set was derived based on feedback from Gitcoin Passport users and from members of the Gitcoin Passport dev team.
Category 1: Standard Features (Utilizing Public APIs)
Submit a Wallet Address for Scoring
- Command Name:
submit-passport
- Usage:
passport-cli submit-passport --address <address> --scorer_id <scorer_id> [--signature <signature>] [--nonce <nonce>]
- Description: Submits an Ethereum address to the Scorer for passport scoring. Initially returns a status of PROCESSING or DONE. For PROCESSING status, the score computation is underway and the status can be checked by querying the score with the scorer ID and address.
- Passport API endpoint:
POST /registry/submit-passport
Fetch User Stamps
- Command Name:
get-stamps
- Usage:
passport-cli get-stamps <address>
- Description: Retrieves and displays a user’s verified stamps.
- Passport API endpoint:
GET /registry/stamps/{address}
Fetch Passport Score for an Address
- Command Name:
get-score
- Usage:
passport-cli get-score <scorer_id> <address>
- Description: Retrieves and displays the Passport score for a specific address as per a given scorer ID.
- Passport API endpoint:
GET /registry/score/{scorer-id}/{address}
Fetch Passport Scores for All Addresses
- Command Name:
get-all-scores
- Usage: passport-cli
get-all-scores <scorer_id> [--limit <limit>] [--offset <offset>] [--gt <timestamp>] [--gte <timestamp>] [--order <order>]
- Description: Retrieves Passport scores for all addresses associated with a specific scorer. Supports pagination, and filtering scores based on timestamps, with the ability to order results.
- Passport API endpoint:
GET /registry/score/{scorer-id}/
Fetch Score History
- Command Name:
get-score-history
- Usage:
passport-cli get-score-history <address> [--timestamp <timestamp>]
- Description: Obtains a historical view of scores based on timestamp and optional address.
- Passport API endpoint:
GET /registry/score/{scorer-id}/history
Fetch Stamp Metadata
- Command Name:
get-stamp-metadata
- Usage:
passport-cli get-stamp-metadata
- Description: Gathers metadata for all stamps available in the Passport ecosystem.
- Passport API endpoint:
GET /registry/stamp-metadata
Retrieve GTC Stake Amounts
- Command Name:
get-gtc-stake
- Usage:
passport-cli get-gtc-stake <address> <round_id>
- Description: Fetches GTC stake amounts related to the GTC Staking stamp.
- Passport API endpoint:
GET /registry/gtc-stake/{address}/{round_id}
Category 2: Advanced Features
Claiming New Credentials
- Command Name:
claim-credentials
- Usage:
passport-cli claim-credentials
- Description: Streamlines the process of claiming new credentials for Passport users. (Note: This command’s implementation will depend on further collaboration and access to internal APIs.)
- Note:
- For the first version of Passport CLI, we will focus on claiming web3 credentials, as claiming web 2 credentials must be done via oAuth and is beyond the scope of this proposal.
- The ability to claim web 2 credentials will be built into a later version of Passport CLI.
Saving to Centralized Storage/Ceramic
- Command Name:
save-credentials
- Usage:
gitcoin-passport-cli save-credentials [--storage-type <type>]
- Description: Enables saving credentials to centralized storage solutions or the Ceramic Network. (Note: Similar to claim-credentials, the feasibility of this command is subject to collaboration outcomes and API availability.)
These command names are designed to be intuitive and reflective of their respective functionalities, providing a user-friendly interface for developers to interact with the Gitcoin Passport ecosystem efficiently.
For further description of the Gitcoin Passport API, see Passport’s API reference and the API playground.
Timeline and Milestones
- Development of Standard Features (6 weeks): Implement, test, and refine Category 1 features.
- Documentation and Initial Launch (2 weeks): Finalize documentation and officially launch the tool with Category 1 features.
- Advanced Features Development and Collaboration (3 weeks): Develop Category 2 features based on collaboration outcomes with the Passport team.
Deliverables
- Passport CLI Tool: A fully functional CLI tool capable of interacting with Gitcoin Passport APIs. Can be installed via NPM.
- Comprehensive Documentation: Detailed setup instructions, usage guides, and examples.
- Source Code: Well-documented and maintainable source code, hosted on GitHub.
- Maintenance Plan: We will work with the Gitcoin Passport dev team to create a maintenance plan for Passport CLI.
Budget Estimate
- Total Estimated Cost: $9,000
- Research and Planning: $1,500
- Development and Testing: $5,000
- Documentation and Launch: $2,500
This revised budget accommodates a more comprehensive planning phase, detailed development and testing of features, and the production of thorough documentation.
Importance of Collaboration
Collaboration with the Gitcoin Passport development team is vital, particularly for the advanced features in Category 2.
We have a verbal promise from members of the Gitcoin Passport dev team to provide periodic guidance to this project, in the form of weekly or bi-weekly video calls to review the progress of this project.
This partnership ensures the CLI tool’s alignment with Gitcoin Passport’s API stability and future roadmap, laying a strong foundation for its continuous enhancement.
Measures of Success and KPIs
-
Developer Adoption Rates: Targeting 200 unique users to install the Gitcoin Passport CLI Tool within the first six months.
-
User Satisfaction: Achieving an 80% satisfaction rate in post-launch surveys.
-
Contribution to Gitcoin Passport’s Network Effects: Qualitative feedback on increased engagement and adoption.
Non-Financial Requirements
-
Insight and collaboration from members of the Gitcoin Passport development team for advanced feature integration. Ideally, members of the Gitcoin Passport product team as well.
-
Community feedback and testing to refine the tool pre and post-launch.
Conclusion
The Gitcoin Passport CLI tool project will be the first tool built specifically for developers in the Gitcoin Passport ecosystem!
Building Passport CLI will boost the network effects within the Gitcoin ecosystem, foster dev community engagement, and contribute to Gitcoin’s mission of building and funding public goods.
By initially focusing on public API functionalities and planning for advanced features, this proposal aims to deliver a valuable tool that significantly enriches the developer and user experience.
Thanks for reading! Obviously I will be replying here in the comments, and you can also dm me via Discord or Telegram–I’m @alexdw5.