Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: ctsccuo5we6h on January 27, 2024, 04:51:36 AM



Title: Coinomi Wallet Decrypt (bitcoinj)
Post by: ctsccuo5we6h on January 27, 2024, 04:51:36 AM
Hello, I am trying to decrypt a Coinomi wallet. I found out that it uses bitcoinj library + AES-256-CBC with scrypt key + protobuf. When Protos.Wallet.parseFrom(new FileInputStream(walletFile)) I get the error protobuf - 'Protocol message end-group tag did not match expected tag'. What can be the problem?
I am new to using bitcoinj, I apologize for any mistakes
I need to get the data in the following form(i get this from btcrecover)

Code:
version: 20
seed {
  type: DETERMINISTIC_MNEMONIC
  encrypted_data {
    initialisation_vector: "data"
    encrypted_private_key: "data"
  }
}
master_key {
  type: DETERMINISTIC_KEY
  encrypted_data {
    initialisation_vector: "data"
    encrypted_private_key: "data"
  }
  public_key: "data"
  deterministic_key {
    chain_code: "data"
  }
}
encryption_type: ENCRYPTED_SCRYPT_AES
encryption_parameters {
  salt: "data"
  n: 16384
  r: 8
  p: 1
}
pockets {
  network_identifier: "bitcoin.main"
  id: "data"
}

I want to get it with this.

Code:
Protos.Wallet.parseFrom(new FileInputStream(walletFile))


Title: Re: Coinomi Wallet Decrypt (bitcoinj)
Post by: ABCbits on January 27, 2024, 11:11:39 AM
Bitcoinj was never popular in here and there's not much discussion about Coinomi since it's become soruce. So you might also want to ask question on Bitcoinj issue page[1] or one of Coinomi social media[2].

Hello, I am trying to decrypt a Coinomi wallet. I found out that it uses bitcoinj library + AES-256-CBC with scrypt key + protobuf. When Protos.Wallet.parseFrom(new FileInputStream(walletFile)) I get the error protobuf - 'Protocol message end-group tag did not match expected tag'. What can be the problem?

From quick search based on error message, the common problem is the file (in this case coinomi wallet file) is corrupted or the library used to read the file is bugged[3].

[1] https://github.com/bitcoinj/bitcoinj/issues (https://github.com/bitcoinj/bitcoinj/issues)
[2] https://www.coinomi.com/en/ (https://www.coinomi.com/en/), scroll down to bottom of page.
[3] https://stackoverflow.com/a/22108170 (https://stackoverflow.com/a/22108170)


Title: Re: Coinomi Wallet Decrypt (bitcoinj)
Post by: ctsccuo5we6h on January 28, 2024, 01:21:17 PM
Thank you