Skip to content

Instantly share code, notes, and snippets.

@aulneau
Created January 6, 2023 16:31
Show Gist options
  • Save aulneau/2a917b3301f6fab40b97469d210fc22b to your computer and use it in GitHub Desktop.
Save aulneau/2a917b3301f6fab40b97469d210fc22b to your computer and use it in GitHub Desktop.

Stacking Club 2.1 grant request

tl;dr: Fungible Systems is requesting $90k USD in funding to continue work on stacking.club. This will support the following objectives:

  • Creating a new, updated backend service (indexer and REST API)
  • Creating documentation, clients, and a status page for the new backend services
  • Updating the existing frontend to support the new API service
  • Open sourcing the indexing service, REST API service, and existing frontend application
  • Continued maintenance of all related products (ensuring they stay online and fully functional)

Introduction

stacking.club is a valuable resource for the Stacks community, made up of a frontend application and API that allows users to understand how stacking works, access current and historical stacking statistics, and more. However, with the upcoming Stacks 2.1 network upgrade, the services need to be rebuilt in order to continue providing benefit to the community.

This grant request outlines the updates that will be made to the service, including rebuilding the API using chainhooks and exposing it as a public service, as well as updating the frontend application to support the new API. Part of making it a valuable public service means we will produce documentation for each endpoint, easy-to-use JavaScript/TypeScript clients, and a status page for the hosted instance.

These updates will not only ensure that the stacking.club service continues to serve the needs of the Stacks community, but will also provide an open source API that can serve as a template for other projects to learn from.

Objectives

The first objective of this grant request is to build an indexing service using chainhooks that would allow us to track relevant on-chain activity and store it in a database. This will involve determining which events to watch for, writing predicates for our chainhooks instance, and transforming the data into a format that is useful for the stacking.club service. The indexing service is a key component of stacking.club, providing the core functionality and real-time data on stacking activity and allowing users to access current and historical statistics.

The second objective is to expose the indexed data from the database as a REST API using Hono. Hono is an open source API framework that is known for its speed and efficiency, and using it to create the API will ensure that the stacking.club service is able to provide fast and reliable access to the data. The API will be designed to be easy to use and understand, with clear documentation for each endpoint. It will also be made open source, allowing anyone to access and use the code, and even run their own instance of the API if desired. This will provide a valuable resource for other projects looking to build on the Stacks and Bitcoin networks, and will also reduce reliance on a single service provider, making the service more resilient.

The final objective is to update the existing frontend application to support the new API. This will ensure that the stacking.club service as a whole is able to take advantage of the capabilities offered by the Stacks 2.1 network upgrade and continue to provide value to the Stacks community.

Outcomes

  • An open source chainhooks indexing project that serves as the core of the new public stacking.club service
  • An open source REST api powered by Hono
    • OpenAPI documentation on each endpoint
    • Documentation on how to deploy each service
    • JS/TS clients
    • Status page/uptime monitoring
  • Updates to the current stacking.club frontend application to support this new API

Methodology

To achieve the objectives outlined in this grant request, the following methodology will be followed:

  1. Determine which on-chain activity needs to be tracked by the indexing service. This will involve making use of some of the existing indexing code used by the current stacking.club service, as well as doing an audit of all contracts deployed on stacks that make use of stacking.
  2. Write predicates that will alert the indexing service to these events. The predicates will be designed to be as efficient as possible. Predicates are the primary mechanism that allow chainhooks to monitor events and activity on stacks. Ideally, we will make use of a feature not currently available: trait-based predicates. This would make it easy for us to watch for any contracts that implement any trait we care about: pools, pox, etc.
  3. Transform the data into a format that is useful for the stacking.club database. This will involve designing a database schema that is able to efficiently store and retrieve the data, and writing code to transform the raw on-chain data into this format.
  4. Build the REST API using Hono. This will involve designing the API endpoints, writing code to retrieve the data from the database and present it in a useful way, and creating documentation and client libraries to make it easy for developers and users to interact with the API.
  5. Update the frontend application to support the new API. This will involve modifying the existing application to use the new API endpoints and incorporate any new data or functionality made available by the Stacks 2.1 network upgrade.

Timeline and budget

The entire process is expected to take approximately 3 months to complete, with milestone deliverables at the 1.5 month and 3 month marks (ideally ASAP, though). These milestones will include a functional indexing service and a functional API, as well as an updated frontend application to make use of the new services.

The requested amount for this grant is $90,000 USD. This budget will be used to cover the cost of 3 engineers working on the project for a period of 3 months, as well as maintaining the service once it is completed. We kindly request that 50% of payment is made upfront, and the remainder is paid at the completion of the project.

The requested budget will be sufficient to complete the project as outlined in the Methodology section, including building an indexing service using chainhooks, exposing the indexed data as a REST API using Hono, writing documentation, creating clients for folks to use, and updating the frontend application to support the new API. This budget is based on market rates for similar projects and reflects the necessary level of resources to complete the project in a timely and effective manner. Once the project is completed, the budget will also be used to maintain the service, ensuring that it continues to provide value to the Stacks community.

Conclusion

In conclusion, this grant request outlines a plan to rebuild the stacking.club service in preparation for the upcoming Stacks 2.1 network upgrade, in addition to many much-needed updates to make the service reliable for public usage. This will involve building an indexing service using chainhooks, exposing the indexed data as a public REST API using Hono, and updating the frontend application to support the new API. The updates will ensure that stacking.club is able to continue providing value to the Stacks community, and will also create an open source API that can serve as a template for other projects.

The requested budget of $90,000 USD will be sufficient to complete these updates in a timely and effective manner, and will also cover the cost of maintaining the service once it is completed. We believe that the proposed updates to the stacking.club service will greatly benefit the Stacks community and are excited to move forward with this project.

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