Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

215
Visualizações
How to create private key and public key with web3?

I want to create a private key and public key, basically a new account in Ethereum using web3. But I want to generate a private key that is 32 bytes in length. Does anyone know how to generate the same? Used the following code, but not able to generate a 32 bytes long private key.

web3.eth.accounts.create();

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

web3.eth.accounts.create()

address: '0xB9b1415Dbd1B3C9a5890433DF8B2b389445CC6Fa',
  privateKey: '0x498262a4afde2bdd9e1bef3aafc6442ec36ccf167e527457a211118de93346ba',
  signTransaction: [Function: signTransaction],
  sign: [Function: sign],
  encrypt: [Function: encrypt]
  
  
  
  

the private key is here '0x498262a4afde2bdd9e1bef3aafc6442ec36ccf167e527457a211118de93346ba' this is of a 64 hex format.

so the 32 bytes length private key is 498262a4afde2bdd9e1bef3aafc6442ec36ccf167e527457a211118de93346ba

(remove the 0x)

about 4 years ago · Juan Pablo Isaza Relatório

0

Ethereum uses 32 bytes (which is 64 hex characters) long private keys.

You can access the private key generated using the accounts.create() method (docs) in the privateKey property.

const account = web3.eth.accounts.create();
console.log(account.privateKey);
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda