Skip to content

Instantly share code, notes, and snippets.

@Hero-Development
Last active June 30, 2022 05:25
Show Gist options
  • Save Hero-Development/55c2f2106ad6c8b9cd4e4589c542b0dc to your computer and use it in GitHub Desktop.
Save Hero-Development/55c2f2106ad6c8b9cd4e4589c542b0dc to your computer and use it in GitHub Desktop.
A simple web3 script to generate new accounts and get the private key
//Step 1: Create a signer
const Web3 = require( 'web3' );
const web3 = new Web3();
const account = web3.eth.accounts.create();
console.log( account );
/*
{
"address": "0xd3bDe284cbdE2450EfdDA6f00D335467eB5fCc7b",
"privateKey": "0xf7af023b9220a31d5b6cf1ae098c0ec9ad11a53e305ac6f344c9bddbbf876d3d"
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment