ethereum / eth-account

Account abstraction library for web3.py
http://eth-account.readthedocs.io/
MIT License
258 stars 155 forks source link

Default KDF params for web3.eth.account.encrypt API do not match Web3js and Ethers #259

Closed Misery42 closed 5 months ago

Misery42 commented 5 months ago

If a wallet gets stored as encrypted json it is not possible to open it with other frameworks like web3.js and ethers both show same errors.

*Error Message: Scrypt: N must be larger than 1, a power of 2, less than 2^(128 r / 8) and less than 2^32**

This is related to different kdfparams in web3.py and web3.js. This could be a possible bug or i suggest to change API so that kdfparams can be passed in from outside.

image

compared to here: https://web3js.readthedocs.io/en/v1.2.11/web3-eth-accounts.html#encrypt

image

Misery42 commented 5 months ago

We investigate why db stores r=1 and p=8 (vice versa) and if it is related to older web3.py version.

Misery42 commented 5 months ago

Was related to eth-account = "==0.10.0"

fixed in 0.12.1