Skip to content

Instantly share code, notes, and snippets.

@you21979
Created December 20, 2018 13:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save you21979/0aa9acf1b6d8eb78642ecded4867dea7 to your computer and use it in GitHub Desktop.
Save you21979/0aa9acf1b6d8eb78642ecded4867dea7 to your computer and use it in GitHub Desktop.
"use strict";
const oldmnemonic = require("electrum-oldmnemonic");
const bitcoin = require("bitcoinjs-lib")
const words = ""
const oldseedhex = oldmnemonic.mn_decode(words.split(' '));
console.log(oldseedhex)
const monacoin = {
messagePrefix: '\x18Monacoin Signed Message:\n',
bip32: {
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 0x32,
scriptHash: 0x37,
wif: 0xB2
};
const m = bitcoin.HDNode.fromSeedBuffer(Buffer.from(oldseedhex, 'hex'), monacoin)
console.log(m.derivePath("m/0'/0/0").getAddress())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment