Java Code Examples for org.bitcoinj.crypto.DeterministicKey#serializePrivB58()

The following examples show how to use org.bitcoinj.crypto.DeterministicKey#serializePrivB58() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 6 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();
        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }
 
Example 2
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();

    RequestorBtc.getUTXOListLtcNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 3
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();


    RequestorBtc.getUTXOListBch(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 4
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.onWalletCreated(wallet);


    RequestorBtc.getUTXOListBch(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 5
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();

    RequestorBtc.getUTXOListBtgNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 6
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.onWalletCreated(wallet);

    RequestorBtc.getUTXOListBtgNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 7
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();


    RequestorBtc.getUTXOList(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            UTXOListResponse utxoResponse = (UTXOListResponse) response;
            setUTXO(utxoResponse.getUTXOList());
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 8
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.onWalletCreated(wallet);


    RequestorBtc.getUTXOList(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            UTXOListResponse utxoResponse = (UTXOListResponse) response;
            setUTXO(utxoResponse.getUTXOList());
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 9
Source File: HDMnemonicKeystore.java    From token-core-android with Apache License 2.0 5 votes vote down vote up
public HDMnemonicKeystore(Metadata metadata, String password, List<String> mnemonics, String path, String id) {
  MnemonicUtil.validateMnemonics(mnemonics);
  DeterministicSeed seed = new DeterministicSeed(mnemonics, null, "", 0L);
  DeterministicKeyChain keyChain = DeterministicKeyChain.builder().seed(seed).build();
  this.mnemonicPath = path;

  DeterministicKey parent = keyChain.getKeyByPath(BIP44Util.generatePath(path), true);
  NetworkParameters networkParameters = metadata.isMainNet() ? MainNetParams.get() : TestNet3Params.get();
  this.xpub = parent.serializePubB58(networkParameters);
  String xprv = parent.serializePrivB58(networkParameters);
  DeterministicKey mainAddressKey = keyChain.getKeyByPath(BIP44Util.generatePath(path + "/0/0"), true);
  if (Metadata.P2WPKH.equals(metadata.getSegWit())) {
    this.address = new SegWitBitcoinAddressCreator(networkParameters).fromPrivateKey(mainAddressKey.getPrivateKeyAsHex());
  } else {
    this.address = mainAddressKey.toAddress(networkParameters).toBase58();
  }
  if (metadata.getTimestamp() == 0) {
    metadata.setTimestamp(DateUtil.getUTCTime());
  }
  metadata.setWalletType(Metadata.HD);

  this.crypto = Crypto.createPBKDF2CryptoWithKDFCached(password, xprv.getBytes(Charset.forName("UTF-8")));
  this.metadata = metadata;
  this.encMnemonic = crypto.deriveEncPair(password, Joiner.on(" ").join(mnemonics).getBytes());
  this.crypto.clearCachedDerivedKey();

  this.version = VERSION;
  this.info = new Info();
  this.id = Strings.isNullOrEmpty(id) ? UUID.randomUUID().toString() : id;
}
 
Example 10
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.onWalletCreated(wallet);

    RequestorBtc.getUTXOListLtcNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 11
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();

    RequestorBtc.getUTXOListSbtcNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 12
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.onWalletCreated(wallet);

    RequestorBtc.getUTXOListSbtcNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItem> utxos = (List<UTXOItem>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 13
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock2(String mnemonicCode, Runnable callback) {
    if (mnemonicCode.charAt(mnemonicCode.length() - 1) == ' ') {
        mnemonicCode = mnemonicCode.substring(0, mnemonicCode.length() - 1);
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    callback.run();

    RequestorBtc.getUTXOListDgbNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItemDgb> utxos = (List<UTXOItemDgb>)response;
            setUTXO(utxos);
        }

        @Override
        public void onFailure(String msg) {

        }
    });
}
 
Example 14
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 5 votes vote down vote up
public void restoreFromBlock(String mnemonicCode, WalletCreationCallback callback) {
    mnemonicCode = mnemonicCode.trim();
    if (mnemonicCode.equals("")) {
        callback.onWalletCreated(null);
        return;
    }

    DeterministicSeed seed = new DeterministicSeed(Splitter.on(' ').splitToList(mnemonicCode), null, "", 0);

    wallet = Wallet.fromSeed(params, seed);
    mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
    //sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));
    walletFriendlyAddress = wallet.currentReceiveAddress().toString();

    ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
    DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
    xprvKey = de.serializePrivB58(params);

    wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

    RequestorBtc.getUTXOListDgbNew(wallet.currentReceiveAddress().toString(), new ApiMethods.RequestListener() {
        @Override
        public void onSuccess(Object response) {
            List<UTXOItemDgb> utxos = (List<UTXOItemDgb>)response;
            setUTXO(utxos);
            callback.onWalletCreated(wallet);
        }

        @Override
        public void onFailure(String msg) {
            callback.onWalletCreated(wallet);
        }
    });
}
 
Example 15
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();

        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }
 
Example 16
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();

        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }
 
Example 17
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();

        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }
 
Example 18
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();

        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }
 
Example 19
Source File: WalletManager.java    From guarda-android-wallets with GNU General Public License v3.0 4 votes vote down vote up
public void createWallet2(String passphrase, Runnable callback) {

        wallet = new Wallet(params);
        DeterministicSeed seed = wallet.getKeyChainSeed();

        mnemonicKey = Joiner.on(" ").join(seed.getMnemonicCode());
        sharedManager.setLastSyncedBlock(Coders.encodeBase64(mnemonicKey));

        walletFriendlyAddress = wallet.currentReceiveAddress().toString();

        ChildNumber childNumber = new ChildNumber(ChildNumber.HARDENED_BIT);
        DeterministicKey de = wallet.getKeyByPath(ImmutableList.of(childNumber));
        xprvKey = de.serializePrivB58(params);

        wifKey = wallet.currentReceiveKey().getPrivateKeyAsWiF(params);

        callback.run();
    }