Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does Armory's LMDB file contains the private key too? How can I decrypt it and read the LMDB file? #356

Open
avatar-lavventura opened this issue Jan 2, 2021 · 0 comments

Comments

@avatar-lavventura
Copy link

avatar-lavventura commented Jan 2, 2021

Armory creates Wallet file and lmdb file when a new wallet is created. I did a super deep disk clean to see if I could recover the wallet file but I was unable to find it. Only file I was able to find that is armory_*****_wallet.lmdb mainly around 102KiB. I am not sure does it contains anything related to the Wallet file but I am just trying to read what's in it.

Is the following approach possible ?

I've no idea but it seems to me there's a chance the private keys are in the Lightning Memory-Mapped DataBase (LMDB) file. Probably encrypted using the wallet password.

I have created a wallet from scratch and share my results with it, example lmdb file that is created by the Armory.

I have followed guide-1, guide-2, and guide-3 to be able to read the file.

my_script:

#!/usr/bin/env python3
import lmdb
import caffe

lmdb_file = "armory_2tG9psLQX_wallet.lmdb" 
lmdb_env = lmdb.open(lmdb_file, subdir=False)
lmdb_txn = lmdb_env.begin()
lmdb_cursor = lmdb_txn.cursor()
datum = caffe.proto.caffe_pb2.Datum()

for key, value in lmdb_cursor:
    print(key)
    print(value)

print("----------------")
for key, value in lmdb_cursor:
    print(key.decode('utf-8'))
    print(value.decode('utf-8'))`

This only prints out:

b'99AxiN7y'
b'\x00\x00\x00\x00\x00\x00\x02\x00\x01\x00\x00\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00k\x00\x00\x00\x00\x00\x00\x00\n\x00\x00\x00\x00\x00\x00\x00'
b'WalletHeader'
b'\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00'

--------------

99AxiN7y
k

WalletHeader

Since the file size is much larger I am not sure why does it able to print only a single character as a value. Is there any other way to read the lmdb file in depth or its size does not matter? Seems like 99AxiN7y is the wallet-id of the original wallet file.

I am sure the file is not corrupted where I have tried with a new armory_***wallet.lmdb file that is created by the Armory and similiar result is generated.

=> The real question is if the LMDB file contains the private keys too and can we recover the wallet from it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant