name: Open Grants Application
about: Lit Protocol's open grant proposal application.
title: 'Open Grant: JS Worker SDK'
labels: 'grants:devtools-libraries'
assignees: ''
Open Grant Proposal: JS Worker SDK
Name of Project: JS Worker SDK
Proposal Category:integration-adoption
Proposer:drpitman76
Do you agree to open source all work you do on behalf of this grant and dual-license under MIT, APACHE2, or GPL licenses?: Yes
Project Description
The JS Worker SDK will be a light-weight JavaScript SDK designed from the ground-up to be drop-in compatible with vanilla JavaScript in the web browser, including within browser service workers. Strict out-of-the-box web standards compliance, small download footprint, zero dependencies, intuitive ease of use and performance will be priorities. It will be available to use directly in the browser as a module via the built-in import statement or the dynamic import() function.
In addition to first-class browser compatibility, it will also be tested and verified to work on poplular non-NodeJS server-side JavaScript runtimes including Cloudflare Workers, Deno() and wasmer.io JS Service Workers.
This project is necessary because the current official JavaScript SDK, while useful and complete, is only suitable to be used within either a NodeJS environment, or within a project which includes a NodeJS-based build step. Many web developers (including myself) do not use such environments, and either prefer to write code which can be directly deployed to serverless environments without external build steps or runtime dependencies, or in some cases can not use those frameworks. Creating an SDK which is compatible with vanilla JS directly opens up Lit Protocol to ALL developers regardless of their server-side or client-side frameworks and runtime environments.
Value
What are the benefits of getting this right?
Opens up Lit Protocol to the entire web developer community by providing a first-class SDK that works directly within all modern JavaScript environments without additional build steps or dependencies. This will significantly lower the barrier to entry and ease of adoption.
The current SDK for direct inclusion in client-side JavaScript as referenced in the documentation is https://cdn.jsdelivr.net/npm/@lit-protocol/lit-node-client-vanilla/lit-node-client.js, this file is 1.9MB in size, which precludes it from being used within the context of a highly performant web application directly. The kind of loading delays that this brings adversely affect an applications Lighthouse scores, which in turn impact SEO performance and end-user satisfaction. A lightweight SDK is required to resolve these issues, ideally one with a download size of less than 10kB, and most certainly less than 100kB. It can be done.
What are the risks if you don't get it right?
Thorough testing will be required to ensure that the SDK performs intuitively as expected, including all features that developers would expect from it, and with full cross-browser support. Any exceptions to this would have to be clearly documented and well justified.
What are the risks that will make executing this project difficult?
The biggest risk is that some features of Lit Protocol will be more difficult than expected to support directly in a vanilla JS environment without Node.js dependencies. While there is no risk that something just won't be possible, there is a risk that the amount of work required will be larger than expected. Thorough planning and modular design will help mitigate this risk. Testing across browsers and environments will also require more effort than a Node.js-only library.
Some support from the Lit team will be required in terms of pointing me in the right direction for the underlying API endpoints and protocols. Without their guidance, some things may take longer to implement correctly and would require reverse engineering, which would lead to a risk of bugs or inconsistencies. Close communication and support from the core team will help mitigate this risk.
Deliverables
A working SDK according to the specifications as above, which captures all the functionality of the Lit Protocol API as documented in https://developer.litprotocol.com/v3 . Along with this, compete SDK-specific documentation on usage, examples on all supported runtimes and integration instructions. It will be available as a repository on Github, and thus also via CDNs such as JsDelivr.
Development Roadmap
Milestone 1: Base SDK Architecture and Ability to Connect to Network Demonstrated
You can expect: This initial milestone will be acheived when the JS Worker SDK exists as a Github repository, along with enough core scaffolding code to outline the intended architecture. A connect() or equivalent function must be implemented to demonstrate successful connection of the SDK to any chosen Lit network. This will be testable via a demonstration page within the repository called connect.html, this page will include the SDK and print a message to the page with connection details once connection has been achieved.
Who will work on it: The sole proposer will work on this milestone.
Funding Required: $1000 USD
Time Required: 1 week
Milestone 2: All Lit Protocol Operations Implemented
You can expect: All Lit Protocol functionality as documented at https://developer.litprotocol.com/v3 will be encapsulated by the SDK, including but not limited to: authentication, encyption and especially Lit Actions. This will be demonstrated by a set of test pages, one for each major area of functionality that will allow testers to call the SDK methods directly and see the raw results.
Who will work on it: The sole proposer will work on this milestone.
Funding Required: $4000 USD
Time Required: 4 weeks
Milestone 3: Browser Testing and Optimzation including Service Workers
You can expect: Testing on all major browsers, including mobile browsers to ensure seamless compatibility across device ecosystems. Further peformance optimization will be done to ensure that the SDK does not hold back applications using it from achieving 100% Lighthouse performance scores. This will be demonstrated by revising the existing demonstration pages until they consistently reach over 95% (ideally 100% on a best-of-three basis) on all Lighthouse score metrics on both desktop and mobile modes - screenshots of the test results will be made available in the repository. Also a service such as BrowserStack will be used to ascertain performance on major devices and browsers, with screenshots of the load test results from there also being made available.
Who will work on it: The sole proposer will work on this milestone.
Funding Required: $2000 USD
Time Required: 2 weeks
Milestone 4: Server-Side Runtime Testing
You can expect: small demonstration applications will be created: one for each of browser service workers, Cloudflare Workers, Deno() and wasmer.io (as a JS Service Worker, not a WASM module). These will demonstrate the full Lit Protocol SDK functionality running server-side on these platforms, as far as makes sense for each runtime. For example, it is likely that authentication is less useful in the purely server-side runtimes than encryption and Lit Actions are. This will be demonstrated via the sharing in the repository of the source code of each application, along with a single page documentation for each demo application, and finally a link to the running example as deployed on the relevant hosting service where relevant.
Who will work on it: The sole proposer will work on this milestone.
Funding Required: $2000 USD
Time Required: 2 weeks
Milestone 5: Documentation and Examples
You can expect: Completed documentation for the SDK along with clear usage examples for all major functionality areas and supported runtimes. Documentation will be made available within the repository itself.
Who will work on it: The sole proposer will work on this milestone.
Funding Required: $1000 USD
Time Required: 1 week
Total Budget Requested
The total budget requested across all 5 milestones is $10,000 USD. This will be used to pay for the development time required to implement.
Maintenance and Upgrade Plans
This SDK will have to be maintained as the underlying Lit Protocol updates, it is proposed that it be upgraded whenever Lit Protocol undergoes a major update. I will check in at least quarterly for minor updates, and ensure that the SDK remains compatible with the latest version of Lit Protocol.
I will personally be using this SDK in several upcoming products with commercial value, so ensuring that this SDK remains updated will be a requirement of keeping those products alive in the long term. The cost of future updates and ongoing maintainance of this SDK can be absorbed as part of the budgets for those products.
No website for this project, will eventually be a Github repository.
Relevant Experience
I have been a full-stack web developer for 20 years, with several years specialising in internal business application development and business system integrations.
Many years ago (2010) I was the author of the first php SDK for the Xero accounting application (the SDK is now obsolete), which is viewable on a now unused github repository: https://github.com/drpitman/PHP-Xero . More recently I was involved in the creation of a number of NFT projects, writing the code to produce the artefacts, the smart contracts and the web site integrations with the contracts and OpenSea.
These days I am focused on building the Element web development framework and its ecosystem. Further information about that is available at https://elementhtml.dev . The benchmarks (at https://elementhtml.dev/docs/overview/benchmarks) show that it outperforms all leading frameworks in both Lighthouse Performance scores and Lines of Code - making it currently the best performing JavaScript framework known today for the metrics tested.
That focus on best practices, performance and lowest possible lines of code for developers to maintain is bought into the creation of this JS Worker SDK. Enjoy!
name: Open Grants Application about: Lit Protocol's open grant proposal application. title: 'Open Grant: JS Worker SDK' labels: 'grants:devtools-libraries' assignees: ''
Open Grant Proposal:
JS Worker SDK
Name of Project: JS Worker SDK
Proposal Category:
integration-adoption
Proposer:
drpitman76
Do you agree to open source all work you do on behalf of this grant and dual-license under MIT, APACHE2, or GPL licenses?: Yes
Project Description
The JS Worker SDK will be a light-weight JavaScript SDK designed from the ground-up to be drop-in compatible with vanilla JavaScript in the web browser, including within browser service workers. Strict out-of-the-box web standards compliance, small download footprint, zero dependencies, intuitive ease of use and performance will be priorities. It will be available to use directly in the browser as a module via the built-in
import
statement or the dynamicimport()
function.In addition to first-class browser compatibility, it will also be tested and verified to work on poplular non-NodeJS server-side JavaScript runtimes including Cloudflare Workers, Deno() and wasmer.io JS Service Workers.
This project is necessary because the current official JavaScript SDK, while useful and complete, is only suitable to be used within either a NodeJS environment, or within a project which includes a NodeJS-based build step. Many web developers (including myself) do not use such environments, and either prefer to write code which can be directly deployed to serverless environments without external build steps or runtime dependencies, or in some cases can not use those frameworks. Creating an SDK which is compatible with vanilla JS directly opens up Lit Protocol to ALL developers regardless of their server-side or client-side frameworks and runtime environments.
Value
What are the benefits of getting this right?
What are the risks if you don't get it right?
What are the risks that will make executing this project difficult?
Deliverables
A working SDK according to the specifications as above, which captures all the functionality of the Lit Protocol API as documented in https://developer.litprotocol.com/v3 . Along with this, compete SDK-specific documentation on usage, examples on all supported runtimes and integration instructions. It will be available as a repository on Github, and thus also via CDNs such as JsDelivr.
Development Roadmap
Milestone 1: Base SDK Architecture and Ability to Connect to Network Demonstrated
connect()
or equivalent function must be implemented to demonstrate successful connection of the SDK to any chosen Lit network. This will be testable via a demonstration page within the repository calledconnect.html
, this page will include the SDK and print a message to the page with connection details once connection has been achieved.Milestone 2: All Lit Protocol Operations Implemented
Milestone 3: Browser Testing and Optimzation including Service Workers
Milestone 4: Server-Side Runtime Testing
Milestone 5: Documentation and Examples
Total Budget Requested
The total budget requested across all 5 milestones is $10,000 USD. This will be used to pay for the development time required to implement.
Maintenance and Upgrade Plans
This SDK will have to be maintained as the underlying Lit Protocol updates, it is proposed that it be upgraded whenever Lit Protocol undergoes a major update. I will check in at least quarterly for minor updates, and ensure that the SDK remains compatible with the latest version of Lit Protocol.
I will personally be using this SDK in several upcoming products with commercial value, so ensuring that this SDK remains updated will be a requirement of keeping those products alive in the long term. The cost of future updates and ongoing maintainance of this SDK can be absorbed as part of the budgets for those products.
Team
Team Members
Developer: David Pitman
Team Member LinkedIn Profiles
David Pitman
Team Website
No website for this project, will eventually be a Github repository.
Relevant Experience
I have been a full-stack web developer for 20 years, with several years specialising in internal business application development and business system integrations.
Many years ago (2010) I was the author of the first php SDK for the Xero accounting application (the SDK is now obsolete), which is viewable on a now unused github repository: https://github.com/drpitman/PHP-Xero . More recently I was involved in the creation of a number of NFT projects, writing the code to produce the artefacts, the smart contracts and the web site integrations with the contracts and OpenSea.
These days I am focused on building the Element web development framework and its ecosystem. Further information about that is available at https://elementhtml.dev . The benchmarks (at https://elementhtml.dev/docs/overview/benchmarks) show that it outperforms all leading frameworks in both Lighthouse Performance scores and Lines of Code - making it currently the best performing JavaScript framework known today for the metrics tested.
That focus on best practices, performance and lowest possible lines of code for developers to maintain is bought into the creation of this JS Worker SDK. Enjoy!
Team code repositories
https://github.com/elementhtml
Additional Information
How did you learn about the Lit Open Grants Program?
From your main website, have been following Lit Protocol for a while with a view to using it within some upcoming projects.
Please provide the best email address for discussing the grant agreement and general next steps.
david.pitman@cloudouble.com
Please include any additional information that you think would be useful in helping us to evaluate your proposal.
Have a great day!