-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get rid of bcrypto
dependency
#693
Conversation
bcrypto
dependencybcrypto
dependency
We use `bcrypto` to compute hashes, but since this library is a bit problematic, here we replace it with hashing algorithms from the `ethers` library. `ethers` has no `hash160` algorithm but under the hood `HASH160 = RIPEMD160(SHA256(X))` so it's possible to compute `hash160` using `ethers`.
b6509de
to
e022bdc
Compare
Glory hallelujah. |
I am shocked at the size of this PR, wow! Would be really nice to get test vectors confirming a few hashes 🙏 |
Nice work! However... |
Looks good to me.
I think this PR is meant to be the very first step. |
You're breaking my heart 😆 (This makes a lot more sense.) |
Adds basic tests to `computeHash160`, `computeHash256` and `computeScriptHash` functions so that we are sure they are working exactly the same as when we used `bcrypto` library inside them.
Refs: #695
We use
bcrypto
to compute hashes, but since this library is a bit problematic, here we replace it with hashing algorithms from theethers
library.ethers
has nohash160
algorithm but under the hoodHASH160 = RIPEMD160(SHA256(X))
so it's possible to computehash160
usingethers
.