bitcoinbitcoinj

Can I open bitcoin-qt wallet with bitcoinj


I am trying to open my bitcoin-qt wallet with bitcoinj. I have this simple code:

private static final File WALLET_FILE = new File("__PATH__");

public static void main(String[] args) {
    Wallet wallet;
    try {
        wallet = Wallet.loadFromFile(WALLET_FILE);
    } catch (IOException e) {
    System.out.println("Couldn't open wallet: " + e);
    return;
    }

    System.out.println("Balance: " + wallet.getBalance());
}

I get an error:

Couldn't open wallet: com.google.protobuf.InvalidProtocolBufferException: Protocol message contained an invalid tag (zero).

I check the status on bitcoin-qt and my wallet seems synchronize.

I am far from an expert in bitcoin, but I wonder if you know the solution.


Solution

  • apparently this is not possible, I asked the question on bitcoin stackechange and they told me it is not the same format:

    https://bitcoin.stackexchange.com/questions/8463/open-bitcoin-qt-wallet-with-bitcoinj/8466?noredirect=1#8466