Difference between revisions of "Cold storage"

From Bitcoin Wiki
Jump to: navigation, search
m (Comparison between multisignature and cold storage for security: typo)
(Moving information about specific published cold storage guides to Backup And Storage Methods)
 
(5 intermediate revisions by one other user not shown)
Line 5: Line 5:
 
Special-purpose [[hardware wallet]]s are also a kind of cold storage solution but this article will mostly deal with cold storage using general purpose computing hardware.
 
Special-purpose [[hardware wallet]]s are also a kind of cold storage solution but this article will mostly deal with cold storage using general purpose computing hardware.
  
== Conceptiual How-to ==
+
See [[Backup and Storage Methods#Cold Storage Methods]] for a review of published cold storage methods.
 +
 
 +
== Conceptual How-to ==
 
# Set up an online computer which has an internet connection, and an offline computer which is securely [https://en.wikipedia.org/wiki/Air_gap_%28networking%29 airgapped].
 
# Set up an online computer which has an internet connection, and an offline computer which is securely [https://en.wikipedia.org/wiki/Air_gap_%28networking%29 airgapped].
 
# The offline computer must have bitcoin wallet software installed. Use the software to generate a wallet and write down its [[seed phrase]] on paper or another medium.
 
# The offline computer must have bitcoin wallet software installed. Use the software to generate a wallet and write down its [[seed phrase]] on paper or another medium.
# Obtain the master public key of the wallet you just generated and transfer it to the online computer. Use it to create a watch-only wallet on the online computer.
+
# Obtain the [[Deterministic wallet#Master public key|master public key]] of the wallet you just generated and transfer it to the online computer. Use it to create a watch-only wallet on the online computer.
 
# The watch-only wallet on the online computer can provide bitcoin [[address]]es used for receiving money, and can tell the user when [[transaction]]s are received and how many [[confirmation]]s they have.
 
# The watch-only wallet on the online computer can provide bitcoin [[address]]es used for receiving money, and can tell the user when [[transaction]]s are received and how many [[confirmation]]s they have.
 
# For spending have the watch-only wallet create an [[transaction]] without the signatures which makes it valid.
 
# For spending have the watch-only wallet create an [[transaction]] without the signatures which makes it valid.
Line 18: Line 20:
 
A good solution for making a secure offline computer is to buy an old, used laptop or phone built by a reputable manufacturer. Then completely wipe it, do not connect to the internet and install only an operating system and bitcoin wallet from a USB drive<ref>https://twitter.com/peterktodd/status/1078350142644731904</ref>.
 
A good solution for making a secure offline computer is to buy an old, used laptop or phone built by a reputable manufacturer. Then completely wipe it, do not connect to the internet and install only an operating system and bitcoin wallet from a USB drive<ref>https://twitter.com/peterktodd/status/1078350142644731904</ref>.
  
Another option is to use a live operating system as the offline computer. This option is perhaps less secure but may be more convienant.
+
Another option is to use a live operating system as the offline computer. This option is perhaps less secure, as sophisticated malware may be able to survive the live OS boot, but the method may be more convenient.
  
 
For some people other attacks must be considered. Wiping a computer may not be enough to remove threats of HDD firmware reprogramming, BIOS reprogramming or any other memory which persists after a clean reinstallation of the system<ref>https://www.reddit.com/r/Bitcoin/comments/a8m031/proof_of_keys_proof_of_trust_bitcoin_independence/ecdz47t/</ref>.
 
For some people other attacks must be considered. Wiping a computer may not be enough to remove threats of HDD firmware reprogramming, BIOS reprogramming or any other memory which persists after a clean reinstallation of the system<ref>https://www.reddit.com/r/Bitcoin/comments/a8m031/proof_of_keys_proof_of_trust_bitcoin_independence/ecdz47t/</ref>.
  
If the offline and online computer are kept close together (in the same room) then theoretically information can still be transmitted past the air gap using certain sidechannels like: RF, audio, light, magnetic, thermal. For further details see the wikipedia article on [https://en.wikipedia.org/wiki/Air-gap_malware Air-gap malware]. For this reason it could be a good idea to keep the offline and online computers physically far apart.
+
If the offline and online computer are kept close together (in the same room) then theoretically information can still be transmitted past the air gap using certain sidechannels like: RF, audio, light, magnetic, thermal. For further details see the wikipedia article on [https://en.wikipedia.org/wiki/Air-gap_malware Air-gap malware]. For this reason it could be a good idea to keep the offline and online computers physically far apart, and unplug the power cable from the laptop so it runs on battery power only.
  
 
== Wallet software ==
 
== Wallet software ==
Line 113: Line 115:
  
 
Cold storage aims to reducing the chance of failure due to hackers or malware. [[Multisignature]] aims to avoid a single point of failure. It is entirely possible to combine the two techniques, and create cold storage [[multisignature]] wallets.
 
Cold storage aims to reducing the chance of failure due to hackers or malware. [[Multisignature]] aims to avoid a single point of failure. It is entirely possible to combine the two techniques, and create cold storage [[multisignature]] wallets.
 
== Reviews of cold storage tutorials ==
 
 
=== [[Electrum]] wallet ===
 
 
[[Electrum]] wallet supports cold storage and has a tutorial: https://electrum.readthedocs.io/en/latest/coldstorage.html
 
 
The wallet features [[seed phrase]]s, [[Deterministic wallet|deterministic wallets]], offline signing. Unsigned transactions can be transferred with QR codes and saving to a file (which can be put on a USB flash drive or any other transfer method). The wallet can be backed by a [[full node]] if the user connects [[Electrum#Server software|to their own server]], but this is optional and does not happen by default.
 
 
The tutorial does not aim to discuss anything about creating a secure offline computer.
 
 
=== Rusty Russell's cold storage guide ===
 
 
Found here: https://github.com/rustyrussell/bitcoin-storage-guide
 
 
The tutorial teaches how to use a laptop as the secure offline computer. It uses ubuntu OS, and Bitcoin Core as the bitcoin wallet. The private key material is stored in raw private key format, not seed phrases (which bitcoin core doesn't support) and so the guide does not benefit from [[Deterministic wallet|deterministic wallets]]. QR codes are used to transfer transactions between the offline and online computers. As the tutorial uses Bitcoin Core it enjoys the benefits of a [[full node]] wallet.
 
 
=== Glacier protocol ===
 
 
https://glacierprotocol.org/
 
 
The glacier protocol is a cold storage scheme. It teaches how to use multiple computers made by different manufacturers which help resist attacks like malicius firmware. The multiple computers are given the same entropy and the user checks that they result in the same bitcoin addresses and private keys. Users are advised to avoid sidechannels like audio, power, magnetic and radio.
 
 
The tutorial teaches users to deal with raw private keys and write them down on paper. [[Deterministic wallet|deterministic wallets]] are not used, nor are [[full node]]s. Users are instructed to look up their balances on a blockchain explorer website which damages the user's privacy and makes them trust the website for verifying the rules of bitcoin.
 
 
 
  
 
== See also ==
 
== See also ==
Line 147: Line 123:
 
* [http://codinginmysleep.com/bitcoin-cold-storage-in-plain-english Bitcoin Cold Storage In Plain English] by David Perry
 
* [http://codinginmysleep.com/bitcoin-cold-storage-in-plain-english Bitcoin Cold Storage In Plain English] by David Perry
 
* [http://www.offlineaddress.com/?site=about#security-risk Security of private key] offlineaddress.com
 
* [http://www.offlineaddress.com/?site=about#security-risk Security of private key] offlineaddress.com
 +
 +
==References==
 +
<references />
 
[[Category:Introduction]]
 
[[Category:Introduction]]
 
[[Category:Security]]
 
[[Category:Security]]

Latest revision as of 07:21, 25 November 2019

Cold storage in the context of Bitcoin refers to storing Bitcoins offline and spending without the private keys controlling them ever being online. This resists theft by hackers and malware, and is often a necessary security precaution especially dealing with large amounts of Bitcoin.

For example, a Bitcoin exchange which offers an instant withdrawal feature, and might be a steward over hundreds of thousands of Bitcoins. To minimize the possibility that an intruder could steal the entire reserve in a security breach, the operator of the website keeps the majority of the reserve in cold storage, or in other words, not present on the web server or any other online computer. The only amount kept on the server is the amount needed to cover anticipated withdrawals in one day.

Special-purpose hardware wallets are also a kind of cold storage solution but this article will mostly deal with cold storage using general purpose computing hardware.

See Backup and Storage Methods#Cold Storage Methods for a review of published cold storage methods.

Conceptual How-to

  1. Set up an online computer which has an internet connection, and an offline computer which is securely airgapped.
  2. The offline computer must have bitcoin wallet software installed. Use the software to generate a wallet and write down its seed phrase on paper or another medium.
  3. Obtain the master public key of the wallet you just generated and transfer it to the online computer. Use it to create a watch-only wallet on the online computer.
  4. The watch-only wallet on the online computer can provide bitcoin addresses used for receiving money, and can tell the user when transactions are received and how many confirmations they have.
  5. For spending have the watch-only wallet create an transaction without the signatures which makes it valid.
  6. Transfer the unsigned transaction to the offline computer and use the wallet software to sign the transaction.
  7. Transfer the now-fully-signed transaction to the online computer and broadcast it to the bitcoin network. The watch-only wallet will tell you when the transaction has confirmations.

Setting up a secure offline computer

A good solution for making a secure offline computer is to buy an old, used laptop or phone built by a reputable manufacturer. Then completely wipe it, do not connect to the internet and install only an operating system and bitcoin wallet from a USB drive[1].

Another option is to use a live operating system as the offline computer. This option is perhaps less secure, as sophisticated malware may be able to survive the live OS boot, but the method may be more convenient.

For some people other attacks must be considered. Wiping a computer may not be enough to remove threats of HDD firmware reprogramming, BIOS reprogramming or any other memory which persists after a clean reinstallation of the system[2].

If the offline and online computer are kept close together (in the same room) then theoretically information can still be transmitted past the air gap using certain sidechannels like: RF, audio, light, magnetic, thermal. For further details see the wikipedia article on Air-gap malware. For this reason it could be a good idea to keep the offline and online computers physically far apart, and unplug the power cable from the laptop so it runs on battery power only.

Wallet software

The wallet software used for cold storage must support watch-only wallets and offline signing. Ideally the online wallet would be backed by a full node for the privacy, security and validation benefits.

Transferring data between offline and online

Cold storage requires on transferring master public keys and partially-signed transactions between the offline and online computers. There are several methods to do this:

USB flash drive

The data can be stored on a USB flash drive and passed between the computers. The advantages are speed and convenience. A disadvantage is that the USB interface still has an attack surface. Sophisiticated malware used in cyberwarface such as Stuxnet and agent.btz used USB flash drives to cross an airgap. These kind of attacks may not be a concern if the aim is to secure smaller amounts.

The SecureDrop platform for securely leaking documents to journalists also uses USB drives for secure communication.

QR codes

The data can be encoded into QR codes and each computer can be equipped with a camera for scanning them. Advantages are speed and conveniance; QR codes are also believed to have a smaller attack surface than USB flash drives. A major disadvantage is that QR codes have size limits and so may not be able to encode larger bitcoin transactions, although the transactions could be split up into multiple chunks and recombined at the other end.

Transcribing by hand

This method involves displaying the data on screen and either 1) typing it with the keyboard of the other computer or 2) writing it down on paper and then typing into the other computer. The advantage is that any security issues of USB interfaces or cameras are completely avoided. The disadvantage is speed as this method is very very slow; bitcoin transactions can be tens of kilobytes in size and each character would need to be carefully copied without mistakes.

Private key backup storage

This article only recommends using seed phrases (possibly with encryption) to store private key backups. Seed phrases written into metal or on paper support deterministic wallets and encryption. As seed phrases use natural language words, they have excellent error correction. Words written in bad handwriting can often still be read. If one or two letters are missing or unreadable the word can often still be deduced. The word list that the seed phrase words are drawn from is carefully chosen so that the first four letters of each word are enough to uniquely identify it.

Other methods are discussed here for completeness.

Raw private keys written on a piece of paper:

  • Anyone who can see it, can steal it.
  • Handwriting can be hard to read or completely illegible, especially when mixing upper and lower-case letters.
  • Human error in transcription can cause errors on end product, many private key formats can fail even if a single letter is transcribed incorrectly.
  • Paper can rot, be torn, burn, or be smoke damaged.
  • Doesn't support deterministic wallets, only a single keypair is stored.

Printed on a piece of paper:

  • Anyone who can see it, can steal it
  • Non-laser printer ink can run if paper gets wet
  • The printer itself is a security risk - some have internet connections, wifi, and disk memory.
  • Paper can rot, be torn, burn, or be smoke damaged

On laminated paper:

  • Anyone who can see it, can steal it
  • Lamination is prone or degradation over time and puncture or cuts that could allow moisture to get trapped in the paper and cause deterioration or rotting in some circumstances - store in cool dry place
  • Can burn or be smoke damaged
  • 'Fireproof' & 'Fire-resistant' boxes can help protect paper in a small house fire but be warned that they can sometimes fall apart in the fire and get wet if the fire is put out with water.
  • Remember people can just carry out a small safe.

Engraved / etched/ ablated / stamped on a piece of metal:

  • Anyone who can see it, can steal it
  • Some metals can deteriorate or corrode, choose a good metal; also store your metal away from direct contact other metals. Some metals that are corrosion resistant have low melting points, are extremely expensive, or hard to machine.
  • Metals can still deform or melt from heat, destroying any engraved SK. "Most house fires do not burn hotter than 1,200 degrees Fahrenheit. This temperature is typically associated with the hottest portion of a home, which is in the roof area. Homes that burn for longer than 30 minutes or consist of multiple levels sometimes burn at higher temperatures."
  • You want to pick a metal that won't be destroyed by a fire. So magnesium, tin, and lead are all out as engraving materials.

Silver, gold, copper, brass, bronze, nickel, cobalt, would survive the housefire fire unmelted. Some Aluminium alloys can survive but you have to have the right ones. At around 1500° Steel and Nickel should be okay. Titanium is above the housefire range and so is tungsten, however tungsten rings are known to shatter due to the brittle nature of the very hard metal.

Stored digitally on a computer:

  • Computers can crash, making data recovery expensive
  • Data can still technically be recovered after a system is abandoned by the user. In some cases data can be recovered after multiple overwriting attempts and physical destruction (as long as the attacker can get all or most the pieces) so if you copy files to a new computer and ditch the old one, be careful.
  • Can burn or be smoke damaged
  • A traditional hard disc drive can have data corrupted by powerful magnetic fields and can physically shatter
  • A non-negligible amount of HDDs suffer from factory defects that will cause them to fail unexpectedly during their lifetime
  • Accidents can happen that could result in loss of data
  • Solid state drives (SSDs) will lose data if unpowered, they may last years before this becomes a problem but it is unwise to store long-term data in unpowered SSDs
  • If connected to internet it is another attack vector and the safety is only as good as the encryption used; I don't know what I would recommend but it wouldn't be BitLocker. Someone could be trying to break into the computer constantly. Even with good encryption if the machine or location is compromised the key could be stolen as soon as it is decrypted.
  • There are a lot of ongoing threats with computers, from 0-day exploits to firmware exploits and malicious USB cords
  • External hdds are good for storage for a few years at least if stored properly
  • If not connected to internet, safety is only as good as the physical protection encryption used; could someone break into the location and copy the data without anyone noticing?

Stored digitally on CD, floppy disk, laserdisc, or mini-disc

  • Plastics break down over time and with exposure to heat, humidity, regular light, all sorts of chemicals, even the oxygen in the air. This can lead to the loss of your data when stored on a medium made of plastic or written/printed on plastic.
  • Can burn or be smoke damaged
  • Can be physically damaged, making data recovery expensive or even impossible
  • Magnetic media (tapes, floppy disc) can be damaged by magnets
  • Data can become difficult to recover if the software and/or hardware to decode is old, don't use proprietary formats

Stored digitally on a flash drive

  • Can break and have to be physically repaired before use
  • Rapidly changing magnetic fields (See MRIs) can damage the data stored on flash drives
  • Can burn or be smoke damaged
  • Can become corroded from salt water or some atmospheric conditions
  • If they break apart, some lighting conditions can cause data corruption (you can also put them back together and often still get the data)
  • Different devices are all different, even similar devices from the same production batch can be different. There are large quality differences in drives but I am assuming you aren't using these for anything but storage.
  • There are some fake flash drives that look like they saved the data but you can't get it back later
  • Flash drives are not advised for long term storage; they can be used as one part of a multi-medium-location-format plan.


Comparison between multisignature and cold storage for security

Cold storage aims to reducing the chance of failure due to hackers or malware. Multisignature aims to avoid a single point of failure. It is entirely possible to combine the two techniques, and create cold storage multisignature wallets.

See also

References