Skip to content

Instantly share code, notes, and snippets.

@fkfk
Created July 1, 2019 01:04
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 fkfk/e45daa320a04ec5b909186af8fce2203 to your computer and use it in GitHub Desktop.
Save fkfk/e45daa320a04ec5b909186af8fce2203 to your computer and use it in GitHub Desktop.
use monacoin
import 'package:bitcoin_flutter/bitcoin_flutter.dart';
import 'package:bip32/bip32.dart' as bip32;
import 'package:bip39/bip39.dart' as bip39;
final MONACOIN = new NetworkType(
messagePrefix: '\x19Monacoin Signed Message:\n',
bech32: 'mona',
bip32: new Bip32Type(
public: 0x0488b21e,
private: 0x0488ade4
),
pubKeyHash: 50,
scriptHash: 55,
wif: 178
);
main () {
var mnemonic = "like like like like like like like like like like like like"; // your mnemonic phrase
var seed = bip39.mnemonicToSeed(mnemonic);
var masterWallet = new HDWallet.fromSeed(seed, network: MONACOIN);
var node = masterWallet.derivePath("m/44'/22'/0'");
print(node.derive(0).derive(0).address); // => MPb8dEsv7TuEoXKNSmBAyQXgPnuYByxbb2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment