<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Wallet_encryption</id>
	<title>Wallet encryption - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://en.zaoniao.it/index.php?action=history&amp;feed=atom&amp;title=Wallet_encryption"/>
	<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Wallet_encryption&amp;action=history"/>
	<updated>2026-05-15T10:22:19Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.32.0</generator>
	<entry>
		<id>http://en.zaoniao.it/index.php?title=Wallet_encryption&amp;diff=2596&amp;oldid=prev</id>
		<title>Admin: Created page with &quot;This page describes the algorithm used for encrypting the '''wallet.dat''' file used in the original Bitcoin client.  Wallet encryption uses [https...&quot;</title>
		<link rel="alternate" type="text/html" href="http://en.zaoniao.it/index.php?title=Wallet_encryption&amp;diff=2596&amp;oldid=prev"/>
		<updated>2019-03-27T06:33:44Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;This page describes the algorithm used for encrypting the &amp;#039;&amp;#039;&amp;#039;&lt;a href=&quot;/Wallet#Bitcoin_Core&quot; title=&quot;Wallet&quot;&gt;wallet.dat&lt;/a&gt;&amp;#039;&amp;#039;&amp;#039; file used in the original &lt;a href=&quot;/Bitcoin_client&quot; class=&quot;mw-redirect&quot; title=&quot;Bitcoin client&quot;&gt;Bitcoin client&lt;/a&gt;.  Wallet encryption uses [https...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;This page describes the algorithm used for encrypting the '''[[Wallet#Bitcoin_Core|wallet.dat]]''' file used in the original [[Bitcoin client]].&lt;br /&gt;
&lt;br /&gt;
Wallet encryption uses [https://en.wikipedia.org/wiki/AES-256 &amp;lt;span title=&amp;quot;Advanced Encryption Standard with 256 bit key and Cipher Block Chaining&amp;quot;&amp;gt;AES-256-CBC&amp;lt;/span&amp;gt;] to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key&lt;br /&gt;
which is entirely random. This master key is then encrypted with&lt;br /&gt;
AES-256-CBC with a key derived from the passphrase using [https://en.wikipedia.org/wiki/SHA-512 SHA-512] and&lt;br /&gt;
OpenSSL's &amp;lt;code&amp;gt;EVP_BytesToKey&amp;lt;/code&amp;gt; and a dynamic number of rounds determined by&lt;br /&gt;
the speed of the machine which does the initial encryption (and is&lt;br /&gt;
updated based on the speed of a computer which does a subsequent&lt;br /&gt;
passphrase change). Although the underlying code supports multiple&lt;br /&gt;
encrypted copies of the same master key (and thus multiple passphrases)&lt;br /&gt;
the client does not yet have a method to add additional passphrases.&lt;br /&gt;
&lt;br /&gt;
At runtime, the client loads the wallet as it normally would, however&lt;br /&gt;
the keystore stores the keys in encrypted form. When the passphrase&lt;br /&gt;
is required (to top up keypool or send coins) it will either be queried&lt;br /&gt;
by a GUI prompt, or must first be entered with the &amp;lt;code&amp;gt;walletpassphrase&amp;lt;/code&amp;gt;&lt;br /&gt;
[[Original_Bitcoin_client/API_calls_list#Full_list|RPC command]]. This will change the wallet to &amp;quot;unlocked&amp;quot; state where the&lt;br /&gt;
unencrypted master key is stored in memory (in the case of GUI, only for&lt;br /&gt;
long enough to complete the requested operation, in RPC, for as long as&lt;br /&gt;
is specified by the second parameter to &amp;lt;code&amp;gt;walletpassphrase&amp;lt;/code&amp;gt;). The wallet is&lt;br /&gt;
then locked (or can be manually locked using the &amp;lt;code&amp;gt;walletlock&amp;lt;/code&amp;gt; RPC command)&lt;br /&gt;
and the unencrypted master key is removed from memory.&lt;br /&gt;
&lt;br /&gt;
== Implementation details of wallet encryption ==&lt;br /&gt;
&lt;br /&gt;
When the wallet is locked, calls to &amp;lt;code&amp;gt;sendtoaddress&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sendfrom&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;sendmany&amp;lt;/code&amp;gt;, and &amp;lt;code&amp;gt;keypoolrefill&amp;lt;/code&amp;gt; will return ''Error -13: &amp;quot;Error: Please enter the wallet passphrase with walletpassphrase first.&amp;quot;''&lt;br /&gt;
&lt;br /&gt;
When the wallet is unlocked, calls to &amp;lt;code&amp;gt;walletpassphrase&amp;lt;/code&amp;gt; will fail.&lt;br /&gt;
&lt;br /&gt;
When a wallet is encrypted, the passphrase is required to top up the&lt;br /&gt;
keypool, thus, if the passphrase is rarely entered, it is possible that&lt;br /&gt;
keypool might run out. In this case, the default key will be used as the&lt;br /&gt;
target for payouts for mining, and calls to &amp;lt;code&amp;gt;getnewaddress&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;getaccount&amp;lt;/code&amp;gt;&lt;br /&gt;
address will return an error. In order to prevent such cases, the keypool&lt;br /&gt;
is automatically refilled when &amp;lt;code&amp;gt;walletpassphrase&amp;lt;/code&amp;gt; is called with a correct&lt;br /&gt;
passphrase and when &amp;lt;code&amp;gt;topupkeypool&amp;lt;/code&amp;gt; is called (while the wallet is unlocked).&lt;br /&gt;
Note that the keypool continues to be topped up on various occasions when&lt;br /&gt;
a new key from pool is used and the wallet is unlocked (or unencrypted).&lt;br /&gt;
&lt;br /&gt;
When wallet passphrase enrcyption becomes enabled, any unused keys from the keypool are flushed (marked as used) and new keys protected with encyption are added. &amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;For this reason, make a new backup of your wallet so that you will be able to recover the keys from the new key pool should access to your backups be necessary.&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Source==&lt;br /&gt;
&lt;br /&gt;
[http://bitcoin.it/ http://bitcoin.it/]&lt;br /&gt;
&lt;br /&gt;
[[Category:EWallets]]&lt;br /&gt;
[[Category:Wallets]]&lt;br /&gt;
[[Category:Anonymity and security]]&lt;br /&gt;
[[Category:Bitcoin]]&lt;br /&gt;
==See Also on BitcoinWiki==&lt;br /&gt;
* [[Best Bitcoin Dice]]&lt;br /&gt;
* [[Gourl]]&lt;br /&gt;
* [[Bitcoin Jobs Report]]&lt;br /&gt;
* [[Test Cases]]&lt;br /&gt;
* [[Lets Talk Bitcoin]]&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
		
	</entry>
</feed>