0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Web3jsを利用してウォレットを実装してみる #0ウォレット作成

Last updated at Posted at 2024-09-12

テーマ設定

Web3jsを利用してウォレット新規作成機能を実装してみる。

前提環境

  • Node.js がインストールされている。
  • Web3.js ライブラリがインストールされている。

web3のインストール

npm install web3

実装

以下の内容でcreate_wallet.jsファイルを作成してください。

const { Web3 } = require('web3');

// Web3.js インスタンスを生成
const web3 = new Web3();

// 新しいウォレットを作成
const newWallet = web3.eth.accounts.create();

console.log('New Wallet Address:', newWallet.address);
console.log('Private Key:', newWallet.privateKey);

実行

node create_wallet.js

結果の例

New Wallet Address:0xDf728219CaD179C4ee0FF4C4F76Aa323B96BeC27
Private Key: ************************
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?