Not sure if this is the right forum to ask on, I’ve been trying to write my own ZIP32/Sapling script while waiting on the official clients to support view keys and am stuck on one small part.
Here is a test page entirely in JS that reproduces the problem: https://uwuforever.github.io/zcash-zip32-js/testsap.html
I can’t quite figure out what’s wrong with my child key derivation. I’m using https://paper.zecwallet.co/ as “test vectors” and trying to get the output private key to match.
The expected result would be pasting in the hex HD Key into the top box => click the key that comes up => box comes up at the bottom of the page for deriving a child key => enter 32 hardened => click resulting key => enter 133 hardened => click resulting key => enter 0 hardened => key at bottom of page should match. The majority of this script produces results that match those from the official client, so I’m assuming the error should be in Sapling.deriveMaster or Sapling.deriveChild in sapling.js.