-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Hardhat's key derivation doesn't work with Node 17 #1988
Comments
Are you using node 17? If so, please try downgrading it. For an explanation of what's going on, please take a look at this: https://medium.com/the-node-js-collection/node-js-17-is-here-8dba1e14e382#5f07 |
yes i am using v17.0.1, okay i will try. thank you |
try using node 14 it works best or just install WSL2 Ubuntu or any Linux distro on your machine if you hit more config problems. |
The workarround for this is to set the following environmental variable: export NODE_OPTIONS=--openssl-legacy-provider |
remains an issue when that option is set with node 17.3.0 $ npx hardhat accounts
An unexpected error occurred:
Error: error:0308010C:digital envelope routines::unsupported
│ │ at new Hash (node:internal/crypto/hash:67:19)
│ │ at Object.createHash (node:crypto:130:10)
│ │ at hash160 (~/Desktop/crypto/hardhat-quickstart/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:249:21)
│ │ at HDKey.set (~/Desktop/crypto/hardhat-quickstart/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:50:24)
│ │ at Function.HDKey.fromMasterSeed (~/Desktop/crypto/hardhat-quickstart/node_modules/ethereum-cryptography/vendor/hdkey-without-crypto.js:194:20)
│ │ at deriveKeyFromMnemonicAndPath (~/Desktop/crypto/hardhat-quickstart/node_modules/hardhat/src/internal/util/keys-derivation.ts:21:27)
│ │ at derivePrivateKeys (~/Desktop/crypto/hardhat-quickstart/node_modules/hardhat/src/internal/core/providers/util.ts:29:52)
│ │ at normalizeHardhatNetworkAccountsConfig (~/Desktop/crypto/hardhat-quickstart/node_modules/hardhat/src/internal/core/providers/util.ts:56:10)
│ │ at createProvider (~/Desktop/crypto/hardhat-quickstart/node_modules/hardhat/src/internal/core/providers/construction.ts:78:59)
│ │ at ~/Desktop/crypto/hardhat-quickstart/node_modules/hardhat/src/internal/core/runtime-environment.ts:80:28 {
│ opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
│ library: 'digital envelope routines',
│ reason: 'unsupported',
│ code: 'ERR_OSSL_EVP_UNSUPPORTED'
}
$ node -v
v17.3.0
$ echo $NODE_OPTIONS
--openssl-legacy-provider I use asdf to manage my node versions and I tried every 17.x.x version and it wasn't until I went down to LTS v16.13.1 before this worked. For those in my situation, if you're going to use an older (long term support) version of node, remember to remove the |
Will Hardhat work to make node 17+ be compatible? |
please, upgrade https://github.com/ethereum/js-ethereum-cryptography#upgrading |
The fix for this (upgrading |
opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ], % node -v I initial downgrade hardhat from node 17 to 16.5.0 and it worked for a while. Recently it completely broke on me. Not sure whats gonig on. |
This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days. |
greetings! I have the same issue and being working with a technology (blockchain) that its heart and core is cryptography and being using a tool that doesn't worry to be working with an outdated cryptographyc "framework" / algorithms seems pretty concerning to me *Just like openssl points: _**"The OpenSSL legacy provider supplies OpenSSL implementations of algorithms that have been deemed legacy. Such algorithms have commonly fallen out of use, have been deemed insecure by the cryptography community, or something similar. We can consider this the retirement home of cryptographic algorithms.**_" |
I'm going to close this one because node 17 has already reached end of life and, as far as I know, this works well with node 18. If someone has some problem around this, please open a new issue with reproduction steps. |
Hello, just install hardhat on my local project, windows os version 10.
Iam trying to run task hardhat accounts and getting this errors :
Here is my actual devDependencies :
thanks you
The text was updated successfully, but these errors were encountered: