Skip to content

Conversation

@Gnonthgol
Copy link

Simple code to enable encryption of the database. Uses Berkeley DB built in AES encryption with a password from the new dbpassword option.
1FabZdhzEQJC7qJxb3k1RHVMf5gctB8qbh

@lost-tty
Copy link

I think encryption should be limited to wallet.dat, so one could have multiple wallets with different passwords. This patch seems to encrypt blkindex.dat and addr.dat, too.

Also, a GUI prompt to enter the password would be useful.

@Gnonthgol
Copy link
Author

It is not possible to selectively encrypt parts of the database environment with Berkeley DB. There is several possible solutions but the best long term is to encrypt everything and add a export/import wallet feature.

The gui prompt was a good idea, remember to add a non-GUI prompt for running headless.

@gavinandresen
Copy link
Contributor

From http://www.bitcoin.org/smf/index.php?topic=2698.msg36793#msg36793

First, unless I'm reading the bdb docs wrong, you specify a password at database creation time. And then can't change it.

So, at the very least, somebody would have to write code that (safely) rewrote wallet.dat when you set or unset or changed the password.

Second, encrypting everything in wallet.dat means you'd have to enter your wallet password as soon as you started bitcoin (because user preference are stored in there right now), when ideally you should only enter the password as you're sending coins.

And third, there are all sorts of usability issues with passwords. Users forget their passwords. They mis-type them. I wouldn't be terribly surprised if doing the simple thing and just encrypting the whole wallet with one password resulted in more lost bitcoins due to forgotten passwords than wallets stolen by trojans.

I think creating a safe, useful wallet protection feature isn't easy, and there a lot of wrong ways to do it.

@gavinandresen
Copy link
Contributor

Gnonthgol: if you're motivated to solve this right, please jump onto the forums and work out a good approach; I think this is a very important feature to get right.

@lost-tty
Copy link

Also, database encryption can currently be accomplished using something like encfs or Truecrypt to encrypt the whole .bitcoin directory. That's probably a better workaround until we know how to get this right.

Closed. Further discussion should happen on the forums as Gavin suggested.

zathras-crypto referenced this pull request in zathras-crypto/omnicore Jul 3, 2014
rdponticelli pushed a commit to Criptomonedas/bitcoin that referenced this pull request Nov 26, 2014
3ab1178 build: grab full paths to host tools (Cory Fields)
maflcko referenced this pull request in maflcko/bitcoin-core Sep 3, 2015
fix -prune arg comment; enable wallet is possible now
TheBlueMatt pushed a commit to TheBlueMatt/bitcoin that referenced this pull request Oct 20, 2015
a671356 Squashed 'src/secp256k1/' changes from 22f60a6..71ed475 (Pieter Wuille)
77269e0 Update to new libsecp256k1 (Pieter Wuille)
ptschip pushed a commit to ptschip/bitcoin that referenced this pull request Jul 6, 2016
Cleanup thinblocks in flight on socket disconnect
CryptAxe pushed a commit to CryptAxe/bitcoin that referenced this pull request Nov 15, 2017
SCDB hashMerkleRoot commits & network updates
classesjack pushed a commit to classesjack/bitcoin that referenced this pull request Jan 2, 2018
CryptAxe pushed a commit to CryptAxe/bitcoin that referenced this pull request Mar 11, 2018
Update instructions and some fixes for Ubuntu building
Warchant referenced this pull request in VeriBlock/vbk-ri-btc Dec 31, 2019
* fix the net propagation

* Remove seeds from regtest

Co-authored-by: Bohdan <[email protected]>
velesnetwork referenced this pull request in velescore/veles Jan 12, 2020
Ensure backward compatibility for mining-related methods using new rpcbackcompatible option which will be enabled by default.
jonasschnelli added a commit that referenced this pull request Dec 1, 2020
…cale{Short,Long}Date

86b1ab6 refactor: Replace deprecated Qt::SystemLocale{Short,Long}Date (Hennadii Stepanov)

Pull request description:

  As all deprecated warning in Qt 5.15.0 were eliminated in #46, Qt 5.15.1 introduced another one that is fixed in this PR.

  Required for #20182.

  Details in Qt docs:
  - https://doc.qt.io/qt-5/qdatetime.html#toString-1
  - https://doc.qt.io/qt-5/qdate.html#toString-1

ACKs for top commit:
  jarolrod:
    Tested ACK 86b1ab6 on MacOS 10.15.7 and Arch Linux both with Qt 5.15.1
  jonasschnelli:
    Tested ACK 86b1ab6

Tree-SHA512: 1dbba8ee70c895bf58317172a9901cdbe5503b1d6258f51caaae88d88d332d9fbd4697c995192d31e3618ddfd532c5f5881289b3af1184422e5a9263a1224115
rajarshimaitra pushed a commit to rajarshimaitra/bitcoin that referenced this pull request Mar 23, 2021
satindergrewal pushed a commit to chips-blockchain/chipschain that referenced this pull request Jun 22, 2021
rajarshimaitra pushed a commit to rajarshimaitra/bitcoin that referenced this pull request Aug 5, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
This pull request was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants