Upgrading SRI
I spent most of October upgrading Hashpool to run on SRI 1.5.0. I have been experimenting heavily with AI assisted software development as a tool to increase my productive output. In the old world I would have rebased my project on top of the latest SRI version. When I asked my coding agent to do this it quickly gave up and declared the task too difficult to continue. I regrouped and started with a new approach: extract as much logic as possible from the SRI codebase and then reimplement it on top of SRI 1.5.0. I spent most of October extracting Hashpool logic from stock SRI crates while preserving feature parity with no regressions. You can see this work in the sri_1.2.0 branch. (Note: all previous hashpool commit dates were reset to Oct 2nd when I rebased on top of SRI 1.2.0.)
In late October I was ready to retry the migration. With a new development plan in hand I set the LLM loose rewriting all Hashpool logic on top of the latest SRI version. In my experience, LLMs really excel at tasks where they can look at an existing codebase and synthesize a new code diff based on it. This approach is destructive to the commit history of a project but for a pre-alpha project with no prod deployments, no users, and only a single contributor it is well worth it for the development speedup. I worked primarily on the migrate/sri-1.5.0 branch and merged the new core protocol crates to master in this commit and continued reimplementing features, roles, and fixing bugs for another week. By October 28th I was minting ehash on the new master branch. A few days later, right before Halloween, I had achieved feature parity. w00t!
The new architecture is significantly improved. It introduces new protocol crates for ehash, mint quote, stats, and constants. This architecture isolates hashpool business logic from the SRI logic and should smooth the way for future upgrades. I also upgraded the mint role and new Sv2 extension messages to use noise encryption, message framing codecs, and have proper version bits (still not yet officially registered with the SRI organization).
First SRI Contribution
In the process of reimplementing Hashpool on SRI 1.5.0 I found and corrected this bug in upstream SRI. It feels good to finally be a contributor to that project after building on it for over a year! \o/ I had actually identified a number of other bugs in the SRI 1.2.0 version but I either didn't need to fix them or had not attempted to upstream the fix because I was over a year behind the latest SRI release. After the Hashpool SRI 1.5.0 upgrade was deployed I went back to see if any of those bugs were still valid and, fortunately, the SRI team had squashed them all. Noice!
Durham Conference
In November I hosted a btc++ conference in my local community: Durham, NC. I delivered the Hashpools - One Year Development Update presentation and facilitated a forum for many of the bitcoin builders from my community and neighboring communities to present their work. It has long been a dream of mine to put North Carolina on the bitcoin map and this feels like a big step in the right direction. I have had many folks reach out to me to say how much they enjoyed the event and to ask about the next one. I don't know what brand or format we will use next year but I am excited to make it a regular occurrence.
Cashu Contributions, Interrupted
I also contributed to the cashu ecosystem in this timeframe. In early October I merged an optimized balance calculation PR to the cdk library. This helps the wallet calculate its current balance more efficiently by performing the summation operation in the SQL query rather than retrieving all proofs and calculating the sum at the application layer.
After I completed the Hashpool migration to SRI 1.5.0 I turned my attention to a longstanding cashu spec improvement: batched quote minting. Egge had begun this work some time ago but it languished and progress stopped. This improvement to the cashu spec is an important efficiency upgrade for both Hashpool and npub.cash, which queue up mint quotes to be swept asynchronously by the user wallet. They currently require a separate API call for each quote, which adds up quickly when you are sweeping a large number of nostr zaps or mining share quotes. In practice, this behavior looks exactly like a DOS attack on the mint. The new design enables all quotes to be swept from the mint in a single API call, avoiding service disruptions caused by mint rate limits.
I volunteered to own the project to completion. I was able to build a cdk implementation, merge it into the hashpool cdk branch, and deploy it to the testnet4 pool. I was working to improve the spec in this PR when I was forced to stop all work due to external factors. Egge has taken over work on this spec, as you can see at the end of the PR comment section. This is unfortunate because this was my first real specification work on the cashu team and I was poised to learn a lot about the spec process and contribute important work that benefits multiple projects, including my own.
Looking Forward
I was able to complete the SRI 1.5.0 migration and am pleased with how that work went. The SRI team is outpacing me, though. They just recently released SRI 1.7.0 so I have another migration to look forward to. I think my work in isolating the hashpool logic will pay dividends with each new migration. Hopefully, getting to a place where I am just updating version numbers in the cargo.toml files.
I sidetracked Hashpool work when I volunteered to own the batch minting cashu spec. I made this decision to gain experience with protocol specification and contribute back to another project I am building on top of. It kills me that I was unable to complete that work, but it does mean that I can get back to my primary mission: building a first rate, modern mining pool stack for small miners that unlocks ehash pool payouts.
The VPS I was using to run the testnet instance expired while I was away so I look forward to spinning up a new one with a fresh install. This will enable me to clean up some of the cruft from the evolution of the original installation. I will likely find room to improve the deployment scripts in this process.
I also think I should cut a 0.2 version. The project has evolved very significantly from the 0.1 version. I know there are probably quite a few people concerned about my well being and that of the project. Cutting a new release sends a clear signal that I'm back in action. Hashpool development may be delayed but it's not going to stop.
I look forward to making progress on payouts. This is a large undertaking that involves many new components:
- aggregator pool payouts
- standing up an ldk lightning node at the mint
- test framework to direct pool payouts to the lightning node
- test framework to open lightning channels
- mint keyset rotation
- update ehash currency unit
- close out old currency unit
- enforce ehash epoch expiration
- ehash -> ecash swaps
- and finally, building ecash -> lightning payouts