Technical Guide | Ethereum Wallet Development: Generate Account Address, Private Key, Keystore, mnemonic

First, use web3 to connect to the Ethereum network (test network, main network)

1. What is web3

Web3 is a module provided by Ethereum to connect to the Ethereum blockchain, allowing you to interact with local or remote Ethereum nodes using HTTP or IPC, which includes almost all the features of the Ethereum ecosystem. The web3 module is primarily connected to the RPC layer exposed by Ethereum. Developers use web3 to connect to the RPC layer and can connect to any node that exposes the RPC interface to interact with the blockchain. Web3 is a collection library that supports multiple development languages ​​using wbe3. The JavaScript API is called web3.js, and, web3j, web3.js will be the focus of our wallet development project.

  • Web3.eth: Used to interact with the Ethereum blockchain and smart contracts. Web3.utils: Contains some helper methods.
  • Web3.shh: P2P and broadcast for protocol communication.
  • Web3.bzz: Bzz module for interacting with the group network.
  • Github address: web3.js
  • Web3.js development documentation::web3.js

2. Instantiate the web3 object

Web3 needs to interact with the node, you need to create a web3 object, let's see how to create it.

According to the API, we need to specify the node address, we will ws://some.local-or-remote.node:8546

The network of the connected Ethereum is determined by replacing the address of another node connected to the Ethereum network. So what is the address of the node connected to the Ethereum network? Here we need to use infura.

3. Get the node address connected to the Ethereum network

Infura provides the public Ethereum main network and test network nodes. After registering on the website, you can get the addresses of each network. Please follow the steps below to get the address.

The first step : open the infura website address:, use the email to register and log in as follows:

Step 2 : Click on the “create new project” button labeled above to create a new project. Then pop up the following box, enter the project name in the input box, such as "MyEtherWallet", and then click the "create project" button to create.

Step 3 : Then the following interface will be displayed. Click the checkbox in the figure below to see the node addresses of the main network, Kovan test network, Ropsten test network, and Rinkeby test network.

Step 4 : Select Kovan to test the network, then copy the address and you will get an address like this:

Https://…cd67, as follows.

4. Connect to the Ethereum Kovan Test Network

Now replace the copied address with the address of the instantiated web object, as follows

Connect to the Ethereum main network and the Kovan test network, just copy the address of the main network node to instantiate web3. Since the transaction on the main network requires cost, we develop based on the Kovan test network, and then switch to the main network after the completion of the development. In the project source code we developed, I encapsulated the code for the web3 instance into the getweb3() method of the myUtils.js file for unified calling of the entire project.

Second, get the address, private key, keystore, mnemonic

1. Create an account using web3

To create an account, you need to use the following API of web3.js.







2. router.js

Bind the page that created the account to the interface submitted by the form to the route.




Project source code Github address

Copyright statement: The copyright of the article in the blog belongs to the blogger. It is forbidden to reprint without authorization. Please contact the author (WeChat: lixu1770105) to obtain the consent and indicate the source.

This article address:

Wish code (ChianDesk.CN) – the story of connecting each programmer

Technology upgrade, rapid transformation, please pay attention to WeChat public number: wish code

We will continue to update Blocking; if you have any questions or suggestions, please contact us!


Was this article helpful?

93 out of 132 found this helpful

Discover more


Is Bitcoin too hot? $ 400 million in Grayscale secretly picked up the disk

In the past 24 hours, the cryptocurrency market has encountered an unprecedented disaster. According to data provided...


Official announcement! Bakkt cash settled bitcoin futures will go live on December 9

On Thursday, the Intercontinental Exchange (ICE) revealed that Bakkt is preparing to launch a cash (US dollar) settle...


Hong Kong to open cryptocurrency trading to retail investors, bitcoin rebound may be weak or unsustainable

After the Hong Kong Securities Regulatory Commission announced that retail investors are expected to be able to trade...


The Bitcoin Options Market: A Roller Coaster Ride for Investors

Could Bitcoin's Price Reach $50,000 by 2024? Examining Trader's Sentiment through Options Markets Ahead of Potential ...


A week in review | US and Iran situation pushes up crypto market, new EU regulations trigger regulatory storm

In the past week, the situation between the United States and Iran has still affected the crypto market, and the EU &...


Encrypted investor customers interested in acquiring 25% of total Bitcoin supply

According to Forbes report on May 30, digital currency investment company Dadiani Syndicate has recently contacted a ...