Skip to content

Instantly share code, notes, and snippets.

@javierluraschi
Last active December 7, 2020 19:31
Show Gist options
  • Save javierluraschi/38455b26bc6629ca9a2fcd03bd738fb8 to your computer and use it in GitHub Desktop.
Save javierluraschi/38455b26bc6629ca9a2fcd03bd738fb8 to your computer and use it in GitHub Desktop.
Create ETH Wallet
<!DOCTYPE html>
<html>
<head>
<script src="https://cdn.jsdelivr.net/gh/ethereum/web3.js@1.3.0/dist/web3.min.js"></script>
<script>
const create = () => {
const web3 = new Web3(new Web3.providers.HttpProvider('https://mainnet.infura.io'));
let account = web3.eth.accounts.create(web3.utils.randomHex(32));
document.getElementById('address').innerText = account.address;
document.getElementById('key').innerText = account.privateKey;
};
</script>
<style>
body {
font-size: 80px;
overflow-wrap: break-word;
text-transform: uppercase;
font-family: monospace;
margin: 30px;
}
</style>
</head>
<body onload="create()">
<div id='address'></div>
<br>
<div id='key'></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment