1

'Hi everyone!

I'm wondering if anyone has trouble using web3's create wallet method? I do not have access to web3.eth.accounts.wallet command through my Geth's console.

Appreciate any help, R.

  • Geth version: 1.10.12-stable
  • Geth's web3 api version: 0.20.1
  • OS: Windows
  • web3.py version: 5.25.0
  • python version: 3.10.1
  • I started my geth using the following command: geth console --goerli --syncmode "light" --http --http.port 20000 --http.api personal,eth,net,web3 --allow-insecure-unlock
  • Related questions: #2 and #3
Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127
Rouhollah Joveini
  • 488
  • 1
  • 3
  • 16
  • 1
    Too many questions in one post. Moreover, how did you start your geth ? – Itération 122442 Jan 12 '22 at 07:14
  • @Itération122442 , thanks for the reply. I started my geth using the following command:

    geth console --goerli --syncmode "light" --http --http.port 20000 --http.api personal,eth,net,web3 --allow-insecure-unlock

    – Rouhollah Joveini Jan 12 '22 at 08:28
  • Welcome on this stack, by the way. You should include your comment in the question. Moreover, one post should focus on one question. I recommend you edit this post so that it includes only question 1 and post question 2 and 3 in another post. – Itération 122442 Jan 12 '22 at 08:34
  • @Itération122442, thanks for the advice. Took it and split up the question to #2 and #3. – Rouhollah Joveini Jan 12 '22 at 10:53
  • @RoliJ Geth's console uses web3 v0.20, see this for the old api. In any case web v0.20 doesn't support creating an account, for that you have to use the "personal API". – Ismael Jan 13 '22 at 02:04
  • Thank you @Ismael for the reply. I create accounts by using web3.personal.newAccount("pass_phrase"). I am wondering what are web3.eth.accounts.wallet-base commands do? Are these attempting to create and interact with wallets, like in Bitcoin (which is weird, because of the difference between the concepts in these two networks, as @mikko-ohtamaa pointed out bellow, correctly)? Or it is just creating wallets and accounts inside them and has nothing to do about the wallet concept like the one in Bitcoin? – Rouhollah Joveini Jan 13 '22 at 05:33
  • 1
    @RoliJ It is in the documentation Contains an in memory wallet with multiple accounts. It is as Mikko says it manages an array of independent accounts completely unrelated to bitcoin wallets. – Ismael Jan 13 '22 at 14:15
  • 1
    @Ismael, thank you for the comment. You are right. mikko-ohtamaa's clarification on the UTXO/ACCOUNT models used by these two chains, helped me out to understand the concept. – Rouhollah Joveini Jan 15 '22 at 04:58

1 Answers1

1

You do not need geth to create a wallet. Ethereum account is just a private key that is a large 256-bit random integer. Then this private key can be imported to any wallet software or your own program.

Here is an example how to create a private key and public key by hand from command line.

Mikko Ohtamaa
  • 22,269
  • 6
  • 62
  • 127
  • Thanks for the reply. Here, by using "wallet", I am referring to the one in the bitcoin atmosphere, where there is a wallet that owns other accounts (and not accounts in the Ethereum atmosphere). And this is why I unsuccessfully attempted exploring the concept throughout the web3.eth.accounts.wallet command. Any revision? – Rouhollah Joveini Jan 12 '22 at 12:41
  • By the way, I wanted to vote up your answer (however this is not the answer I am looking for, but it is useful for those who might be redirected to this question, one day), but do not have the minimum reputation required for voting. Sorry and thanks again. – Rouhollah Joveini Jan 12 '22 at 12:49
  • Unlearn what you have learnt it Bitcoin. Your mind is corrupted. – Mikko Ohtamaa Jan 12 '22 at 13:04
  • I'm not saying that "wallet" doesn't have a different meaning in ethereum network. I just want to explore this method and see what is it trying to do and what is the difference between wallet and account here? What is the definition of wallet in the web3.personal.listWallets geth's console command? And what is the difference between this command and web3.personal.listAccounts or web3.eth.accounts? These are the questions I'm going to explore and the reason I asked this question. – Rouhollah Joveini Jan 12 '22 at 15:21
  • 1
    The UTXO model you mentioned in Q#3 helped me understand what you are saying. Wallets has nothing to do with the structure being used in blockchains to track down the balance or handle transactions. It is just a file containing accounts' info and web3.eth.accounts.wallet-based commands are just to handle that. Thanks again. – Rouhollah Joveini Jan 13 '22 at 07:25