Want to export EOA private key in a secure manner

Hi Team,

We are using web3Auth-modal SDK, and we want to export the wallet private key in a secure manner like wallet.json. We need something similar to the below code,

this is in node.js

e = require(“ethers”);
key = “”;
wallet = new e.Wallet(key);
wallet.encrypt(“”).then((str) => console.log(JSON.stringify(str)));

Is there a method available, by which user can export their password-protected private key more securely?

We would like to use this similar to described in this link

Please share your thoughts on this.
@maharshi

@mkrana173 Thanks for reaching out.

Yes, it is possible to export the private key. Refer to the below documentation:

EVM: EIP1193 (EVM) Provider | Documentation | Web3Auth
Solana: Solana Provider | Documentation | Web3Auth
XRPL & others: XRPL Provider | Documentation | Web3Auth

1 Like

Is there a method available to protect private key with password and export it as wallet.json?

1 Like

Hi @mkrana173,
Thanks for your question. As of now, we don’t have a functionality that can do this on our side. But one can develop something on their side to export the private key and write it to a password protected json.
This can be good feature request. Although, it is not yet in the cards.

ok, Thanks for the clarification.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.