Failing to move funds for a wallet created by an imported secret.key means:
That the derived signing key(s) are not related for the address(es) holding the fund(s).
How can this be happened?
The esk has 3 parts
64-byte de/encrypted master/root secret key
32-byte non-encryted master/root public key
32-byte non-encryted length chain code
The following cases can be assumed:
esk / passwordHash
empty pw hash
non-empty pw hash
non-encrypted sk
Valid1
Invalid2
encrypted sk
Invalid3
Valid4/Invalid5
The master secret is not encrypted and passwordHash says the same i.e., it’s (the passwordHash) based on an empty password. fund can be recovered if the esk was not altered
The master secret is not encrypted but passwordHash says otherwise i.e., it’s (the passwordHash) based on an some non empty password. fund can be recovered if the esk was not altered
The master secret is encrypted but the passwordHash says it’s not i.e., it’s (the passwordHash) based on an empty password. funds can only be recovered if the password is known and the esk was not altered
The master secret is encrypted and the passwordHash based on the same password as the master secret was encrypted by. fund can be recovered if the pasword is known and the esk was not altered
The master secret is encrypted but the passwordHash based on a different password than the master secret was encrypted by. funds can only be recovered if the encryption password is known or gueassable and the esk was not altered
What do I mean the esk was not altered, I meant if that 3 parts of the esk was not manually modified and the decrypted sk can regenerate the same public key stored in esk.
I know, it seems complicated, but not really.
Check KtoRZ repo, it has some good tools to figure out what has happened.
Thank you. I guess I have to find the password type. I tried to restore wallet from ikar with private key and password hash. The password hash is “null”, but the wallet cannot be restored as it is. By setting it to “”, I was able to restore it to Daedalus, but since Daedalus requires a password, I couldn’t send money. How do I send money using my private key and password hash (“null”)?
It won’t unless you have the password the master secret key was encrypted, because the address your fund is stored, can only be derived from the unencrypted mastercsecret key or the master public key (which is never encrypted) but only unlocked/send if you can decrypt the encrypted master secret key with the password it was encrypted. But why u can see that address and fund in Daedalus?
Becase for the Byron addresses, they are determined buy scanning all UtXOs (because they have random index and the some part of address is encrypted with the root master public key) and they would not be found otherwise) and checking whether the address was encrypted by the root public key).
That is why u can see it but never spend it until u have the proper password to decrypt the encrypted master secret key despite it has an empty password based password hash.
So, do not try to send it without knowing the real password as it would not go through (and that means also that you do not understand/know what you are doing). Also, if you have a situation that you exactly know the password then use the tools I linked above as it wont go through with Daedalus at all (when the esk is encrypted, but the passwordHash is based on an empty password)
From the above result, you can see that the encrypted private key and transmission password are not set.
I don’t understand the process from here to using the wallet.
Do you have any advice for me?
Also, for reference, I will describe how to restore the wallet that I have been doing so far.
This time, the above “encrypted-root-private-key” and another “encrypted-root-private-key” were displayed.
I knew how to use the following, but I got a signature error when transferring funds.
Based on the above issues, using the following tool
I have restored the wallet.
This means that the master secret is encrypted despite the passwordHash is null.
In this case I would not bother with the tool above, but I would use the OpenWall’s John the Ripper.
They merged my PR into their beeding-edge branch so you could use it.
An (by-heart) example of using it (based on your expoorted wallet)
#################################################################################
# 1. Download and build john
#################################################################################
$ git clone https://github.com/openwall/john.git
Cloning into 'john'...
...
$ cd john/src/
$ ./configure
$ make -sj4
# If it's build go to the run directory
$ cd ../run
# test it
$ ./john --test --format=cardano
...
# if all good then
#################################################################################
# 2. Use the built john for your exported wallet the MY_SECRET.KEY.
#################################################################################
$ sed '/encr/!d;s/^.*encr.*: *"\(.*\)",.*/$cardano$1$\1/' "/full/path/to/your/$MY_SERCRET.KEY" | tee wallet.john
"$cardano$1$75bea........."
$ cat <<EOF> wordlist.txt
Paswrod1youthinkisright
passw@rd2
anortherpasswordyouthinkgwouldwork
EOF
$ ./john --wordlist=wordlist.txt wallet.john
# If you're lucky you will see whether your password candidates could decrypt the encrypted master secret key.
# If not you are out of luck, and do not try anything else until you could find the proper encryption password.
# As bruteforcing the encryption password without clue what it could have been is only just a waste of time.
# Why? Because if it would work then all financial systems in the earth could be cracked very easily.
So, if you’re lucky then I can give you the instructions how to transfer your fund.
As I do not want to waste my time for writing it down now, when there is no point of it.
I installed the the OpenWall’s John the Ripper and built the environment, but there is something unclear about the sample when I run it.
$ sed ‘/encr/!d;s/^.encr.: "(.)",.*/$cardano$1$\1/’ “/full/path/to/your/$MY_SERCRET.KEY” | tee wallet.john
“$cardano$1$75bea…”
Which file path should I enter for the part corresponding to $MY_SERCRET.KEY above?
Daedalus’ sercret.key is a binary file, so you can’t pick up the characters with the “sed” command.
This one the 75bea... is your encrypted master secret key.
Or you just can create a simple file that contains this:
$cardano$1$75bea.....
The password or passwords you think was/were used to encrypt the master secret key. Usually, they referring to it as spending password so all your passwords you could remember you used for spending password in Daedalus in the past.
It means that the master secret key was encrypted along the updates when you set the spending password.
Also, hopefully it has not been encrypted multiple times (with the same or different spending passwords) along the updates, because in that case your chance is much lower for decrypting it and it needs different method to try.
{
"encrypted-root-private-key": "root_xsk1...",
"root-public-key": "root_xvk1f~~~~~~~~~~~~~~~~”,
"source": "_usKeys",
"is-empty-passphrase": true,
"has-valid-encryption": false,
"encryption-password": ""
},
I see that the remittance password is not set.
"is-empty-passphrase": true,
If secret.key doesn't have a transfer password, what should I write here?
↓↓
$ cat <
wordlist.txt Paswrod1youthinkisright
passw@rd2
anotherpasswordyouthinkgwouldwork
I may have been asked for a password when the Daedalus wallet was updated. I tried every password I could think of, but john the ripper couldn’t come up with an answer. I will try the dictionary attack.
Thank you for your response. It became clear what I should do.
I used john with the private key(256 characters) and password of my current wallet. but it didn’t work. I tried it with Sherry and the Byron wallet I was riding.
Did you mean decrypted or encrypted?
it was this below, which is in the original IOG’s secret.key file. But yours has the same chaincode and publickey.
This is the 64-byte (126-chars) decrypted part of the encrypted master secret key above: 403e4a55591c9f0665437a13dda3d6ca698cb28f3ff3cfdf79d62c7156900546d963ef6126d62f71f6073d159da9e419413c5627705513f2ac645efa3171be85