Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Zcash Sapling Address regexp pattern is incorrect #58

Open
boyfromcave opened this issue Feb 14, 2022 · 0 comments
Open

Zcash Sapling Address regexp pattern is incorrect #58

boyfromcave opened this issue Feb 14, 2022 · 0 comments

Comments

@boyfromcave
Copy link

"validationRegex": "^z([a-zA-Z0-9]){94}$|^zs([a-zA-Z0-9]){75}$|^t([a-zA-Z0-9]){34}$"

Zcash Sapling addresses are 78 characters in length.

This middle regexp pattern will be shy by 1 character. only 77 characters.
I have tested this in your UD interface for adding a sapling address to a crypto domain; if a user adds a valid sapling address, the UI errors and says it is invalid address. But if you delete 1 character from a valid address, then your UD interface accepts the sapling address as valid.

The error is a bug. It appears that the regexp is missing the "1" in the middle pattern, "zs1". Adding the 1 in the pattern will extend the length of the address to 78 characters, which is correct.

So, the corrected regexp should be: "^z([a-zA-Z0-9]){94}$|^zs1([a-zA-Z0-9]){75}$|^t([a-zA-Z0-9]){34}$"

Note: this bug was found by a Ycash contributor. We review Zcash and Ycash related code, as we feel both should be widely supported.

Same issue found in resolution-go repo: unstoppabledomains/resolution-go#20

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant