Skip to content

Instantly share code, notes, and snippets.

@thesimplekid
Last active July 1, 2024 19:52
Show Gist options
  • Save thesimplekid/8a20b4ae0964f205202630ce33daad68 to your computer and use it in GitHub Desktop.
Save thesimplekid/8a20b4ae0964f205202630ce33daad68 to your computer and use it in GitHub Desktop.

Application for Spiral Developer Grant to Work on Cashu Development Kit

 

The Cashu Development Kit (CDK) is designed to be a lightweight, flexible, and secure Software Development Kit (SDK) that allows developers to create Cashu applications without having to implement the Cashu protocol themselves. CDK will be written in Rust to harness the security and performance advantages of the language, as well as to ensure compatibility with a wide range of platforms. Additionally, the library will provide support for multiple programming languages through Foreign Function Interface (FFI) bindings to the native Rust core. CDK would enable mobile wallets and mints to share the same codebase. Mobile wallets could integrate the Rust codebase directly or via FFI bindings, this would enable the development of cross-platform Cashu wallets and mints, without the developer having to build Cashu internals.

 


 

Previous Contributions

My previous work has focused on building the Cashu library cdk which is written in Rust. This library implements all of the mandatory Cashu protocol specifications NUTS 00-06, as well as the optional specifications NUTS 07-15. Using cdk, I have implemented a Cashu mint, cashu-rs-mint, as well as a wallet, cashcrab. These two projects demonstrate the potential benefits of a CDK library to allow developers to implement their own Cashu projects without having to implement the protocol from scratch.

In addition to the mentioned Cashu projects I worked on, I am also interested in the intersection of Cashu, Nostr, and lightning. This led me to develop cashu-lnurl, which is a service that allows users to get an lnurl address, and accept payments made to the address as a Cashu token via Nostr direct message. Within the Nostr space, I have contributed to the rust-nostr library, and implemented pay-to-relay for the nostr-rs-relay, among other projects. Nostr has also led me to experiment with Core Lighting plugins; creating two of them: one to broadcast zap notes, cln-zapper-rs, and a second to integrate with NIP-57 Nostr Wallet Connect, cln-nostr-wallet-connect.

 


 

Planned Contribuitions

In order to continue the work I have already done, and increase my capacity to further create in this space, I would like to apply for grant funding. I strongly believe that this funding would allow me to make significant contributions to the Cashu ecosystem. The contributions I plan to make over the grant period are:

CDK 1.0

I plan to stabilize the API of CDK and release a version 1.0. Before releasing 1.0, I would include an integration test suite against the Cashu reference implementation Nutshell. I plan to use Nix to make tests simple to run and to be reproducible across different development environments. In addition to improving the library test suite, I would also improve the library's documentation to ensure developers can use it as efficiently as possible, using Rust's in-code documentation, as well as usage examples.

Language Bindings

In order to allow CDK to be used by developers in their chosen language and platform, I would implement FFI and WASM bindings. Work on this has already been started in cdk, but significant improvement needs to be made in the areas of testing and examples for each language binding. Initially, support for Kotlin and Swift will be targeted to enable CDK to be used in native Android and iOS apps. This would later be expanded to include more languages for integration into other ecosystems like NodeJS and C#. These bindings would enable both wallets and mints to be built in multiple languages while using the core Rust CDK Cashu implementation. This helps to ensure the correctness of the application as they do not have to implement the protocol itself. This enables application developers to focus on features that add to user experience and not the internal protocol code, allowing the Cashu ecosystem to develop more quickly and deliver a better experience to the end user.

Implementation

To demonstrate the capability of the library, I would create a reference mint implementation using the CDK library by re-implementing cashu-rs-mint to use CDK and bringing it up to a production-ready, easy to deploy mint. In order to showcase the wallet functionality of CDK, I would create a CLI wallet in Rust.

Collaboration

While working on this proposed project, I plan to increase my collaboration with other developers in the Cashu space in multiple ways. First, I will increase my participation in Cashu protocol design and review of protocol changes for example working on the great protocol cleanup. One specific area within NUTS that I would like to improve is the coverage of test vectors, which would ensure that implementations, including CDK, correctly follow specifications. A second area in which I would like to help improve is mint error response. Currently, these are not standardized. This makes ensuring that a wallet handles errors correctly difficult, which I have encountered myself when implementing a wallet. This has also been discussed in developer calls, and is a space for collaboration with other developers.

 


 

I am very excited for the opportunity to continue contributing to the Cashu and Bitcoin ecosystem, and confident that with this grant I would do valuable work in this space. Please feel free to reach out to me with any questions through the contact information included below. Thank you for your time and consideration.

 


 

Contacts:

Github: thesimplekid
Nostr: npub1qjgcmlpkeyl8mdkvp4s0xls4ytcux6my606tgfx9xttut907h0zs76lgjw
twitter: thesimplekid
Email: tsk@thesimplekid.com

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