Grant Application - Fix BTCPay Zcash plugin

Organization Name

Sunny Allen and the team at Birdcalls

How did you learn about Zcash Community Grants

Zooko told us!

Requested Grant Amount (USD)

$150,000

Project Lead

Name: Sunny Allen

Role: Birdcalls CEO

Background: Sunny Allen is a serial entrepreneur with deep roots in the open source movement, citizen science, and makerspace/hackerspace culture. Now she leads the Birdcalls team building privacy-first software.

Responsibilities: Lead

  • Name: Dr. Aeron Tynes Hammack

Role: Birdcalls Advisor

Background: Dr. Aeron Tynes Hammack is a scientist and software engineer with 25+ years programming and systems architecture experience, with a focus on quantum computing physics and bioinformatics as well as copious amounts of entrepreneurial experience.

Responsibilities: Advisor / Collaborator

  • Name: The Architect

Role: Engineer

Background: The Architect is a software designer with 32+ years programming experience. They are a pragmatic street smarts privacy and security professional who has built multiple custom bitcoin payment systems using the bitcoin core API on the companyā€™s own hardware.

Responsibilities: The bulk of this project will be on them.

Project Details

We propose to take over the BTCPay Zcash module.

Project Description

BTCPay is asking for someone from the ZCash community to take over the Zcash repository.

We propose to take this over, fix it, expand on it, and then document it so that it can be used by the majority of BTCPay merchants.

Proposed Problem

In 2023 we did an analysis of the BTCPay Zcash module and determined that there is zero chance a user without significant IT/dev experience will be able to get the current Zcash module for BTCPay working without new docs / changes to the code. Now BTCPay themselves are calling attention to these problems and asking for someone from the Zcash community to please come fix it.

Proposed Solution

Weā€™ll take over the current repository, fix it according to both BTCPayā€™s current asks and our analysis, expand on it, and throughly document it, so that the majority of BTCPay merchants are able to use it.

Solution Format

Deliverables:

-Ownership taken of the BTCPay Zcash repository

-Best-effort modifications and enhancements to the codebase

-Integration to the docker-compose deployment

-Proper documentation

-Nicholas Dorier is happier with ZCash

Dependencies

BTCPay

Technical Approach

Weā€™ll fix all of these problems identified in our 2023 analysis as well as the critiques listed by BTCPay:

  • Thereā€™s no ZCash section in the wallets area in BTCPay. All other currencies have them as a way to review your wallet / incoming payments / match up invoices / etc. The current implementation shows the ZCash address for purchase.

  • ZCash viewing key is essentially hard-coded into the docker compose file, instead of having a settings page in the admin area like all the other currencies.

  • There does not appear to be support for multiple ZCash wallets, like with other currencies.

  • No support for multiple stores (multiple stores must share the same wallet, as the ZCash plugin hard codes the wallet address into the container).

  • Thereā€™s no setup process for ZCash wallets, like there is with other currencies (when creating a new store, other currencies ask you for wallet info and enable/disable currency support depending on how you provide it).

  • The method documented by Hanh is either incomplete or out of date, and requires using Hanhā€™s custom containers and will not work (at least without modification) with non ZCash currencies. The method documented below includes replacement info / code that works with the most recent version of BTCPay and is compatible with other currencies.

  • The processes below are the result of a lot of trial and error due to poor / missing / outright incorrect documentation on both the parts of BTCPay and the ZCash plugin. There is zero chance a user without significant IT/dev experience will be able to get things working without new docs / changes to the code.

  • We were unable to find any functioning wallet that supports testnet, and so had to run a full zcashd node in order to get some testnet coins to run transactions through.

  • Running a testnet node does not appear to work. Thereā€™s no official documentation for it, and although we did find a docker container by Hanh that is named as if it supports it, that container crashes immediately on startup. Since Hanh doesnā€™t mention it anywhere, weā€™re assuming itā€™s something else.

Upstream Merge Opportunities

NA

Budget

$150,000

Weā€™d like to justify this cost in terms of the overall potential benefit to the Zcash ecosystem. There are many merchants who use BTCPay, including Tesla and Namecheap. Many of these merchants may not be enthusiastic enough about Zcash to take the time to integrate an entirely new payment gateway just for the sake of supporting Zcash. But if the on-ramp is as easy as turning on another module for their existing BTCPay server, thatā€™s a big win for Zcash.

For example, it would be such an easy win if ZCash were a payment option for Namecheap. Namecheap says theyā€™ve taken in more than $73 million in crypto transactions since they implemented BTCPay, and theyā€™ve specifically said theyā€™d like to extend support for more BTCPay payment methods in the future. If ZCash were able to capture just 1% of just Namecheapā€™s historical crypto revenues, that alone would represent an addition of $730,000 worth of ZEC transactions, which would represent a nearly five-fold return on investment for this grant. And there are other significant merchants who already use BTCPay. Thus we think this grant cost is more than justified due to its immediate potential to bring value to Zcash.

Previous Funding Details

We received previous funding from ZCG in 2023 in order to make an in-depth analysis of the BTCPay Zcash module. The accuracy of our analysis is now being echoed and confirmed by BTCPay as they ask for someone from the Zcash community to please come fix it.

Implementation Risks

NA

Potential Side Effects

NA

Success Metrics

This will be a success when the Zcash BTCPay module is able to be implemented by merchants.

Startup Funding (USD)

25,000

We think of this as good-faith funding. Once Birdcalls takes ownership of the BTCPay Zcash repository, our reputation will be on the line to both deliver the fixes and maintain them whether or not Zcash follows through on further milestone payments in the future.

Milestone Details

  • Milestone: 1

Amount (USD): 125,000

Expected Completion Date: 2025-05-01

Deliverables: Usable BTCPay Zcash module

6 Likes

I am not optimistic. I think it is meaningless to fix these. ECC officials only need to improve their mobile and PC wallets, improve SDK and open source code. If the price of ZEC can rise, it will naturally attract attention and more people will use it. Naturally, various merchants will actively join in to support it, rather than passively support it. Now almost no one uses it.

4 Likes

Iā€™d like to challenge the real utility of this. Given that it was broken and we havenā€™t heard of anyone being affected, was this really being used?

We invested on this before and there seems to be no return-of-investment.

I donā€™t like to bargain on grantees and Iā€™m opposed to people ā€œprice dumpingā€ on grant proposals as well since that discourages future presentations of grants creating a hostile environment that generates ā€œlow psychological safetyā€ in our community.

Assuming that your budget is ā€œas low as it can beā€ for the value you are presumably providing, I donā€™t really see how that return of investment you are stating goes beyond a desire, an ideal.

Who are the users that are needing this? How are you going to contact them to actually make them use this software that provenly has had little impact. Could you explain how ā€œit will be different this timeā€?

Iā€™d love to have this working but not just for the sake of it. That apparently has been done before and did not drive any adoption so thereā€™s obviously something else to the problem that we are not addressing and it would be important to find out what it is and actually invest on fixing that.

3 Likes

Is there a way that the BTC Pay server can charge fees to sustain itself? What is the long term goal of this maintenance?

4 Likes

Zcash working in BTC Pay Server is very important. This is the primary self-hosted wallet that businesses use to accept payments across multiple ecosystems today. (see: Namecheap)

The cost feels a bit high though in my opinion. I would be interested to see a quote from @hanh on how much time/funding it would take to update his existing implementation from sapling to orchard, thatā€™s the main thing that needs to be fixed in my opinion.

I have a business, itā€™s very hard to accept Zcash today. BTC Pay Server support would be really nice, this just feels a bit high. What would the cost be for a simpler fix?

4 Likes

For some additional context, this is what businesses are currently presented with when they are looking for a zcash plugin for btc pay: btc-pay-zcash-plugin. This is how the btc core developers view the current contribution: Remove Zcash and Monero from core code

Mobile wallets serve a different user persona than someone who is running an online store. Businesses need a service which can plug into their shops and services without having a degree in computer science. Some (many?) wont care deeply about zec and will instantly sell. It will be something the add to the basket of other coins they accept. The benefits are to ZEC holders who can spend in more places, and to the shop that can make one more sale.

I grant it is hard to estimate how many people would use this plugin based on past usage given that it was not as easy as any other coin. Those metrics will not be known until a proper implementation is done in the new plugin framework AND unified address are enabled.

4 Likes

Agreed. Support this grant :student: :owl: :+1:

1 Like

Iā€™d love to see BTCPay for Zcash be easier to set up for merchants. If a concern is there is no demand and it will gather dust, could one of the milestones be that a certain number of merchants are using it?

Well, I donā€™t see how the situation has changed. The plugin should work now (if it doesnā€™t, we can fix it). This proposal mentions a hypothetical usage increase if merchants use it.
Iā€™m with @_eric , ā€œIf Namecheap uses it, the grant recipient unlocks the fundsā€.
However, the technical work should not depend on the marketing since it is out of the developerā€™s control.

As of a costing from my perspective,

  1. Working with BTC Payserver infrastructure (.NET + dockers) was very unfamiliar to me. Iā€™d rather not do that again.
  2. CI and automated testing should be added (to avoid 1.)
  3. regtest should be added as a runtime flag
  4. orchard and ua seems to be a highly requested feature

All in all, if someone is willing to work with me on 1., I think 2-4 should be ~20k for me. They can add their costing on top of it.

PS: Iā€™d love to see an ongoing grant for a ā€œsalespersonā€ who gets some kind of commission on every successful deployment of zcash + btcpayserver.

6 Likes

some stats i asked AI about (checked those seem correct)

Shopify is hosting over 4 million stores (it has monthly fee, so more active than some other similar services then probably) - and this plugin could in theory make ZEC usable on many of them(but only if the shop owner enables it).

also this sort of plugin would have to be talked about more than the current one, and someone would need to contact bigger shop owners who already support the BTC version.

im not as sure about is the budget size.

3 Likes

btcpayserver comes with a Shopify and woocommerce plugin.

The WC one works with zcash (at least at some point)

my understanding is that Zcash code will be removed soon from the newer version.

old versions might still work but i think people usually use the latest versions of software.

if im wrong correct me.

Altcoins are going to become plugins.

1 Like

Lots of good discussion here today. I want to take a moment to address one theme Iā€™m seeing repeatedly. It was well-stated by Pacu:

To clarify this, hereā€™s what BTCPay is saying about the Zcash plugin:
ā€œThe plugin has never been maintained by the original author @hhanh00, and never integrated to the docker-compose deployment. It isnā€™t documented either. As such, I doubt it is used. . . .I am not sure anybody is actually using it, the reason being that they didnā€™t do one part of the job: Integrating it to the docker-compose deployment.
Unlike the Monero community who was quite responsible, they dropped the code then ran away.ā€

1 Like

It was supported on the zcash forums, something that the BTCPayserver probably didnā€™t know.

@machinesunmachine
Please specify which version of Zcash we are talking about. I didnā€™t find that in the discussion.
Unified Orchard? Transparent?

I reject this completely. In my opinion everything is based on assumptions and the past doesnā€™t paint a good picture either.

If you are so convinced of this idea, then program it at your own expense and build in a fee that refinances the costs when any company use the plugin. For me this is a money grave.

I think it would be good if they develop a ZECPay Server because zcash does not need bitcoin but bitcoin zcash. But I think as soon as there is real application or interest in zcash, developers will come along who will do this for free and refinance it through a fee.

I think the current and further costs for this plugin can be better invested.

4 Likes

@artkor, thanks for this question.

While @hanh said earlier that his version of the btcpay module doesnā€™t currently support Orchard or UA, his codeā€™s constraints wonā€™t limit us moving forward. To clarify what we meant by ā€˜fixingā€™ this module: Weā€™re not just proposing to dockerize and fix the existing code. Though of course weā€™ll use any existing code that is usable, we do think it is likely weā€™ll need to start from scratch. Everything will be done the right way.

We plan to use zcashd as our canonical node to communicate with the network, so weā€™ll be able to receive any transactions that zcashd can, including Orchard and Transparent. Because the userā€™s wallet software may only support certain pools, weā€™ll want to ask the user which pool they want to use for the transaction, and then generate a payment address on that pool. Ideally weā€™ll have a setting in the admin area where the store can specify the default pool (itself defaulting to Orchard), but again the user needs to be allowed to choose it themselves at time of payment.

1 Like

This is a castle in the air.
There is absolutely no reason for namecheap to integrate zcash as a means of payment alongside bitcoin. On top of that, it would only make sense as a shielded means of payment and even if they were to integrate it, there would still need to be users who use zcash and in addition I believe this could lead to legal problems for namecheap for the purpose of taxes and possible prosecution in the event of misuse of the domains, do their customers not have to provide their identity when registering?

It also makes no sense to develop this for a company today that nobody knows if they would even use it. Why donā€™t you first get confirmation if namecheap would even use it. In fact, they should first look for companies that would use it and not burn hundreds of thousands to see who would even participate. They should rather work on a ZECPay server then I would say yes immediately.

Weā€™d like to justify this cost in terms of the overall potential benefit to the Zcash ecosystem. There are many merchants who use BTCPay, including Tesla and Namecheap.

Tesla used BTCPayServer for a brief trial period, performed an audit and contributed some security fixes, but they no longer use it since they stopped accepting bitcoin payments.

$125k is a very high price tag considering @hanhā€™s original BTCPayServer integration grant was for $120k. How much of this would cover technical work, and how much documentation and outreach?

I believe it would make much more sense to fix the existing Zcash BTCPayServer plugin rather than create a whole new integration on top of zcashd. Best to stick to the lightwallet RPC client implementation, and users can optionally host a Zebra node and lightwalletd server as part of this stack. Starting from scratch should be avoided as much as possible. If it is necessary, there should be a detailed technical breakdown of why it has to be done.

Thereā€™s no ZCash section in the wallets area in BTCPay. All other currencies have them as a way to review your wallet / incoming payments / match up invoices / etc. The current implementation shows the ZCash address for purchase.

Some technical details about how multiple account integration can be implemented would be nice, together with how this would scale. Zecwallet Lite used to support multiple accounts/viewing keys, but this can lead to significant performance problems in the long run.

Running a testnet node does not appear to work. Thereā€™s no official documentation for it, and although we did find a docker container by Hanh that is named as if it supports it, that container crashes immediately on startup. Since Hanh doesnā€™t mention it anywhere, weā€™re assuming itā€™s something else.

A lightwallet server needs to be run on testnet together with Zebra/zcashd. Lightwalletd Instance Setup Guide ā€” Zcash Documentation 6.1.0 documentation ā€“ Launch lightwalletd, port 8232 is mainnet; 18232 is testnet. I believe the testnet faucet is down, but you can obtain some TAZ with help from Discord Support ā€“ Testnet Guide ā€” Zcash Documentation 6.1.0 documentation

Alternatively, you can test on mainnet with small ZEC payments by changing this line ā€“ zcash-walletd/src/main.rs at main Ā· elemental-pay/zcash-walletd Ā· GitHub

While Iā€™m not proficient in C# or .NET, I know some Java and could probably hack some stuff together. Iā€™m pretty familiar with Docker. I managed to fix the Zcash integration crash in BTCPayServer 2.0 by backporting Monero UI code. I think 20k would be very reasonable and Iā€™d be happy to collaborate with @hanh with 1. If there are any experienced .NET developers interested in contributing/testing, that would be great too! @aarnott

A more up-to-date zcash-walletd RPC could be used for other apps/payment processors also and could make for a nice stack together with Zebra/Zaino. Would it be much work to use Warp Sync libraries/bindings for zcash-walletd?

1 Like