I want to derive Address of my own wallet developed using web3 frameworks without looking onto etherscan for the Address.

 var Web3 = require("web3");
 var url = 'https://ropsten.infura.io';
 var web3 = new Web3(url);
 var address = '0x8690F1feff62008A396B31c2C3f380bD0Ca6d8b8';
 var balance = web3.eth.getBalance(address);
 var wallet = web3.utils.toWei(balance, 'ether');

Here, I want not to provide Address, but, access it by some codes in Web3. May I know the steps to be followed?

  • What code??????? – goodvibration Jul 25 '20 at 12:01
  • Yeah, I got that part. But where is your code that you are asking us to help you with??? – goodvibration Jul 25 '20 at 12:21
  • First of all, you did not post that additional link up until now, so please don't play innocent. Second, what does "I want to develop the following code" even mean??? What's stopping you from developing it? Heck, why do you even need to develop a code, which has obviously already been developed? You actually shared a link to it! Please do some work, then, whenever you run into a specific technical problem, post it here, along with a detailed explanation of what the problem is, your preliminary findings while debugging it, and what you've attempted in order to solve it yourself. – goodvibration Jul 25 '20 at 12:28
  • It is not clear what are you trying to accomplish. Do you want to get your wallet's balance using infura instead of etherscan? – Ismael Jul 25 '20 at 18:52
  • @goodvibration and Ismael : This is the possible answer, I was looking for to access and work on my wallet or accounts. ethereum.stackexchange.com/a/85284/55270 – Ank_247shbm Jul 26 '20 at 9:12

Finally, I got the answer:

It is by two different method:


var Web3 = require("web3");
var web3 = new Web3('https://mainnet.infura.io');
var wallet = web3.eth.accounts.wallet.create(1);





var Web3 = require("web3");
var url = "https://mainnet.infura.io/v3/60968ff3b2f84a0ebdff7a993f4d080b";
var web3 = new Web3(url);
var wallet = web3.eth.accounts.wallet.create(5);
var encryptKey = web3.eth.accounts.wallet.encrypt('Aditi');

var keys = encryptKey.map((accounts)=>{console.log('0x' + accounts.address)});



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