How to open bitcoin-qt wallet with bitcoinj?

0 votes

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).

How to solve this?

Aug 24, 2018 in Blockchain by digger
• 26,600 points
74 views

1 answer to this question.

0 votes

I found this issue solved at the following link: https://bitcoin.stackexchange.com/questions/8463/open-bitcoin-qt-wallet-with-bitcoinj/8466?noredirect=1#8466 .Visit it and check if It solves your problem.

answered Aug 24, 2018 by slayer
• 29,240 points

Related Questions In Blockchain

0 votes
1 answer

How to check Bitcoin Wallet ?

This can be done using Extended Public ...READ MORE

answered Jul 13, 2018 in Blockchain by Perry
• 17,090 points
108 views
0 votes
1 answer

How to create a new wallet on a blockchain?

Firstly, you need to have a clear ...READ MORE

answered Apr 4, 2018 in Blockchain by Christine
• 15,810 points
93 views
0 votes
1 answer

How Bitcoin wallet find unspent transaction output(UTXOs)?

The wallet apps are connected to the ...READ MORE

answered May 22, 2018 in Blockchain by Shashank
• 10,350 points
119 views
0 votes
1 answer
0 votes
1 answer

Protocols used in a distributed/dlt system for the nodes to establish communication

yes all are over TCP/IP connections secured by TLS encryption in hashgraph architecture-hashgraph, ...READ MORE

answered Aug 6, 2018 in Blockchain by ariaholic
• 7,340 points
101 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,810 points
186 views
0 votes
1 answer
0 votes
1 answer

How to check history of blockchain.info wallet?

In the link you mentioned(https://blockchain.info/q), there are ...READ MORE

answered Jul 23, 2018 in Blockchain by slayer
• 29,240 points
62 views
0 votes
1 answer