1

I am kind of new in the world of Ethereum. Can someone help me understand the difference between account created using metamask and the one using geth command?

I am building an app, which is requiring me to create wallet internally(or accounts, not sure what to use) for every user who registers in the app. Further, I need to provide some default coins to every user. How can I get this done?

I am creating my private blockchain network.

2

geth at its core is a node software, whereas metamask is a wallet and web3 provider. Geth also offers some wallet functionality.

An externally owned account on ethereum is backed by a private key. When you use metamask, this private key is stored locally on your device, and metamask will sign transactions as requested by web3, and then broadcast the signed transaction to a remote node, geth in this case.

If geth holds the private key, you can use that key over the RPC APIs using the personal and eth services, or within the geth console. In this case, geth is able to sign and broadcast transactions without metamask.

Usually, a dApp will not hold the users' keys on their own geth servers. Users will use metamask to interact with the dapp, and the keys will be stored by the user only. When the user wants to perform a transaction, they will sign a transaction, and connect to the remote node only to broadcast it. A user's key should never be shared with the remote node.

2

Using Metamask you can use the accounts created on geth to access DAPP(Decentralized Application). One cannot access DAPP's using a conventional web browser. Metamask enables your browser to access DAPP.

You need to create geth accounts for each newly added participant and import private key of that account in the Metamask.

You can pre-allocate huge ethers to the first account(account[0]) in the genesis.json file of private blockchain and the transfer some ethers to newly created accounts(users) from account[0].

  • Thanks for the reply. I will use web3j to interact with ethereum. I will also deploy smart contracts in the network. However, can I call these smart contracts directly from my java files within the application ? or vise versa ? – Twinkle Shine Aug 23 '18 at 6:54
  • Yes, you can access smart contract directly from java files using web3j – Soham Lawar Aug 23 '18 at 7:00
  • This is incorrect. The geth node does not need to have the same accounts as metamask. Metamask accounts are independent – Raghav Sood Aug 23 '18 at 7:03
  • I agree that metamask accounts are independent. I want to convey that if one wants to access DAPP using account created on geth then one need to import the private key of that account in Metamask. – Soham Lawar Aug 23 '18 at 7:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.