0

I'm a bit confused on the process now of creating wallets in the Ethereum ecosystem. At this time I'm creating an application that allows users to create their own wallets but I'm very confused on the process of creating them, coming from Cardano the process seems very different.

I've been reading the docs & it seems no one talks about creating Mnemonic Keys anymore, but instead use a 'Public & Private' key.

When I create my keys on the client, don't I have to submit them to the network to form an account, the docs explain nothing about this process.

I came across Clef but I'm not sure what the recommended steps are to take. Thanks in advanced :)

CoderMan
  • 61
  • 7

1 Answers1

0

With this code you can create a new private key:

import { ethers } from "ethers";

const privateKey = ethers.utils.randomBytes(32); const wallet = new ethers.Wallet(privateKey);

You can store the privateKeyon a database and query it in order to sign transactions.

Rodrigo Burgos
  • 764
  • 3
  • 15
  • So you don't actually need to submit the created wallet to the network, once you derive public & private keys from a mnemonic sentence? – CoderMan Jan 17 '23 at 14:58
  • Exactly. You store the privateKey in a db and use it to sign transactions. The access to the privateKey can be achieved through auth. – Rodrigo Burgos Jan 17 '23 at 15:11