Skip to content

Operators can specify a Zcash donation address#506

Merged
LarryRuane merged 1 commit intozcash:masterfrom
zecrocks:donations
Mar 6, 2025
Merged

Operators can specify a Zcash donation address#506
LarryRuane merged 1 commit intozcash:masterfrom
zecrocks:donations

Conversation

@emersonian
Copy link
Copy Markdown
Contributor

@emersonian emersonian commented Feb 16, 2025

This patch allows light wallet operators to specify a donation address. Anyone can help reimburse their hosting costs by periodically donating directly to operators to support a healthy network.

Pull requests are inbound to Hosh, Zingolib, and Zaino to support this field as well. Wallets may optionally support it.

This address will be how Zec.rocks knows where to reimburse participants in our workshop for their first six months of hosting expenses.

It would be nice if the address validated to be a real Zcash address. It would also be nice if the UA were validated to be orchard only with no T-address embedded to protect node operators' privacy. I am not aware of a golang library for this nor FFI bindings to another library at this time. These validation features are trivial in the Zaino implementation and will be implemented in the pull request there.

Yes, lightwalletd is heading towards deprecation. Until then we need to maintain feature parity between projects, and to continue a lightwalletd release cadence (can we please get an official release soon?)

Related PRs:

@LarryRuane
Copy link
Copy Markdown
Collaborator

ACK d126548
Looks good, nice unit test addition. The only minor suggestion is we could do more validation on the specified address, which should be bech32m. But I'm not sure if it's worth the trouble; it's probably okay as is (just requiring a leading "u" character). I can't verify the length restriction.

I also tested with "darkside wallet" mode, which loops in more code (compared with the unit test) and has the advantage of not requiring a running backend zcashd or zebrad. In case it's helpful to others, here's how you can test this PR:

Start the server in darkside mode in a shell window:

go run main.go --donation-address u-anything --zcash-conf-path ~/.zcash/zcash.conf --no-tls-very-insecure --log-file /dev/stdout --darkside-timeout 9999 --darkside-very-insecure

In another shell window (it's a little complicated because, unfortunately, it's necessary to have at least one simulated block):

grpcurl -plaintext -d '{"saplingActivation": 10,"branchID": "bad", "chainName":"x"}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/Reset
grpcurl -plaintext -d '{"height":10,"nonce":100,"count":10}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/StageBlocksCreate
grpcurl -plaintext -d '{"height":10}' localhost:9067 cash.z.wallet.sdk.rpc.DarksideStreamer/ApplyStaged
grpcurl -plaintext localhost:9067 cash.z.wallet.sdk.rpc.CompactTxStreamer/GetLightdInfo

The GetLightdInfo command should generate the following output (note the donation address):

{
  "version": "v0.0.0.0-dev",
  "vendor": "ECC DarksideWalletD",
  "taddrSupport": true,
  "chainName": "x",
  "saplingActivationHeight": "10",
  "consensusBranchId": "bad",
  "blockHeight": "10",
  "zcashdBuild": "darksidewallet-build",
  "zcashdSubversion": "darksidewallet-subversion",
  "donationAddress": "u-anything"
}

If you start the server without specifying the --donation-address option, the donationAddress field of the output won't appear.

(This would be a good test to add to #507 after it gets merged.)

@LarryRuane LarryRuane added the enhancement New feature or request label Mar 6, 2025
@LarryRuane
Copy link
Copy Markdown
Collaborator

(can we please get an official release soon?)

Yes, sorry, I'm working on getting a new release out now, I may merge a few more small things first.

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants