In 2017 I created a wallet in Bitcoin core and protected it with a password. The password contains characters like ".,;". When I decided to send my bitcoins the wallet wrote an error "invalid password". Where can I see the specification/specification/clear requirements for the password to be created? I have a suspicion that the use of special characters caused problems with the wallet. Thanks in advance for the answers.
1 Answer
Where can I see the specification/specification/clear requirements for the password to be created?
I suspect the source code is the best guide.
the wallet wrote an error "invalid password".
That phrase doesn't occur in the source code of the current version (23.0).
The file qt\askpassphrasedialog.cpp
contains the message "The passphrase entered for the wallet decryption was incorrect."
case Unlock:
try {
if (!model->setWalletLocked(false, oldpass)) {
QMessageBox::critical(this, tr("Wallet unlock failed"),
tr("The passphrase entered for the wallet decryption was incorrect."));
} else {
QDialog::accept(); // Success
}
} catch (const std::runtime_error& e) {
QMessageBox::critical(this, tr("Wallet unlock failed"), e.what());
}
break;
So far as I can see from a quick look, there's no special processing of the entered password (referred to as a passphrase in the code). So I'd certainly expect that normal punctuation like ., , and ; would not cause any issues.
When you set a password, the code does produce the ominous warning "Warning: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR BITCOINS!"
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm wallet encryption"),
tr("Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR BITCOINS</b>!") + "<br><br>" + tr("Are you sure you wish to encrypt your wallet?"),
QMessageBox::Yes|QMessageBox::Cancel,
QMessageBox::Cancel);
There are other questions here that ask about password recovery for Bitcoin code based on partially known passwords. Answers to those questions may be helpful.