Upgrade BTCPayServer Zcash Plugin for 2.1

Project Description

Fix the Zcash BTCPayServer plugin in preparation for 2.1, publishing a working version of the new extracted plugin. A BTCPayServer plugin will be published both to the BTCPayServer plugin store, together with a .btcpay bundle on GitHub. An updated version of zcash-walletd will be published with tested and working Sapling support.

Orchard support can be added with a separate grant focusing on zcash-walletd. This can be worked on in parallel. Documentation will also be published, helping merchants to add ZEC to their BTCPayServer store.

The goals are to increase the amount of merchants accepting Zcash, allowing for Zcash holders to spend their ZEC more easily without having to convert to other cryptocurrencies first. Merchants will also be able to market their privacy friendly practices and better comply with privacy regulations such as GDPR, reducing the amount of data collection that they will be responsible for.

Total Budget (USD)

$21,600

Full grant application: Grant Application - Upgrade BTCPayServer Zcash Plugin for 2.1 · Issue #35 · ZcashCommunityGrants/zcashcommunitygrants · GitHub

13 Likes

I support this :+1: :shield: :factory_worker:

7 Likes

we would be user of this at NYM

7 Likes

@1337bytes at the most recent meeting, the @ZcashGrants Committee voted to approve this proposal. Congratulations!

ZCG requests that you provide monthly updates via the forum in this thread.

8 Likes

Thanks! Am excited to continue working on this and look forward to collaborating with merchants on integrating Zcash payments with BTCPayServer.

These tasks are now complete, as part of the startup funding (milestone 0) tasks:

I have created a btcpay-zcash GitHub organisation: btcpay-zcash · GitHub . This organisation will be jointly controlled by me (with the role of repository maintainer) and representatives of FPF and ZCG. The BTCPayServer Zcash plugin has been moved over to this organisation and I have merged the initial 2.1 fixes.

Here are the instructions for creating a local .btcpay build, that can be loaded via the Manage Plugins interface in a BTCPayServer instance:

All that is left for the first milestone now is to finish the transfer of the Zcash plugin on the plugin directory and publish the first working version of it.

8 Likes

Awesome, looking forward to some success stories with this!

It’s giving me a 404.

2 Likes

Updated it with a permalink.

3 Likes
8 Likes

Thanks to @artkor for testing the 1.0.1 pre-release! I have now published the first working version of the plugin for BTCPayServer 2.x to the plugin directory. Milestone 1 is now complete.

Plugin repository: GitHub - btcpay-zcash/btcpayserver-zcash-plugin: This plugin extends BTCPay Server to enable users to receive payments via Zcash.
Example Docker Compose: zec-btcpay/docker-compose.yml at main · elemental-zcash/zec-btcpay · GitHub

zcash-walletd config override (to specify lightwalletd server): zec-btcpay/walletd/Rocket.toml at main · elemental-zcash/zec-btcpay · GitHub

The next steps, for milestone 2, will be to eliminate the need to hardcode the viewing key as an environment variable and allow for entering it inside the BTCPayServer Zcash options interface. This is necessary for supporting the official installation bash script and to deploy BTCPay with Configurator. This should help users and merchants who may be less familiar with Docker. An option can be included as part of the setup process to run a Zebra full node and lightwalletd locally, as is the encouraged practice by BTCPayServer.

13 Likes

Milestone 2 is nearing completion. There is a pre-release build up for 1.0.2 of the BTCPay plugin that allows for entering the viewing key and number of confirmations via the settings GUI, eliminating the need for hardcoding environment variables.

I ran into some issues with using zec.rocks, so for now have changed the default lightwalletd server to zcash-infra, and have created an optional fragment for running a full zebra node with lightwalletd. BTCPayServer tends towards favouring full nodes as a default, however most other cryptocurrencies support pruned nodes and zebra/lightwalletd do not, so this may be limiting for instances that already have several full nodes running on the same machine, given disk space requirements.

A PR is open in btcpayserver-docker for the Zcash Docker fragments that would add Zcash support to the official setup process: Add Zcash support by macintoshhelper · Pull Request #995 · btcpayserver/btcpayserver-docker · GitHub . There is an issue that needs to be ironed out around overriding an environment variable with docker-compose-generator, not sure on the best approach for this.

I’ll write up some setup and upgrade documentation in the README, and it should be ready for testing. I’ve been running a live instance of the plugin on a BTCPayServer website for the past several days.

10 Likes

FYI @emersonian

1 Like

What issues are you seeing? We are running lightwalletd v0.4.18, that is the only difference as far as I know. If there’s an issue with that version we should report it in the lightwalletd Github.

2 Likes

This is the error I was running into:

[2025Z INFO  rocket::server] Matched: (sync_info) POST /sync_info
[2025Z WARN  rocket::response::debug] Debug: status: Internal, message: "Unexpected compression flag: 60, while receiving response with status: 504 Gateway Timeout", details: [], metadata: MetadataMap { headers: {"content-length": "92", "cache-control": "no-cache", "content-type": "text/html", "date": "[...] GMT", "server": "Fly/6... (2025-[...])", "via": "2 fly.io", "fly-request-id": "01...-cdg"} }

Seems like it might be a slow response that results in the HAProxy load balancer giving a timeout error?

3 Likes

We removed a server from our EU cluster that was causing issues last week, it’s possible that you connected via that region. Up for trying again? I’m not seeing any errors reported in our stack but it’s possible that something is slipping by. Thank you for the troubleshooting help.

3 Likes

Thanks; yes, most likely was connecting to EU region via load balancer. I’ve switched my test server back over to it and so far no issues.

2 Likes

The second/final milestone is now complete.

Version 1.0.2 of the BTCPay Zcash plugin has been published to the plugin repository, adding support for configuring the wallet viewing key, birth height and number of confirmations via the settings GUI. Source code: GitHub - btcpay-zcash/btcpayserver-zcash-plugin: This plugin extends BTCPay Server to enable users to receive payments via Zcash.

The official installation process is now supported using Docker fragments. There is an open PR in the upstream btcpayserver-zcash repository, and until it is merged, a fork can be used: GitHub - btcpay-zcash/btcpayserver-docker: Docker resources for hosting BTCPayServer easily

I have published some documentation on using the plugin with either a new BTCPayServer instance or existing instance (using a fork of btcpayserver-docker): btcpayserver-zcash-plugin/docs/installation.md at master · btcpay-zcash/btcpayserver-zcash-plugin · GitHub

I plan to continue maintaining the plugin and Docker repositories for at least a year provided that there are no serious breaking changes that require significant time and extra funding to fix. I will work on some improved documentation/guidance on contributing to the .NET plugin, for now there are basic steps for creating a local build and the official documentation for plugin development can be used: Local development | BTCPay Server and Plugins | BTCPay Server.

13 Likes

Oh, looks like this is completed, awesome!!

Before I start recommending this to various online places, are there working implementations with some decent activity that I could try myself and point to as examples?

4 Likes