zcash / lightwalletd

Lightwalletd is a backend service that provides a bandwidth-efficient interface to the Zcash blockchain
MIT License
83 stars 86 forks source link

Darkside TXIDs are incorrect #456

Open AloeareV opened 1 year ago

AloeareV commented 1 year ago

What is the bug? Darkside txids are incorrect

Additional context In a production server, the txid issue is bypassed according to this comment: https://github.com/zcash/lightwalletd/blob/8003d7fb6e3c47fb0561121a0ee47d080c8c46b9/common/common.go#L262-L267

This doesn't help on darkside, though https://github.com/zcash/lightwalletd/blob/8003d7fb6e3c47fb0561121a0ee47d080c8c46b9/common/darkside.go#L99-L103

Zingo, and I believe some other lightwallets (although I haven't investigated this), when it sends a transaction, it calculates the transaction ID of the transaction it's submitting, and is then confused when the on-chain txid doesn't match what it deterministically should be.

zancas commented 1 year ago

Hi @LarryRuane are you aware of this issue where there's a discrepancy between the TxID that's produced for Version 5 transactions, and the one that's specified in the protocol?

LarryRuane commented 1 year ago

Hi @zancas, yes, I'm aware of this problem, see #392. As I said in the comment quoted above, I didn't think it matters in darkside mode (and we have a workaround for regular (production) mode). But if it does matter (that is, if it's a problem for some wallet testing), we should bump up the priority of getting this fixed.

Can someone give me a sense for the urgency to fix this?

I did look into fixing it recently, but the official blake2b Golang package support "personalization" which is required. See https://github.com/zcash/lightwalletd/issues/392#issuecomment-1670585292