Skip to content

Key instead seed phrase #2293

Answered by zemse
ubuntutest asked this question in Q&A
Nov 14, 2021 · 2 comments · 2 replies
Discussion options

You must be logged in to vote

@ubuntutest You can use the Wallet class by passing in the private key in the constructor.

const privateKey = '....';
const wallet = new ethers.Wallet(privateKey);

Just adding a note, you should use a private key that is generated from a great entropy source. The ethers.Wallet.createRandom() uses the secure entropy sources available in the enviornment. If the current environment does not have a secure entropy source, an error is thrown.

(also moving to discussions)

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ubuntutest
Comment options

You must be logged in to vote
2 replies
@zemse
Comment options

zemse Nov 14, 2021
Collaborator

@ubuntutest
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #2292 on November 14, 2021 19:46.