question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to create random Wallet with provider

See original GitHub issue

Hey, is there a recommended way to create a random wallet with a provider?

like let randomWallet = ethers.Wallet.createRandomWithProvider(entropy,provider);

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ricmoocommented, Jun 17, 2022

@jmoralesss Oh. I see. If it is not connected to a provider is can only sign messages, sign typed data and sign transactions.

You require a provider for it to send a transaction, since it needs to be broadcast to the network, which is what a Provider offers: a connection to the blockchain. If it has a provider, it can also be used to simulate transactions (.call) and estimate gas, etc.

0reactions
jmoralessscommented, Jun 17, 2022

@jmoralesss I don’t understand your question… A random wallet is just a random wallet; to perform operations you need to use a private key that is re-used over time, and connecting allows you to perform on-chain operations, while and unconnected wallet can only sign transactions and data.

Thanks for you response. Sorry for badly wording that question.

What is the difference in the return value between ethers.Wallet.createRandom().connect(provider) and ethers.Wallet.createRandom()?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Create random Wallet with connection to a specific provider ...
I am trying to create random wallets via the function Ethers.Wallet.createRandom with a connection to a specific network (like Ropsten for ...
Read more >
Wallets and Signers — ethers.js 4.0.0 documentation
Creates a new random wallet. Ensure this wallet is stored somewhere safe, if lost there is NO way to recover it. Options may...
Read more >
Wallets — ethers.js 3.0.0 documentation
A wallet manages a private/public key pair which is used to cryptographically sign transactions and prove ownership on the Ethereum network. Creating Instances¶....
Read more >
Ethers js adding provider - Ethereum Stack Exchange
With creating a random wallet, it doesnt seem like you can give it the provider like when importing a private key.
Read more >
How to generate Ethereum wallet with ethers.js - Medium
With the ethers.js library, you can generate Ethereum wallet by writing the code below: Code (Node.js). const ethers = require('ethers')
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found