trims mas atas infonya.
udah ane download, ternyata berupa file html yg kalok dibuka tampilannya mirip dgn yg berada di web
https://iancoleman.io/bip39/Terus terang jika menyangkut mnemonic, seed dan private key, saya pribadi juga akan sangat berhati-hati karena informasi sensitif tersebut berkaitan dengan aset crypto yang kita miliki.
Dibawah ini saya buat script node js untuk men-generate BIP39 Mnemonic secara random
import * as bitcoin from "bitcoinjs-lib";
const bip32 = BIP32Factory(ecc);
import { BIP32Factory } from 'bip32';
import * as ecc from "tiny-secp256k1";
import * as bip39 from 'bip39';
const testnet = bitcoin.networks.testnet;
bitcoin.initEccLib(ecc);
const mnemonic = bip39.generateMnemonic();
const seed = bip39.mnemonicToSeedSync(mnemonic);
const root = bip32.fromSeed(seed, testnet);
const xprv = root.toBase58();
const xpub = root.neutered().toBase58();
console.log('BIP39 Mnemonic :', mnemonic);
console.log('BIP39 Seed :', seed.toString('hex'));
console.log('BIP32 Root Key :', xprv);
console.log('BIP32 Root PubKey :', xpub);
tidak banyak yg ane bisa dengan nodejs, tapi kalok hanya menampilkan tulisan hello world atau tulisan2 lain, ane masih bisa.
apakah ada yg salah dengan instalasi nodejs di pc ane, perasaan udah ane impor jga modules2 yg diperlukan, namun tiap kali menjalankan code2 tersebut, hasilnya selalu gagal n muncul perringatan.
(node:13396) Warning: To load an ES module, set "type": "module" in the package.json or use the .mjs extension.
(Use `node --trace-warnings ...` to show where the warning was created)
C:\Users\2nx-8astian\testing.js:1
import * as bitcoin from "bitcoinjs-lib";
^^^^^^
SyntaxError: Cannot use import statement outside a module