Wallet encryption - BitcoinWiki (2024)

This page describes the algorithm used for encrypting the wallet.dat file used in the original Bitcoin client.

Wallet encryption uses AES-256-CBC to encrypt only the private keys that are held in a wallet. The keys are encrypted with a master key which is entirely random. This master key is then encrypted with AES-256-CBC with a key derived from the passphrase using SHA-512 and OpenSSL’s EVP_BytesToKey and a dynamic number of rounds determined by the speed of the machine which does the initial encryption (and is updated based on the speed of a computer which does a subsequent passphrase change). Although the underlying code supports multiple encrypted copies of the same master key (and thus multiple passphrases) the client does not yet have a method to add additional passphrases.

At runtime, the client loads the wallet as it normally would, however the keystore stores the keys in encrypted form. When the passphrase is required (to top up keypool or send coins) it will either be queried by a GUI prompt, or must first be entered with the walletpassphrase RPC command. This will change the wallet to “unlocked” state where the unencrypted master key is stored in memory (in the case of GUI, only for long enough to complete the requested operation, in RPC, for as long as is specified by the second parameter to walletpassphrase). The wallet is then locked (or can be manually locked using the walletlock RPC command) and the unencrypted master key is removed from memory.

Implementation details of wallet encryption

When the wallet is locked, calls to sendtoaddress, sendfrom, sendmany, and keypoolrefill will return Error -13: “Error: Please enter the wallet passphrase with walletpassphrase first.”

When the wallet is unlocked, calls to walletpassphrase will fail.

When a wallet is encrypted, the passphrase is required to top up the keypool, thus, if the passphrase is rarely entered, it is possible that keypool might run out. In this case, the default key will be used as the target for payouts for mining, and calls to getnewaddress and getaccount address will return an error. In order to prevent such cases, the keypool is automatically refilled when walletpassphrase is called with a correct passphrase and when topupkeypool is called (while the wallet is unlocked). Note that the keypool continues to be topped up on various occasions when a new key from pool is used and the wallet is unlocked (or unencrypted).

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. 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.

Source

http://bitcoin.it/

See Also on BitcoinWiki

Wallet encryption - BitcoinWiki (2024)
Top Articles
What Are the Five Functional Components Of an Ehr?
Logs Preview - en
Netr Aerial Viewer
فیلم رهگیر دوبله فارسی بدون سانسور نماشا
The Atlanta Constitution from Atlanta, Georgia
1970 Chevrolet Chevelle SS - Skyway Classics
Items/Tm/Hm cheats for Pokemon FireRed on GBA
The Rise of Breckie Hill: How She Became a Social Media Star | Entertainment
Hartford Healthcare Employee Tools
The fabulous trio of the Miller sisters
Bowie Tx Craigslist
Craigslist List Albuquerque: Your Ultimate Guide to Buying, Selling, and Finding Everything - First Republic Craigslist
Most McDonald's by Country 2024
Alexandria Van Starrenburg
Craigslist Edmond Oklahoma
Tcu Jaggaer
Grab this ice cream maker while it's discounted in Walmart's sale | Digital Trends
History of Osceola County
Pay Boot Barn Credit Card
Apply for a credit card
Nevermore: What Doesn't Kill
Mail.zsthost Change Password
Culver's Flavor Of The Day Taylor Dr
Teen Vogue Video Series
All Obituaries | Gateway-Forest Lawn Funeral Home | Lake City FL funeral home and cremation Lake City FL funeral home and cremation
Roane County Arrests Today
Jeff Nippard Push Pull Program Pdf
Surplus property Definition: 397 Samples | Law Insider
Hefkervelt Blog
Nearest Ups Ground Drop Off
Imagetrend Elite Delaware
Vlacs Maestro Login
Abga Gestation Calculator
Aid Office On 59Th Ashland
Craigslist West Seneca
Kvoa Tv Schedule
拿到绿卡后一亩三分地
Greater Keene Men's Softball
Sams La Habra Gas Price
Alpha Asher Chapter 130
Babbychula
Temu Y2K
Timberwolves Point Guard History
Craigslist en Santa Cruz, California: Tu Guía Definitiva para Comprar, Vender e Intercambiar - First Republic Craigslist
Carteret County Busted Paper
13 Fun & Best Things to Do in Hurricane, Utah
Dickdrainersx Jessica Marie
Crystal Glassware Ebay
Menu Forest Lake – The Grillium Restaurant
Lorton Transfer Station
Game Like Tales Of Androgyny
Latest Posts
Article information

Author: Virgilio Hermann JD

Last Updated:

Views: 5631

Rating: 4 / 5 (41 voted)

Reviews: 88% of readers found this page helpful

Author information

Name: Virgilio Hermann JD

Birthday: 1997-12-21

Address: 6946 Schoen Cove, Sipesshire, MO 55944

Phone: +3763365785260

Job: Accounting Engineer

Hobby: Web surfing, Rafting, Dowsing, Stand-up comedy, Ghost hunting, Swimming, Amateur radio

Introduction: My name is Virgilio Hermann JD, I am a fine, gifted, beautiful, encouraging, kind, talented, zealous person who loves writing and wants to share my knowledge and understanding with you.