This page uses machine translation from English, which may contain errors or unclear language. For the most accurate information, please see the original English version. Some content may be in the original English due to frequent updates. Help us improve this page's translation by joining our effort on Crowdin. (Crowdin translation page, Contributing guide)
V4 keystore single
This example demonstrates how to encrypt and decrypt keystore V4 single.
Import the Wallet class from the @kaiachain/ethers-ext/v5 package.
Define an encrypted keystore version 4
Specify the current password of the keystore and a new password.
Load the keystore with its current password
After decryped, you can access the public and private key.
You can generate a new keystore using the descrypted key and a new password. Note that the new encrypted key will be keystore v3.
Check the new keystore public and private key, it will differ from original one since keystore v3 does not support klaytn account system.