<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fresheneesz</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Fresheneesz"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Fresheneesz"/>
	<updated>2026-04-05T21:19:39Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Protocol_documentation&amp;diff=68832</id>
		<title>Protocol documentation</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Protocol_documentation&amp;diff=68832"/>
		<updated>2021-07-30T18:08:27Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Common structures */ add that All field sizes are numbers of bytes.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page &#039;&#039;describes&#039;&#039; the behavior of the [[Original Bitcoin client|reference client]]. The Bitcoin protocol is specified by the behavior of the reference client, not by this page. In particular, while this page is quite complete in describing the [[network]] protocol, it does not attempt to list all of the rules for block or transaction validity.&lt;br /&gt;
&lt;br /&gt;
Type names used in this documentation are from the C99 standard.&lt;br /&gt;
&lt;br /&gt;
For protocol used in mining, see [[getblocktemplate]].&lt;br /&gt;
&lt;br /&gt;
==Common standards==&lt;br /&gt;
&lt;br /&gt;
=== Hashes ===&lt;br /&gt;
&lt;br /&gt;
Usually, when a hash is computed within bitcoin, it is computed twice. Most of the time [http://en.wikipedia.org/wiki/SHA-2 SHA-256] hashes are used, however [http://en.wikipedia.org/wiki/RIPEMD RIPEMD-160] is also used when a shorter hash is desirable (for example when creating a bitcoin address).&lt;br /&gt;
&lt;br /&gt;
Example of double-SHA-256 encoding of string &amp;quot;hello&amp;quot;:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round of sha-256)&lt;br /&gt;
 9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50 (second round of sha-256)&lt;br /&gt;
&lt;br /&gt;
For bitcoin addresses (RIPEMD-160) this would give:&lt;br /&gt;
&lt;br /&gt;
 hello&lt;br /&gt;
 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 (first round is sha-256)&lt;br /&gt;
 b6a9c8c230722b7c748331a8b450f05566dc7d0f (with ripemd-160)&lt;br /&gt;
&lt;br /&gt;
=== Merkle Trees ===&lt;br /&gt;
&lt;br /&gt;
Merkle trees are binary trees of hashes. Merkle trees in bitcoin use a &#039;&#039;&#039;double&#039;&#039;&#039; SHA-256, the SHA-256 hash of the SHA-256 hash of something.&lt;br /&gt;
&lt;br /&gt;
If, when forming a row in the tree (other than the root of the tree), it would have an odd number of elements, the final double-hash is duplicated to ensure that the row has an even number of hashes.&lt;br /&gt;
&lt;br /&gt;
First form the bottom row of the tree with the ordered double-SHA-256 hashes of the byte streams of the transactions in the block.&lt;br /&gt;
&lt;br /&gt;
Then the row above it consists of half that number of hashes.  Each entry is the double-SHA-256 of the 64-byte concatenation of the corresponding two hashes below it in the tree.&lt;br /&gt;
&lt;br /&gt;
This procedure repeats recursively until we reach a row consisting of just a single double-hash.  This is the &#039;&#039;&#039;Merkle root&#039;&#039;&#039; of the tree.&lt;br /&gt;
&lt;br /&gt;
For example, imagine a block with three transactions &#039;&#039;a&#039;&#039;, &#039;&#039;b&#039;&#039; and &#039;&#039;c&#039;&#039;.   The Merkle tree is: &lt;br /&gt;
&lt;br /&gt;
 d1 = dhash(a)&lt;br /&gt;
 d2 = dhash(b)&lt;br /&gt;
 d3 = dhash(c)&lt;br /&gt;
 d4 = dhash(c)            # a, b, c are 3. that&#039;s an odd number, so we take the c twice&lt;br /&gt;
 &lt;br /&gt;
 d5 = dhash(d1 concat d2)&lt;br /&gt;
 d6 = dhash(d3 concat d4)&lt;br /&gt;
 &lt;br /&gt;
 d7 = dhash(d5 concat d6)&lt;br /&gt;
&lt;br /&gt;
where&lt;br /&gt;
 &lt;br /&gt;
 dhash(a) = sha256(sha256(a))&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;d7&#039;&#039; is the Merkle root of the 3 transactions in this block.&lt;br /&gt;
&lt;br /&gt;
Note: Hashes in Merkle Tree displayed in the [[Block Explorer]] are of little-endian notation. For some implementations and [http://www.fileformat.info/tool/hash.htm calculations], the bytes need to be reversed before they are hashed, and again after the hashing operation.&lt;br /&gt;
&lt;br /&gt;
=== Signatures ===&lt;br /&gt;
&lt;br /&gt;
Bitcoin uses [http://en.wikipedia.org/wiki/Elliptic_curve_cryptography Elliptic Curve] [http://en.wikipedia.org/wiki/Digital_Signature_Algorithm Digital Signature Algorithm] ([http://en.wikipedia.org/wiki/Elliptic_Curve_DSA ECDSA]) to sign transactions. &lt;br /&gt;
&lt;br /&gt;
For [[ECDSA]] the secp256k1 curve from http://www.secg.org/sec2-v2.pdf is used.&lt;br /&gt;
&lt;br /&gt;
Public keys (in scripts) are given as 04 &amp;lt;x&amp;gt; &amp;lt;y&amp;gt; where &#039;&#039;x&#039;&#039; and &#039;&#039;y&#039;&#039; are 32 byte big-endian integers representing the coordinates of a point on the curve or in compressed form given as &amp;lt;sign&amp;gt; &amp;lt;x&amp;gt; where &amp;lt;sign&amp;gt; is 0x02 if &#039;&#039;y&#039;&#039; is even and 0x03 if &#039;&#039;y&#039;&#039; is odd.&lt;br /&gt;
&lt;br /&gt;
Signatures use [http://en.wikipedia.org/wiki/Distinguished_Encoding_Rules DER encoding] to pack the &#039;&#039;r&#039;&#039; and &#039;&#039;s&#039;&#039; components into a single byte stream (this is also what OpenSSL produces by default).&lt;br /&gt;
&lt;br /&gt;
=== Transaction Verification ===&lt;br /&gt;
Transactions are cryptographically signed records that reassign ownership of Bitcoins to new addresses.  Transactions have &#039;&#039;inputs&#039;&#039; - records which reference the funds from other previous transactions - and &#039;&#039;outputs&#039;&#039; - records which determine the new owner of the transferred Bitcoins, and which will be referenced as inputs in future transactions as those funds are respent.&lt;br /&gt;
&lt;br /&gt;
Each &#039;&#039;input&#039;&#039; must have a cryptographic digital signature that unlocks the funds from the prior transaction.  Only the person possessing the appropriate [[private key]] is able to create a satisfactory signature; this in effect ensures that funds can only be spent by their owners.&lt;br /&gt;
&lt;br /&gt;
Each &#039;&#039;output&#039;&#039; determines which Bitcoin address (or other criteria, see [[Script]]) is the recipient of the funds.&lt;br /&gt;
&lt;br /&gt;
In a transaction, the sum of all inputs must be equal to or greater than the sum of all outputs.  If the inputs exceed the outputs, the difference is considered a [[transaction fee]], and is redeemable by whoever first includes the transaction into the block chain.&lt;br /&gt;
&lt;br /&gt;
A special kind of transaction, called a [[coinbase transaction]], has no inputs.  It is created by [[miners]], and there is one coinbase transaction per block.  Because each block comes with a reward of newly created Bitcoins (e.g. 50 BTC for the first 210,000 blocks), the first transaction of a block is, with few exceptions, the transaction that grants those coins to their recipient (the miner).  In addition to the newly created Bitcoins, the coinbase transaction is also used for assigning the recipient of any transaction fees that were paid within the other transactions being included in the same block.  The coinbase transaction can assign the entire reward to a single Bitcoin address, or split it in portions among multiple addresses, just like any other transaction.  Coinbase transactions always contain outputs totalling the sum of the block reward plus all transaction fees collected from the other transactions in the same block.&lt;br /&gt;
&lt;br /&gt;
The [[coinbase transaction]] in block zero cannot be spent. This is due to a quirk of the reference client implementation that would open the potential for a block chain fork if some nodes accepted the spend and others did not&amp;lt;ref&amp;gt;[http://bitcointalk.org/index.php?topic=119645.msg1288552#msg1288552 Block 0 Network Fork]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Most Bitcoin outputs encumber the newly transferred coins with a single ECDSA private key.  The actual record saved with inputs and outputs isn&#039;t necessarily a key, but a &#039;&#039;script&#039;&#039;.  Bitcoin uses an interpreted scripting system to determine whether an output&#039;s criteria have been satisfied, with which more complex operations are possible, such as outputs that require two ECDSA signatures, or two-of-three-signature schemes.  An output that references a single Bitcoin address is a &#039;&#039;typical&#039;&#039; output; an output actually contains this information in the form of a script that requires a single ECDSA signature (see [[OP_CHECKSIG]]).  The output script specifies what must be provided to unlock the funds later, and when the time comes in the future to spend the transaction in another input, that input must provide all of the thing(s) that satisfy the requirements defined by the original output script.&lt;br /&gt;
&lt;br /&gt;
=== Addresses ===&lt;br /&gt;
&lt;br /&gt;
A bitcoin address is in fact the hash of a ECDSA public key, computed this way:&lt;br /&gt;
&lt;br /&gt;
 Version = 1 byte of 0 (zero); on the test network, this is 1 byte of 111&lt;br /&gt;
 Key hash = Version concatenated with RIPEMD-160(SHA-256(public key))&lt;br /&gt;
 Checksum = 1st 4 bytes of SHA-256(SHA-256(Key hash))&lt;br /&gt;
 Bitcoin Address = Base58Encode(Key hash concatenated with Checksum)&lt;br /&gt;
&lt;br /&gt;
The Base58 encoding used is home made, and has some differences. Especially, leading zeroes are kept as single zeroes when conversion happens.&lt;br /&gt;
&lt;br /&gt;
== Common structures ==&lt;br /&gt;
&lt;br /&gt;
Almost all integers are encoded in little endian. Only IP or port number are encoded big endian. All field sizes are numbers of bytes.&lt;br /&gt;
&lt;br /&gt;
=== Message structure ===&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || magic || uint32_t || Magic value indicating message origin network, and used to seek to next message when stream state is unknown&lt;br /&gt;
|-&lt;br /&gt;
| 12 || command || char[12] || ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || length || uint32_t || Length of payload in number of bytes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || checksum || uint32_t || First 4 bytes of sha256(sha256(payload))&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || The actual data&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Known magic values:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Network !! Magic value !! Sent over wire as&lt;br /&gt;
|-&lt;br /&gt;
| main || 0xD9B4BEF9 || F9 BE B4 D9&lt;br /&gt;
|-&lt;br /&gt;
| testnet/regtest || 0xDAB5BFFA || FA BF B5 DA&lt;br /&gt;
|-&lt;br /&gt;
| testnet3 || 0x0709110B || 0B 11 09 07&lt;br /&gt;
|-&lt;br /&gt;
| signet(default) || 0x40CF030A || 0A 03 CF 40&lt;br /&gt;
|-&lt;br /&gt;
| namecoin || 0xFEB4BEF9 || F9 BE B4 FE&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Variable length integer ===&lt;br /&gt;
&lt;br /&gt;
Integer can be encoded depending on the represented value to save space.&lt;br /&gt;
Variable length integers always precede an array/vector of a type of data that may vary in length.&lt;br /&gt;
Longer numbers are encoded in little endian.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Storage length !! Format&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 0xFD || 1 || uint8_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF || 3 || 0xFD followed by the length as uint16_t&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt;= 0xFFFF FFFF || 5 || 0xFE followed by the length as uint32_t&lt;br /&gt;
|-&lt;br /&gt;
| - || 9 || 0xFF followed by the length as uint64_t&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
If you&#039;re reading the Satoshi client code (BitcoinQT) it refers to this encoding as a &amp;quot;CompactSize&amp;quot;. Modern Bitcoin Core also has the VARINT macro which implements an even more compact integer for the purpose of local storage (which is incompatible with &amp;quot;CompactSize&amp;quot; described here). VARINT is not a part of the protocol.&lt;br /&gt;
&lt;br /&gt;
=== Variable length string ===&lt;br /&gt;
&lt;br /&gt;
Variable length string can be stored using a variable length integer followed by the string itself.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || length || [[Protocol_documentation#Variable_length_integer|var_int]] || Length of the string&lt;br /&gt;
|-&lt;br /&gt;
| ? || string || char[] || The string itself (can be empty)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Network address ===&lt;br /&gt;
&lt;br /&gt;
When a network address is needed somewhere, this structure is used. Network addresses are not prefixed with a timestamp in the version message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || time || uint32 || the Time (version &amp;gt;= 31402). &#039;&#039;&#039;Not present in version message.&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || same service(s) listed in [[#version|version]]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || IPv6/4 || char[16] || IPv6 address. Network byte order. The original client only supported IPv4 and only read the last 4 bytes to get the IPv4 address. However, the IPv4 address is written into the message as a 16 byte [http://en.wikipedia.org/wiki/IPv6#IPv4-mapped_IPv6_addresses IPv4-mapped IPv6 address]&lt;br /&gt;
(12 bytes &#039;&#039;00 00 00 00  00 00 00 00  00 00 FF FF&#039;&#039;, followed by the 4 bytes of the IPv4 address).&lt;br /&gt;
|-&lt;br /&gt;
| 2 || port || uint16_t || port number, network byte order&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of Network address structure&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   01 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0010   00 00 FF FF 0A 00 00 01  20 8D                    ........ .&lt;br /&gt;
&lt;br /&gt;
Network address:&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK: see services listed under version command)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv6: ::ffff:a00:1 or IPv4: 10.0.0.1&lt;br /&gt;
 20 8D                                           - Port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Inventory Vectors ===&lt;br /&gt;
&lt;br /&gt;
Inventory vectors are used for notifying other nodes about objects they have or data which is being requested.&lt;br /&gt;
&lt;br /&gt;
Inventory vectors consist of the following data format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || type || uint32_t || Identifies the object type linked to this inventory&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || Hash of the object&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The object type is currently defined as one of the following possibilities:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || ERROR || Any data of with this number may be ignored&lt;br /&gt;
|-&lt;br /&gt;
| 1 || MSG_TX || Hash is related to a transaction&lt;br /&gt;
|-&lt;br /&gt;
| 2 || MSG_BLOCK || Hash is related to a data block&lt;br /&gt;
|-&lt;br /&gt;
| 3 || MSG_FILTERED_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a merkleblock message rather than a block message; this only works if a bloom filter has been set. See BIP 37 for more info.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || MSG_CMPCT_BLOCK || Hash of a block header; identical to MSG_BLOCK.  Only to be used in getdata message. Indicates the reply should be a cmpctblock message. See BIP 152 for more info.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40000001 || MSG_WITNESS_TX || Hash of a transaction with witness data. See BIP 144 for more info.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40000002 || MSG_WITNESS_BLOCK || Hash of a block with witness data. See BIP 144 for more info.&lt;br /&gt;
|-&lt;br /&gt;
| 0x40000003 || MSG_FILTERED_WITNESS_BLOCK || Hash of a block with witness data. Only to be used in getdata message. Indicates the reply should be a merkleblock message rather than a block message; this only works if a bloom filter has been set. See BIP 144 for more info.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Other Data Type values are considered reserved for future implementations.&lt;br /&gt;
&lt;br /&gt;
=== Block Headers ===&lt;br /&gt;
&lt;br /&gt;
Block headers are sent in a headers packet in response to a getheaders message.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Will overflow in 2106&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Unix_time#Notable_events_in_Unix_time&amp;lt;/ref&amp;gt;)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of transaction entries, this value is always 0&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
cf. [[Block hashing algorithm]]&lt;br /&gt;
&lt;br /&gt;
=== Differential encoding === &lt;br /&gt;
Several uses of CompactSize below are &amp;quot;differentially encoded&amp;quot;. For these, instead of using raw indexes, the number encoded is the difference between the current index and the previous index, minus one. For example, a first index of 0 implies a real index of 0, a second index of 0 thereafter refers to a real index of 1, etc.&lt;br /&gt;
&lt;br /&gt;
=== PrefilledTransaction ===&lt;br /&gt;
&lt;br /&gt;
A PrefilledTransaction structure is used in HeaderAndShortIDs to provide a list of a few transactions explicitly.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| index || [[Protocol_documentation#Variable_length_integer|CompactSize]] || 1, 3 bytes || Compact Size, differentially encoded since the last PrefilledTransaction in a list || The index into the block at which this transaction is&lt;br /&gt;
|-&lt;br /&gt;
| tx || Transaction || variable || As encoded in [[Protocol_documentation#tx|tx messages]] || The transaction which is in the block at index index.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== HeaderAndShortIDs ===&lt;br /&gt;
&lt;br /&gt;
A HeaderAndShortIDs structure is used to relay a block header, the short transactions IDs used for matching already-available transactions, and a select few transactions which we expect a peer may be missing.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| header || Block header || 80 bytes || First 80 bytes of the block as defined by the encoding used by &amp;quot;block&amp;quot; messages	|| The header of the block being provided&lt;br /&gt;
|-&lt;br /&gt;
| nonce	|| uint64_t || 8 bytes || Little Endian || A nonce for use in short transaction ID calculations&lt;br /&gt;
|-&lt;br /&gt;
| shortids_length || [[Protocol_documentation#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of short transaction IDs in shortids (ie block tx count - prefilledtxn_length)&lt;br /&gt;
|-&lt;br /&gt;
| shortids || List of 6-byte integers || 6*shortids_length bytes || Little Endian || The [[Protocol_documentation#Short_transaction_ID|short transaction IDs]] calculated from the transactions which were not provided explicitly in prefilledtxn&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn_length || [[Protocol_documentation#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of prefilled transactions in prefilledtxn (ie block tx count - shortids_length)&lt;br /&gt;
|-&lt;br /&gt;
| prefilledtxn || List of PrefilledTransactions || variable size*prefilledtxn_length || As defined by [[Protocol_documentation#PrefilledTransaction|PrefilledTransaction]] definition, above || Used to provide the coinbase transaction and a select few which we expect a peer may be missing&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactionsRequest ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactionsRequest structure is used to list transaction indexes in a block being requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being requested are in&lt;br /&gt;
|-&lt;br /&gt;
| indexes_length || [[Protocol_documentation#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions being requested&lt;br /&gt;
|-&lt;br /&gt;
| indexes || List of [[Protocol_documentation#Variable_length_integer|CompactSizes]] || 1 or 3 bytes*indexes_length || [[Protocol_documentation#Differential_encoding|Differentially encoded]] || The indexes of the transactions being requested in the block&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== BlockTransactions ===&lt;br /&gt;
&lt;br /&gt;
A BlockTransactions structure is used to provide some of the transactions in a block, as requested.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Name !! Type !! Size !! Encoding || Purpose&lt;br /&gt;
|-&lt;br /&gt;
| blockhash || Binary blob || 32 bytes || The output from a double-SHA256 of the block header, as used elsewhere || The blockhash of the block which the transactions being provided are in&lt;br /&gt;
|-&lt;br /&gt;
| transactions_length || [[Protocol_documentation#Variable_length_integer|CompactSize]] || 1 or 3 bytes || As used to encode array lengths elsewhere || The number of transactions provided&lt;br /&gt;
|-&lt;br /&gt;
| transactions || List of Transactions || variable || As encoded in [[Protocol_documentation#tx|tx messages]] || The transactions provided&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== Short transaction ID ===&lt;br /&gt;
&lt;br /&gt;
Short transaction IDs are used to represent a transaction without sending a full 256-bit hash. They are calculated by:&lt;br /&gt;
&lt;br /&gt;
# single-SHA256 hashing the block header with the nonce appended (in little-endian)&lt;br /&gt;
# Running SipHash-2-4 with the input being the transaction ID and the keys (k0/k1) set to the first two little-endian 64-bit integers from the above hash, respectively.&lt;br /&gt;
# Dropping the 2 most significant bytes from the SipHash output to make it 6 bytes.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Message types ==&lt;br /&gt;
&lt;br /&gt;
=== version ===&lt;br /&gt;
&lt;br /&gt;
When a node creates an outgoing connection, it will immediately [[Version Handshake|advertise]] its version. The remote node will respond with its version. No further communication is possible until both peers have exchanged their version.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Identifies protocol version being used by the node&lt;br /&gt;
|-&lt;br /&gt;
| 8 || services || uint64_t || bitfield of features to be enabled for this connection&lt;br /&gt;
|-&lt;br /&gt;
| 8 || timestamp || int64_t || standard UNIX timestamp in seconds&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_recv || [[#Network address|net_addr]] || The network address of the node receiving this message&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 106&lt;br /&gt;
|-&lt;br /&gt;
| 26 || addr_from || [[#Network address|net_addr]] || Field can be ignored. This used to be the network address of the node emitting this message, but most P2P implementations send 26 dummy bytes. The &amp;quot;services&amp;quot; field of the address would also be redundant with the second field of the version message.&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || Node random nonce, randomly generated every time a version packet is sent. This nonce is used to detect connections to self.&lt;br /&gt;
|-&lt;br /&gt;
| ? || user_agent || [[#Variable length string|var_str]] || [https://github.com/bitcoin/bips/blob/master/bip-0014.mediawiki User Agent] (0x00 if string is 0 bytes long)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || start_height || int32_t || The last block received by the emitting node&lt;br /&gt;
|-&lt;br /&gt;
|colspan=&amp;quot;4&amp;quot;| Fields below require version ≥ 70001&lt;br /&gt;
|-&lt;br /&gt;
| 1 || relay || bool || Whether the remote peer should announce relayed transactions or not, see [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
A &amp;quot;verack&amp;quot; packet shall be sent if the version packet was accepted.&lt;br /&gt;
&lt;br /&gt;
The following services are currently assigned:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 1 || NODE_NETWORK || This node can be asked for full blocks instead of just headers.&lt;br /&gt;
|-&lt;br /&gt;
| 2 || NODE_GETUTXO || See [https://github.com/bitcoin/bips/blob/master/bip-0064.mediawiki BIP 0064]&lt;br /&gt;
|-&lt;br /&gt;
| 4 || NODE_BLOOM   || See [https://github.com/bitcoin/bips/blob/master/bip-0111.mediawiki BIP 0111]&lt;br /&gt;
|-&lt;br /&gt;
| 8 || NODE_WITNESS   || See [https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki BIP 0144]&lt;br /&gt;
|-&lt;br /&gt;
| 16 || NODE_XTHIN  || Never formally proposed (as a BIP), and discontinued. Was historically sporadically seen on the network.&lt;br /&gt;
|-&lt;br /&gt;
| 64 || NODE_COMPACT_FILTERS || See [https://github.com/bitcoin/bips/blob/master/bip-0157.mediawiki BIP 0157]&lt;br /&gt;
|-&lt;br /&gt;
| 1024 || NODE_NETWORK_LIMITED   || See [https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki BIP 0159]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Hexdump example of version message (OBSOLETE EXAMPLE: This example lacks a checksum and user-agent):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 73  69 6F 6E 00 00 00 00 00   ....version.....&lt;br /&gt;
0010   55 00 00 00 9C 7C 00 00  01 00 00 00 00 00 00 00   U....|..........&lt;br /&gt;
0020   E6 15 10 4D 00 00 00 00  01 00 00 00 00 00 00 00   ...M............&lt;br /&gt;
0030   00 00 00 00 00 00 00 00  00 00 FF FF 0A 00 00 01   ................&lt;br /&gt;
0040   20 8D 01 00 00 00 00 00  00 00 00 00 00 00 00 00   ................&lt;br /&gt;
0050   00 00 00 00 FF FF 0A 00  00 02 20 8D DD 9D 20 2C   .......... ... ,&lt;br /&gt;
0060   3A B4 57 13 00 55 81 01  00                        :.W..U...&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 55 00 00 00                                                                   - Payload is 85 bytes long&lt;br /&gt;
                                                                               - No checksum in version message until 20 February 2012. See https://bitcointalk.org/index.php?topic=55852.0&lt;br /&gt;
Version message:&lt;br /&gt;
 9C 7C 00 00                                                                   - 31900 (version 0.3.19)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 E6 15 10 4D 00 00 00 00                                                       - Mon Dec 20 21:50:14 EST 2010&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 20 8D - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 02 20 8D - Sender address info - see Network Address&lt;br /&gt;
 DD 9D 20 2C 3A B4 57 13                                                       - Node random unique ID&lt;br /&gt;
 00                                                                            - &amp;quot;&amp;quot; sub-version string (string is 0 bytes long)&lt;br /&gt;
 55 81 01 00                                                                   - Last block sending node has is block #98645&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
And here&#039;s a modern (60002) protocol version client advertising itself to a local peer...&lt;br /&gt;
&lt;br /&gt;
Newer protocol includes the checksum now, this is from a mainline (satoshi) client during &lt;br /&gt;
an outgoing connection to another local client, notice that it does not fill out the &lt;br /&gt;
address information at all when the source or destination is &amp;quot;unroutable&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
0000   f9 be b4 d9 76 65 72 73 69 6f 6e 00 00 00 00 00  ....version.....&lt;br /&gt;
0010   64 00 00 00 35 8d 49 32 62 ea 00 00 01 00 00 00  d...5.I2b.......&lt;br /&gt;
0020   00 00 00 00 11 b2 d0 50 00 00 00 00 01 00 00 00  .......P........&lt;br /&gt;
0030   00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff  ................&lt;br /&gt;
0040   00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................&lt;br /&gt;
0050   00 00 00 00 00 00 00 00 ff ff 00 00 00 00 00 00  ................&lt;br /&gt;
0060   3b 2e b3 5d 8c e6 17 65 0f 2f 53 61 74 6f 73 68  ;..]...e./Satosh&lt;br /&gt;
0070   69 3a 30 2e 37 2e 32 2f c0 3e 03 00              i:0.7.2/.&amp;gt;..&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                                                   - Main network magic bytes&lt;br /&gt;
 76 65 72 73 69 6F 6E 00 00 00 00 00                                           - &amp;quot;version&amp;quot; command&lt;br /&gt;
 64 00 00 00                                                                   - Payload is 100 bytes long&lt;br /&gt;
 35 8d 49 32                                                                   - payload checksum (internal byte order)&lt;br /&gt;
&lt;br /&gt;
Version message:&lt;br /&gt;
 62 EA 00 00                                                                   - 60002 (protocol version 60002)&lt;br /&gt;
 01 00 00 00 00 00 00 00                                                       - 1 (NODE_NETWORK services)&lt;br /&gt;
 11 B2 D0 50 00 00 00 00                                                       - Tue Dec 18 10:12:33 PST 2012&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Recipient address info - see Network Address&lt;br /&gt;
 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 FF FF 00 00 00 00 00 00 - Sender address info - see Network Address&lt;br /&gt;
 3B 2E B3 5D 8C E6 17 65                                                       - Node ID&lt;br /&gt;
 0F 2F 53 61 74 6F 73 68 69 3A 30 2E 37 2E 32 2F                               - &amp;quot;/Satoshi:0.7.2/&amp;quot; sub-version string (string is 15 bytes long)&lt;br /&gt;
 C0 3E 03 00                                                                   - Last block sending node has is block #212672&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== verack ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;verack&#039;&#039; message is sent in reply to &#039;&#039;[[#version|version]]&#039;&#039;.  This message consists of only a [[#Message structure|message header]] with the command string &amp;quot;verack&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Hexdump of the verack message:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 76 65 72 61  63 6B 00 00 00 00 00 00   ....verack......&lt;br /&gt;
0010   00 00 00 00 5D F6 E0 E2                            ........&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                          - Main network magic bytes&lt;br /&gt;
 76 65 72 61  63 6B 00 00 00 00 00 00 - &amp;quot;verack&amp;quot; command&lt;br /&gt;
 00 00 00 00                          - Payload is 0 bytes long&lt;br /&gt;
 5D F6 E0 E2                          - Checksum (internal byte order)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== addr ===&lt;br /&gt;
&lt;br /&gt;
Provide information on known nodes of the network. Non-advertised nodes should be forgotten after typically 3 hours&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of address entries (max: 1000)&lt;br /&gt;
|-&lt;br /&gt;
| 30x? || addr_list || (uint32_t + [[#Network address|net_addr]])[] || Address of other nodes on the network. version &amp;lt; 209 will only read the first one. The uint32_t is a timestamp (see note below).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note&#039;&#039;&#039;: Starting version 31402, addresses are prefixed with a timestamp. If no timestamp is present, the addresses should not be relayed to other peers, unless it is indeed confirmed they are up.&lt;br /&gt;
&lt;br /&gt;
Hexdump example of &#039;&#039;addr&#039;&#039; message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
0000   F9 BE B4 D9 61 64 64 72  00 00 00 00 00 00 00 00   ....addr........&lt;br /&gt;
0010   1F 00 00 00 ED 52 39 9B  01 E2 15 10 4D 01 00 00   .....R9.....M...&lt;br /&gt;
0020   00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 FF   ................&lt;br /&gt;
0030   FF 0A 00 00 01 20 8D                               ..... .&lt;br /&gt;
&lt;br /&gt;
Message Header:&lt;br /&gt;
 F9 BE B4 D9                                     - Main network magic bytes&lt;br /&gt;
 61 64 64 72  00 00 00 00 00 00 00 00            - &amp;quot;addr&amp;quot;&lt;br /&gt;
 1F 00 00 00                                     - payload is 31 bytes long&lt;br /&gt;
 ED 52 39 9B                                     - payload checksum (internal byte order)&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
 01                                              - 1 address in this message&lt;br /&gt;
&lt;br /&gt;
Address:&lt;br /&gt;
 E2 15 10 4D                                     - Mon Dec 20 21:50:10 EST 2010 (only when version is &amp;gt;= 31402)&lt;br /&gt;
 01 00 00 00 00 00 00 00                         - 1 (NODE_NETWORK service - see version message)&lt;br /&gt;
 00 00 00 00 00 00 00 00 00 00 FF FF 0A 00 00 01 - IPv4: 10.0.0.1, IPv6: ::ffff:10.0.0.1 (IPv4-mapped IPv6 address)&lt;br /&gt;
 20 8D                                           - port 8333&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== inv ===&lt;br /&gt;
&lt;br /&gt;
Allows a node to advertise its knowledge of one or more objects. It can be received unsolicited, or in reply to &#039;&#039;getblocks&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getdata ===&lt;br /&gt;
&lt;br /&gt;
getdata is used in response to inv, to retrieve the content of a specific object, and is usually sent after receiving an &#039;&#039;inv&#039;&#039; packet, after filtering known elements. It can be used to retrieve transactions, but only if they are in the memory pool or relay set - arbitrary access to transactions in the chain is not allowed to avoid having clients start to depend on nodes having full transaction indexes (which modern nodes do not).&lt;br /&gt;
&lt;br /&gt;
Payload (maximum 50,000 entries, which is just over 1.8 megabytes):&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== notfound ===&lt;br /&gt;
&lt;br /&gt;
notfound is a response to a getdata, sent if any requested data items could not be relayed, for example, because the requested transaction was not in the memory pool or relay set.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of inventory entries&lt;br /&gt;
|-&lt;br /&gt;
| 36x? || inventory || [[Protocol specification#Inventory Vectors|inv_vect]][] || Inventory vectors&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== getblocks ===&lt;br /&gt;
&lt;br /&gt;
Return an &#039;&#039;inv&#039;&#039; packet containing the list of blocks starting right after the last known hash in the block locator object, up to hash_stop or 500 blocks, whichever comes first. &lt;br /&gt;
&lt;br /&gt;
The locator hashes are processed by a node in the order as they appear in the message. If a block hash is found in the node&#039;s main chain, the list of its children is returned back via the &#039;&#039;inv&#039;&#039; message and the remaining locators are ignored, no matter if the requested limit was reached, or not.&lt;br /&gt;
&lt;br /&gt;
To receive the next blocks hashes, one needs to issue getblocks again with a new block locator object. Keep in mind that some clients may provide blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Protocol_documentation#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block; set to zero to get as many blocks as possible (500)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
To create the block locator hashes, keep pushing hashes until you go back to the genesis block. After pushing 10 hashes back, the step backwards doubles every loop:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
// From libbitcoin which is under AGPL&lt;br /&gt;
std::vector&amp;lt;size_t&amp;gt; block_locator_indexes(size_t top_height)&lt;br /&gt;
{&lt;br /&gt;
    std::vector&amp;lt;size_t&amp;gt; indexes;&lt;br /&gt;
&lt;br /&gt;
    // Modify the step in the iteration.&lt;br /&gt;
    int64_t step = 1;&lt;br /&gt;
&lt;br /&gt;
    // Start at the top of the chain and work backwards.&lt;br /&gt;
    for (auto index = (int64_t)top_height; index &amp;gt; 0; index -= step)&lt;br /&gt;
    {&lt;br /&gt;
        // Push top 10 indexes first, then back off exponentially.&lt;br /&gt;
        if (indexes.size() &amp;gt;= 10)&lt;br /&gt;
            step *= 2;&lt;br /&gt;
&lt;br /&gt;
        indexes.push_back((size_t)index);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    //  Push the genesis block index.&lt;br /&gt;
    indexes.push_back(0);&lt;br /&gt;
    return indexes;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that it is allowed to send in fewer known hashes down to a minimum of just one hash. However, the purpose of the block locator object is to detect a wrong branch in the caller&#039;s main chain. If the peer detects that you are off the main chain, it will send in block hashes which are earlier than your last known block. So if you just send in your last known hash and it is off the main chain, the peer starts over at block #1.&lt;br /&gt;
&lt;br /&gt;
=== getheaders ===&lt;br /&gt;
&lt;br /&gt;
Return a &#039;&#039;headers&#039;&#039; packet containing the headers of blocks starting right after the last known hash in the block locator object, up to hash_stop or 2000 blocks, whichever comes first. To receive the next block headers, one needs to issue getheaders again with a new block locator object. Keep in mind that some clients may provide headers of blocks which are invalid if the block locator object contains a hash on the invalid branch.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || the protocol version&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash count || [[Protocol_documentation#Variable_length_integer|var_int]] || number of block locator hash entries&lt;br /&gt;
|-&lt;br /&gt;
| 32+ || block locator hashes || char[32] || block locator object; newest back to genesis block (dense to start, but then sparse)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash_stop || char[32] || hash of the last desired block header; set to zero to get as many blocks as possible (2000)&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
For the block locator object in this packet, the same rules apply as for the [[Protocol_documentation#getblocks|getblocks]] packet.&lt;br /&gt;
&lt;br /&gt;
=== tx ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;tx&#039;&#039; describes a bitcoin transaction, in reply to &#039;&#039;[[#getdata|getdata]]&#039;&#039;. When a bloom filter is applied &#039;&#039;tx&#039;&#039; objects are sent automatically for matching transactions following the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || uint32_t || Transaction data format version&lt;br /&gt;
|-&lt;br /&gt;
| 0 or 2 || flag || optional uint8_t[2] || If present, always 0001, and indicates the presence of witness data&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_in count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of Transaction inputs (never zero)&lt;br /&gt;
|-&lt;br /&gt;
| 41+ || tx_in || tx_in[] || A list of 1 or more transaction inputs or sources for coins&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || tx_out count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of Transaction outputs&lt;br /&gt;
|-&lt;br /&gt;
| 9+ || tx_out || tx_out[] || A list of 1 or more transaction outputs or destinations for coins&lt;br /&gt;
|-&lt;br /&gt;
| 0+ || tx_witnesses || tx_witness[] || A list of witnesses, one for each input; omitted if &#039;&#039;flag&#039;&#039; is omitted above&lt;br /&gt;
|-&lt;br /&gt;
| 4 || lock_time || uint32_t || The block number or timestamp at which this transaction is unlocked:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0 || Not locked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;lt; 500000000  || Block number at which this transaction is unlocked&lt;br /&gt;
|-&lt;br /&gt;
| &amp;gt;= 500000000 || UNIX timestamp at which this transaction is unlocked&lt;br /&gt;
|}&lt;br /&gt;
If all TxIn inputs have final (0xffffffff) sequence numbers then lock_time is irrelevant. Otherwise, the transaction may not be added to a block until after lock_time (see [[NLockTime]]).&lt;br /&gt;
&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
TxIn consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 36 || previous_output || outpoint || The previous output transaction reference, as an OutPoint structure&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || script length || [[Protocol_documentation#Variable_length_integer|var_int]] || The length of the signature script&lt;br /&gt;
|-&lt;br /&gt;
| ? || signature script || uchar[] || Computational Script for confirming transaction authorization&lt;br /&gt;
|-&lt;br /&gt;
| 4 || [http://bitcoin.stackexchange.com/q/2025/323 sequence] || uint32_t || Transaction version as defined by the sender. Intended for &amp;quot;replacement&amp;quot; of transactions when information is updated before inclusion into a block.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The OutPoint structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 32 || hash || char[32] || The hash of the referenced transaction.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || index || uint32_t || The index of the specific output in the transaction. The first output is 0, etc.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The Script structure consists of a series of pieces of information and operations related to the value of the transaction.&lt;br /&gt;
&lt;br /&gt;
(Structure to be expanded in the future… see script.h and script.cpp and [[Script]] for more information)&lt;br /&gt;
&lt;br /&gt;
The TxOut structure consists of the following fields:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || value || int64_t || Transaction Value&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || pk_script length || [[Protocol_documentation#Variable_length_integer|var_int]] || Length of the pk_script&lt;br /&gt;
|-&lt;br /&gt;
| ? || pk_script || uchar[] || Usually contains the public key as a Bitcoin script setting up conditions to claim this output.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The TxWitness structure consists of a [[Protocol_documentation#Variable_length_integer|var_int]] count of witness data components, followed by (for each witness data component) a [[Protocol_documentation#Variable_length_integer|var_int]] length of the component and the raw component data itself.&lt;br /&gt;
&lt;br /&gt;
Example &#039;&#039;tx&#039;&#039; message:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
000000	F9 BE B4 D9 74 78 00 00  00 00 00 00 00 00 00 00   ....tx..........&lt;br /&gt;
000010	02 01 00 00 E2 93 CD BE  01 00 00 00 01 6D BD DB   .............m..&lt;br /&gt;
000020	08 5B 1D 8A F7 51 84 F0  BC 01 FA D5 8D 12 66 E9   .[...Q........f.&lt;br /&gt;
000030	B6 3B 50 88 19 90 E4 B4  0D 6A EE 36 29 00 00 00   .;P......j.6)...&lt;br /&gt;
000040	00 8B 48 30 45 02 21 00  F3 58 1E 19 72 AE 8A C7   ..H0E.!..X..r...&lt;br /&gt;
000050	C7 36 7A 7A 25 3B C1 13  52 23 AD B9 A4 68 BB 3A   .6zz%;..R#...h.:&lt;br /&gt;
000060	59 23 3F 45 BC 57 83 80  02 20 59 AF 01 CA 17 D0   Y#?E.W... Y.....&lt;br /&gt;
000070	0E 41 83 7A 1D 58 E9 7A  A3 1B AE 58 4E DE C2 8D   .A.z.X.z...XN...&lt;br /&gt;
000080	35 BD 96 92 36 90 91 3B  AE 9A 01 41 04 9C 02 BF   5...6..;...A....&lt;br /&gt;
000090	C9 7E F2 36 CE 6D 8F E5  D9 40 13 C7 21 E9 15 98   .~.6.m...@..!...&lt;br /&gt;
0000A0	2A CD 2B 12 B6 5D 9B 7D  59 E2 0A 84 20 05 F8 FC   *.+..].}Y... ...&lt;br /&gt;
0000B0	4E 02 53 2E 87 3D 37 B9  6F 09 D6 D4 51 1A DA 8F   N.S..=7.o...Q...&lt;br /&gt;
0000C0	14 04 2F 46 61 4A 4C 70  C0 F1 4B EF F5 FF FF FF   ../FaJLp..K.....&lt;br /&gt;
0000D0	FF 02 40 4B 4C 00 00 00  00 00 19 76 A9 14 1A A0   ..@KL......v....&lt;br /&gt;
0000E0	CD 1C BE A6 E7 45 8A 7A  BA D5 12 A9 D9 EA 1A FB   .....E.z........&lt;br /&gt;
0000F0	22 5E 88 AC 80 FA E9 C7  00 00 00 00 19 76 A9 14   &amp;quot;^...........v..&lt;br /&gt;
000100	0E AB 5B EA 43 6A 04 84  CF AB 12 48 5E FD A0 B7   ..[.Cj.....H^...&lt;br /&gt;
000110	8B 4E CC 52 88 AC 00 00  00 00                     .N.R......&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Message header:&lt;br /&gt;
 F9 BE B4 D9                                       - main network magic bytes&lt;br /&gt;
 74 78 00 00 00 00 00 00 00 00 00 00               - &amp;quot;tx&amp;quot; command&lt;br /&gt;
 02 01 00 00                                       - payload is 258 bytes long&lt;br /&gt;
 E2 93 CD BE                                       - payload checksum (internal byte order)&lt;br /&gt;
&lt;br /&gt;
Transaction:&lt;br /&gt;
 01 00 00 00                                       - version&lt;br /&gt;
&lt;br /&gt;
Inputs:&lt;br /&gt;
 01                                                - number of transaction inputs&lt;br /&gt;
&lt;br /&gt;
Input 1:&lt;br /&gt;
 6D BD DB 08 5B 1D 8A F7  51 84 F0 BC 01 FA D5 8D  - previous output (outpoint)&lt;br /&gt;
 12 66 E9 B6 3B 50 88 19  90 E4 B4 0D 6A EE 36 29&lt;br /&gt;
 00 00 00 00&lt;br /&gt;
&lt;br /&gt;
 8B                                                - script is 139 bytes long&lt;br /&gt;
&lt;br /&gt;
 48 30 45 02 21 00 F3 58  1E 19 72 AE 8A C7 C7 36  - signature script (scriptSig)&lt;br /&gt;
 7A 7A 25 3B C1 13 52 23  AD B9 A4 68 BB 3A 59 23&lt;br /&gt;
 3F 45 BC 57 83 80 02 20  59 AF 01 CA 17 D0 0E 41&lt;br /&gt;
 83 7A 1D 58 E9 7A A3 1B  AE 58 4E DE C2 8D 35 BD&lt;br /&gt;
 96 92 36 90 91 3B AE 9A  01 41 04 9C 02 BF C9 7E&lt;br /&gt;
 F2 36 CE 6D 8F E5 D9 40  13 C7 21 E9 15 98 2A CD&lt;br /&gt;
 2B 12 B6 5D 9B 7D 59 E2  0A 84 20 05 F8 FC 4E 02&lt;br /&gt;
 53 2E 87 3D 37 B9 6F 09  D6 D4 51 1A DA 8F 14 04&lt;br /&gt;
 2F 46 61 4A 4C 70 C0 F1  4B EF F5&lt;br /&gt;
&lt;br /&gt;
 FF FF FF FF                                       - sequence&lt;br /&gt;
&lt;br /&gt;
Outputs:&lt;br /&gt;
 02                                                - 2 Output Transactions&lt;br /&gt;
&lt;br /&gt;
Output 1:&lt;br /&gt;
 40 4B 4C 00 00 00 00 00                           - 0.05 BTC (5000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 1A A0 CD 1C BE  A6 E7 45 8A 7A BA D5 12  - pk_script&lt;br /&gt;
 A9 D9 EA 1A FB 22 5E 88  AC&lt;br /&gt;
&lt;br /&gt;
Output 2:&lt;br /&gt;
 80 FA E9 C7 00 00 00 00                           - 33.54 BTC (3354000000)&lt;br /&gt;
 19                                                - pk_script is 25 bytes long&lt;br /&gt;
&lt;br /&gt;
 76 A9 14 0E AB 5B EA 43  6A 04 84 CF AB 12 48 5E  - pk_script&lt;br /&gt;
 FD A0 B7 8B 4E CC 52 88  AC&lt;br /&gt;
&lt;br /&gt;
Locktime:&lt;br /&gt;
 00 00 00 00                                       - lock time&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== block ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;&#039;block&#039;&#039;&#039; message is sent in response to a getdata message which requests transaction information from a block hash.&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A Unix timestamp recording when this block was created (Currently limited to dates before the year 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated [[Difficulty|difficulty target]] being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || txn_count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of transaction entries&lt;br /&gt;
|-&lt;br /&gt;
| ? || txns || tx[] || Block transactions, in format of &amp;quot;tx&amp;quot; command&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The SHA256 hash that identifies each block (and which must have a run of 0 bits) is calculated from the first 6 fields of this structure (version, prev_block, merkle_root, timestamp, bits, nonce, and standard SHA256 padding, making two 64-byte chunks in all) and &#039;&#039;not&#039;&#039; from the complete block. To calculate the hash, only two chunks need to be processed by the SHA256 algorithm. Since the &#039;&#039;nonce&#039;&#039; field is in the second chunk, the first chunk stays constant during mining and therefore only the second chunk needs to be processed. However, a Bitcoin hash is the hash of the hash, so two SHA256 rounds are needed for each mining iteration.&lt;br /&gt;
See [[Block hashing algorithm]] for details and an example.&lt;br /&gt;
&lt;br /&gt;
=== headers ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;headers&#039;&#039; packet returns block headers in response to a &#039;&#039;getheaders&#039;&#039; packet. &lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || count || [[Protocol_documentation#Variable_length_integer|var_int]] || Number of block headers&lt;br /&gt;
|-&lt;br /&gt;
| 81x? || headers || [[Protocol_documentation#Block_Headers|block_header]][] || [[Protocol_documentation#Block_Headers|Block headers]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note that the block headers in this packet include a transaction count (a var_int, so there can be more than 81 bytes per header) as opposed to the block headers that are hashed by miners.&lt;br /&gt;
&lt;br /&gt;
=== getaddr ===&lt;br /&gt;
&lt;br /&gt;
The getaddr message sends a request to a node asking for information about known active peers to help with finding potential nodes in the network. The response to receiving this message is to transmit one or more addr messages with one or more peers from a database of known active peers. The typical presumption is that a node is likely to be active if it has been sending a message within the last three hours.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
=== mempool ===&lt;br /&gt;
&lt;br /&gt;
The mempool message sends a request to a node asking for information about transactions it has verified but which have not yet confirmed. The response to receiving this message is an inv message containing the transaction hashes for all the transactions in the node&#039;s mempool.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
It is specified in [https://github.com/bitcoin/bips/blob/master/bip-0035.mediawiki BIP 35]. Since [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 37], if a [[Protocol_documentation#filterload.2C_filteradd.2C_filterclear.2C_merkleblock|bloom filter]] is loaded, only transactions matching the filter are replied.&lt;br /&gt;
&lt;br /&gt;
=== checkorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== submitorder ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== reply ===&lt;br /&gt;
&lt;br /&gt;
This message was used for [[IP Transactions]]. As IP transactions have been deprecated, it is no longer used.&lt;br /&gt;
&lt;br /&gt;
=== ping ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;ping&#039;&#039; message is sent primarily to confirm that the TCP/IP connection is still valid. An error in transmission is presumed to be a closed connection and the address is removed as a current peer.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || random nonce&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== pong ===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;pong&#039;&#039; message is sent in response to a &#039;&#039;ping&#039;&#039; message. In modern protocol versions, a &#039;&#039;pong&#039;&#039; response is generated using a nonce included in the ping.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 8 || nonce || uint64_t || nonce from ping&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== reject===&lt;br /&gt;
&lt;br /&gt;
The &#039;&#039;reject&#039;&#039; message is sent when messages are rejected.&lt;br /&gt;
&lt;br /&gt;
Payload:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || message || var_str || type of message rejected&lt;br /&gt;
|-&lt;br /&gt;
| 1 || ccode || char || code relating to rejected message&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || reason || var_str || text version of reason for rejection&lt;br /&gt;
|-&lt;br /&gt;
| 0+ || data || char || Optional extra data provided by some errors.  Currently, all errors which provide this field fill it with the TXID or block header hash of the object being rejected, so the field is 32 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
CCodes&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Value !! Name !! Description&lt;br /&gt;
|-&lt;br /&gt;
| 0x01 || REJECT_MALFORMED|| &lt;br /&gt;
|-&lt;br /&gt;
| 0x10 || REJECT_INVALID ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x11 || REJECT_OBSOLETE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x12 || REJECT_DUPLICATE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x40 || REJECT_NONSTANDARD ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x41 || REJECT_DUST ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x42 || REJECT_INSUFFICIENTFEE ||&lt;br /&gt;
|-&lt;br /&gt;
| 0x43 || REJECT_CHECKPOINT ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== filterload, filteradd, filterclear, merkleblock ===&lt;br /&gt;
&lt;br /&gt;
These messages are related to Bloom filtering of connections and are defined in [https://github.com/bitcoin/bips/blob/master/bip-0037.mediawiki BIP 0037].&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || filter || uint8_t[] || The filter itself is simply a bit field of arbitrary byte-aligned size. The maximum size is 36,000 bytes.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nHashFuncs || uint32_t || The number of hash functions to use in this filter. The maximum value allowed in this field is 50.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nTweak || uint32_t || A random value to add to the seed value in the hash function used by the bloom filter.&lt;br /&gt;
|-&lt;br /&gt;
| 1 || nFlags || uint8_t || A set of flags that control how matched items are added to the filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
See below for a description of the Bloom filter algorithm and how to select nHashFuncs and filter size for a desired false positive rate.&lt;br /&gt;
&lt;br /&gt;
Upon receiving a &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt; command, the remote peer will immediately restrict the broadcast transactions it announces (in inv packets) to transactions matching the filter, where the matching algorithm is specified below. The flags control the update behaviour of the matching algorithm.&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filteradd&amp;lt;/code&amp;gt; command is defined as follows:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || data || uint8_t[] || The data element to add to the current filter.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The data field must be smaller than or equal to 520 bytes in size (the maximum size of any potentially matched object).&lt;br /&gt;
&lt;br /&gt;
The given data element will be added to the Bloom filter. A filter must have been previously provided using &amp;lt;code&amp;gt;filterload&amp;lt;/code&amp;gt;. This command is useful if a new key or script is added to a clients wallet whilst it has connections to the network open, it avoids the need to re-calculate and send an entirely new filter to every peer (though doing so is usually advisable to maintain anonymity).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;filterclear&amp;lt;/code&amp;gt; command has no arguments at all.&lt;br /&gt;
&lt;br /&gt;
After a filter has been set, nodes don&#039;t merely stop announcing non-matching transactions, they can also serve filtered blocks. A filtered block is defined by the &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt; message and is defined like this:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || version || int32_t || Block version information, based upon the software version creating this block (note, this is signed)&lt;br /&gt;
|-&lt;br /&gt;
| 32 || prev_block || char[32] || The hash value of the previous block this particular block references&lt;br /&gt;
|-&lt;br /&gt;
| 32 || merkle_root || char[32] || The reference to a Merkle tree collection which is a hash of all transactions related to this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || timestamp || uint32_t || A timestamp recording when this block was created (Limited to 2106!)&lt;br /&gt;
|-&lt;br /&gt;
| 4 || bits || uint32_t || The calculated difficulty target being used for this block&lt;br /&gt;
|-&lt;br /&gt;
| 4 || nonce || uint32_t || The nonce used to generate this block… to allow variations of the header and compute different hashes&lt;br /&gt;
|-&lt;br /&gt;
| 4 || total_transactions || uint32_t || Number of transactions in the block (including unmatched ones)&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || hash_count || [[Protocol_documentation#Variable_length_integer|var_int]] || The number of hashes to follow&lt;br /&gt;
|-&lt;br /&gt;
| 32x? || hashes || char[32] || Hashes in depth-first order&lt;br /&gt;
|-&lt;br /&gt;
| 1+ || flag_bytes || [[Protocol_documentation#Variable_length_integer|var_int]] || The size of flags (in bytes) to follow&lt;br /&gt;
|-&lt;br /&gt;
| ? || flags || byte[] || Flag bits, packed per 8 in a byte, least significant bit first. Extra 0 bits are padded on to reach full byte size.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
After a &amp;lt;code&amp;gt;merkleblock&amp;lt;/code&amp;gt;, transactions matching the bloom filter are automatically sent in &#039;&#039;[[#tx|tx]]&#039;&#039; messages.&lt;br /&gt;
&lt;br /&gt;
A guide to creating a bloom filter, loading a merkle block, and parsing a partial merkle block tree can be found in the [https://bitcoin.org/en/developer-examples#creating-a-bloom-filter Developer Examples].&lt;br /&gt;
&lt;br /&gt;
=== alert ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; Support for [[Alert system|alert messages]] has been removed from bitcoin core in March 2016. Read more [https://bitcoin.org/en/alert/2016-11-01-alert-retirement here]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
An [[Alert system|&#039;&#039;&#039;alert&#039;&#039;&#039;]] is sent between nodes to send a general notification message throughout the network. If the alert can be confirmed with the signature as having come from the core development group of the Bitcoin software, the message is suggested to be displayed for end-users. Attempts to perform transactions, particularly automated transactions through the client, are suggested to be halted. The text in the Message string should be relayed to log files and any user interfaces.&lt;br /&gt;
&lt;br /&gt;
Alert format:&lt;br /&gt;
&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| ? || payload || uchar[] || Serialized alert payload&lt;br /&gt;
|-&lt;br /&gt;
| ? || signature || uchar[] || An ECDSA signature of the message&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The developers of Satoshi&#039;s client use this public key for signing alerts:&lt;br /&gt;
 04fc9702847840aaf195de8442ebecedf5b095cdbb9bc716bda9110971b28a49e0ead8564ff0db22209e0374782c093bb899692d524e9d6a6956e7c5ecbcd68284&lt;br /&gt;
 (hash) 1AGRxqDa5WjUKBwHB9XYEjmkv1ucoUUy1s&lt;br /&gt;
&lt;br /&gt;
The payload is serialized into a uchar[] to ensure that versions using incompatible alert formats can still relay alerts among one another. The current alert payload format is:&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Field Size !! Description !! Data type !! Comments&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Version || int32_t || Alert format version&lt;br /&gt;
|-&lt;br /&gt;
| 8 || RelayUntil || int64_t || The timestamp beyond which nodes should stop relaying this alert&lt;br /&gt;
|-&lt;br /&gt;
| 8 || Expiration || int64_t || The timestamp beyond which this alert is no longer in effect and should be ignored&lt;br /&gt;
|-&lt;br /&gt;
| 4 || ID || int32_t || A unique ID number for this alert&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Cancel || int32_t || All alerts with an ID number less than or equal to this number should be cancelled: deleted and not accepted in the future&lt;br /&gt;
|-&lt;br /&gt;
| ? || setCancel || set&amp;lt;int32_t&amp;gt; || All alert IDs contained in this set should be cancelled as above&lt;br /&gt;
|-&lt;br /&gt;
| 4 || MinVer || int32_t || This alert only applies to versions greater than or equal to this version. Other versions should still relay it.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || MaxVer || int32_t || This alert only applies to versions less than or equal to this version. Other versions should still relay it.&lt;br /&gt;
|-&lt;br /&gt;
| ? || setSubVer || set&amp;lt;string&amp;gt; || If this set contains any elements, then only nodes that have their subVer contained in this set are affected by the alert. Other versions should still relay it.&lt;br /&gt;
|-&lt;br /&gt;
| 4 || Priority || int32_t || Relative priority compared to other alerts&lt;br /&gt;
|-&lt;br /&gt;
| ? || Comment || string || A comment on the alert that is not displayed&lt;br /&gt;
|-&lt;br /&gt;
| ? || StatusBar || string || The alert message that is displayed to the user&lt;br /&gt;
|-&lt;br /&gt;
| ? || Reserved || string || Reserved&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Note: &#039;&#039;&#039;set&amp;lt;&#039;&#039;type&#039;&#039;&amp;gt;&#039;&#039;&#039; in the table above is a [[#Variable length integer | variable length integer]] followed by the number of fields of the given &#039;&#039;type&#039;&#039; (either int32_t or [[#Variable length string | variable length string]])&lt;br /&gt;
&lt;br /&gt;
Sample alert (no message header):&lt;br /&gt;
 73010000003766404f00000000b305434f00000000f2030000f1030000001027000048ee0000&lt;br /&gt;
 0064000000004653656520626974636f696e2e6f72672f666562323020696620796f75206861&lt;br /&gt;
 76652074726f75626c6520636f6e6e656374696e672061667465722032302046656272756172&lt;br /&gt;
 79004730450221008389df45f0703f39ec8c1cc42c13810ffcae14995bb648340219e353b63b&lt;br /&gt;
 53eb022009ec65e1c1aaeec1fd334c6b684bde2b3f573060d5b70c3a46723326e4e8a4f1&lt;br /&gt;
 &lt;br /&gt;
 Version: 1&lt;br /&gt;
 RelayUntil: 1329620535&lt;br /&gt;
 Expiration: 1329792435&lt;br /&gt;
 ID: 1010&lt;br /&gt;
 Cancel: 1009&lt;br /&gt;
 setCancel: &amp;lt;empty&amp;gt;&lt;br /&gt;
 MinVer: 10000&lt;br /&gt;
 MaxVer: 61000&lt;br /&gt;
 setSubVer: &amp;lt;empty&amp;gt;&lt;br /&gt;
 Priority: 100&lt;br /&gt;
 Comment: &amp;lt;empty&amp;gt;&lt;br /&gt;
 StatusBar: &amp;quot;See bitcoin.org/feb20 if you have trouble connecting after 20 February&amp;quot;&lt;br /&gt;
 Reserved: &amp;lt;empty&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== sendheaders ===&lt;br /&gt;
&lt;br /&gt;
Request for Direct headers announcement. &lt;br /&gt;
&lt;br /&gt;
Upon receipt of this message, the node is be permitted, but not required, to announce new blocks by &#039;&#039;&#039;headers&#039;&#039;&#039; command (instead of &#039;&#039;&#039;inv&#039;&#039;&#039; command).&lt;br /&gt;
&lt;br /&gt;
This message is supported by the protocol version &amp;gt;= 70012 or Bitcoin Core version &amp;gt;= 0.12.0.&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0130.mediawiki BIP 130] for more information.&lt;br /&gt;
&lt;br /&gt;
No additional data is transmitted with this message.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== feefilter ===&lt;br /&gt;
&lt;br /&gt;
The payload is always 8 bytes long and it encodes 64 bit integer value (LSB / little endian) of &#039;&#039;&#039;feerate&#039;&#039;&#039;.&lt;br /&gt;
The value represents a minimal fee and is expressed in satoshis per 1000 bytes.&lt;br /&gt;
&lt;br /&gt;
Upon receipt of a &amp;quot;feefilter&amp;quot; message, the node will be permitted, but not required, to filter transaction invs for transactions that fall below the feerate provided in the feefilter message interpreted as satoshis per kilobyte.&lt;br /&gt;
&lt;br /&gt;
The fee filter is additive with a bloom filter for transactions so if an SPV client were to load a bloom filter and send a feefilter message, transactions would only be relayed if they passed both filters.&lt;br /&gt;
&lt;br /&gt;
Inv&#039;s generated from a mempool message are also subject to a fee filter if it exists.&lt;br /&gt;
&lt;br /&gt;
Feature discovery is enabled by checking protocol version &amp;gt;= 70013&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0133.mediawiki BIP 133] for more information.&lt;br /&gt;
&lt;br /&gt;
=== sendcmpct ===&lt;br /&gt;
&lt;br /&gt;
# The sendcmpct message is defined as a message containing a 1-byte integer followed by a 8-byte integer where pchCommand == &amp;quot;sendcmpct&amp;quot;.&lt;br /&gt;
# The first integer SHALL be interpreted as a boolean (and MUST have a value of either 1 or 0)&lt;br /&gt;
# The second integer SHALL be interpreted as a little-endian version number. Nodes sending a sendcmpct message MUST currently set this value to 1.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first and second integers set to 1, the node SHOULD announce new blocks by sending a cmpctblock message.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the first integer set to 0, the node SHOULD NOT announce new blocks by sending a cmpctblock message, but SHOULD announce new blocks by sending invs or headers, as defined by BIP130.&lt;br /&gt;
# Upon receipt of a &amp;quot;sendcmpct&amp;quot; message with the second integer set to something other than 1, nodes MUST treat the peer as if they had not received the message (as it indicates the peer will provide an unexpected encoding in &lt;br /&gt;
# cmpctblock, and/or other, messages). This allows future versions to send duplicate sendcmpct messages with different versions as a part of a version handshake for future versions.&lt;br /&gt;
# Nodes SHOULD check for a protocol version of &amp;gt;= 70014 before sending sendcmpct messages.&lt;br /&gt;
# Nodes MUST NOT send a request for a MSG_CMPCT_BLOCK object to a peer before having received a sendcmpct message from that peer.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== cmpctblock ===&lt;br /&gt;
&lt;br /&gt;
# The cmpctblock message is defined as as a message containing a serialized [[Protocol_documentation#HeaderAndShortIDs|HeaderAndShortIDs]] message and pchCommand == &amp;quot;cmpctblock&amp;quot;.&lt;br /&gt;
# Upon receipt of a cmpctblock message after sending a sendcmpct message, nodes SHOULD calculate the [[Protocol_documentation#Short_transaction_ID|short transaction ID]] for each unconfirmed transaction they have available (ie in their mempool) and compare each to each short transaction ID in the cmpctblock message.&lt;br /&gt;
# After finding already-available transactions, nodes which do not have all transactions available to reconstruct the full block SHOULD request the missing transactions using a getblocktxn message.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message unless they are able to respond to a getblocktxn message which requests every transaction in the block.&lt;br /&gt;
# A node MUST NOT send a cmpctblock message without having validated that the header properly commits to each transaction in the block, and properly builds on top of the existing chain with a valid proof-of-work. A node MAY send a cmpctblock before validating that each transaction in the block validly spends existing [[UTXO]] set entries.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== getblocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The getblocktxn message is defined as as a message containing a serialized [[Protocol_documentation#BlockTransactionsRequest|BlockTransactionsRequest]] message and pchCommand == &amp;quot;getblocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted getblocktxnmessage, nodes which recently provided the sender of such a message a cmpctblock for the block hash identified in this message MUST respond with an appropriate [[Protocol_documentation#blocktxn|blocktxn]] message. Such a blocktxn message MUST contain exactly and only each transaction which is present in the appropriate block at the index specified in the getblocktxn indexes list, in the order requested.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
=== blocktxn ===&lt;br /&gt;
&lt;br /&gt;
# The blocktxn message is defined as as a message containing a serialized [[Protocol_documentation#BlockTransactions|BlockTransactions]] message and pchCommand == &amp;quot;blocktxn&amp;quot;.&lt;br /&gt;
# Upon receipt of a properly-formatted requested blocktxn message, nodes SHOULD attempt to reconstruct the full block by:&lt;br /&gt;
# Taking the prefilledtxn transactions from the original [[Protocol_documentation#cmpctblock|cmpctblock]] and placing them in the marked positions.&lt;br /&gt;
# For each short transaction ID from the original [[Protocol_documentation#cmpctblock|cmpctblock]], in order, find the corresponding transaction either from the blocktxn message or from other sources and place it in the first available position in the block.&lt;br /&gt;
# Once the block has been reconstructed, it shall be processed as normal, keeping in mind that short transaction IDs are expected to occasionally collide, and that nodes MUST NOT be penalized for such collisions, wherever they appear.&lt;br /&gt;
&lt;br /&gt;
This message is only supported by protocol version &amp;gt;= 70014&lt;br /&gt;
&lt;br /&gt;
See [https://github.com/bitcoin/bips/blob/master/bip-0152.mediawiki BIP 152] for more information.&lt;br /&gt;
&lt;br /&gt;
== Scripting ==&lt;br /&gt;
&lt;br /&gt;
See [[script]].&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Network]]&lt;br /&gt;
* [[Protocol rules]]&lt;br /&gt;
* [[Hardfork Wishlist]]&lt;br /&gt;
* [https://bitcoin.org/en/developer-documentation Developer Documentation on bitcoin.org]&lt;br /&gt;
* Bitcoin dissectors for Wireshark: https://github.com/lbotsch/wireshark-bitcoin https://github.com/op-sig/bitcoin-wireshark-dissector&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[zh-cn:协议说明]]&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Segregated_Witness&amp;diff=68705</id>
		<title>Talk:Segregated Witness</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Segregated_Witness&amp;diff=68705"/>
		<updated>2021-06-24T16:24:27Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Created page with &amp;quot;## What flaw?  The article currently says &amp;quot;by exploiting a flaw in the BIP 9 activation mechanism&amp;quot;. What flaw exactly? This should either be clarified or removed. ~~~~&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;## What flaw?&lt;br /&gt;
&lt;br /&gt;
The article currently says &amp;quot;by exploiting a flaw in the BIP 9 activation mechanism&amp;quot;. What flaw exactly? This should either be clarified or removed. [[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 16:24, 24 June 2021 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Script&amp;diff=68613</id>
		<title>Script</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Script&amp;diff=68613"/>
		<updated>2021-04-18T21:29:44Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Stack */ Clarifying description of op_rot in a way more consistent with other definitions (and not using the word &amp;quot;left&amp;quot; which makes no sense in a stack)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bitcoin uses a scripting system for [[transactions]]. [[Wikipedia:FORTH|Forth]]-like, &#039;&#039;&#039;Script&#039;&#039;&#039; is simple, stack-based, and processed from left to right. It is intentionally not Turing-complete, with no loops.&lt;br /&gt;
&lt;br /&gt;
A script is essentially a list of instructions recorded with each transaction that describe how the next person wanting to spend the Bitcoins being transferred can gain access to them.  The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two things: the spender must provide&lt;br /&gt;
# a public key that, when hashed, yields destination address D embedded in the script, and&lt;br /&gt;
# a signature to prove ownership of the private key corresponding to the public key just provided.&lt;br /&gt;
&lt;br /&gt;
Scripting provides the flexibility to change the parameters of what&#039;s needed to spend transferred Bitcoins.  For example, the scripting system could be used to require two private keys, or a combination of several keys, or even no keys at all.&lt;br /&gt;
&lt;br /&gt;
A transaction is valid if nothing in the combined script triggers failure and the top stack item is True (non-zero) when the script exits.  The party that originally &#039;&#039;sent&#039;&#039; the Bitcoins now being spent dictates the script operations that will occur &#039;&#039;last&#039;&#039; in order to release them for use in another transaction.  The party wanting to spend them must provide the input(s) to the previously recorded script that results in the combined script completing execution with a true value on the top of the stack.&lt;br /&gt;
&lt;br /&gt;
This document is for information purposes only. De facto, Bitcoin script is defined by the code run by the network to check the validity of blocks.&lt;br /&gt;
&lt;br /&gt;
The stacks hold byte vectors.&lt;br /&gt;
When used as numbers, byte vectors are interpreted as little-endian variable-length integers with the most significant bit determining the sign of the integer.&lt;br /&gt;
Thus 0x81 represents -1.&lt;br /&gt;
0x80 is another representation of zero (so called negative 0).&lt;br /&gt;
Positive 0 is represented by a null-length vector.&lt;br /&gt;
Byte vectors are interpreted as Booleans where False is represented by any representation of zero and True is represented by any representation of non-zero.&lt;br /&gt;
&lt;br /&gt;
Leading zeros in an integer and negative zero are allowed in blocks but get rejected by the stricter requirements which standard full nodes put on transactions before retransmitting them.&lt;br /&gt;
Byte vectors on the stack are not allowed to be more than 520 bytes long. Opcodes which take integers and bools off the stack require that they be no more than 4 bytes long, but addition and subtraction can overflow and result in a 5 byte integer being put on the stack.&lt;br /&gt;
&lt;br /&gt;
== Opcodes ==&lt;br /&gt;
This is a list of all Script words, also known as opcodes, commands, or functions.&lt;br /&gt;
&lt;br /&gt;
There are some words which existed in very early versions of Bitcoin but were removed out of concern that the client might have a bug in their implementation. This fear was motivated by a bug found in OP_LSHIFT that could crash any Bitcoin node if exploited and by other bugs that allowed anyone to spend anyone&#039;s bitcoins. The removed opcodes are sometimes said to be &amp;quot;disabled&amp;quot;, but this is something of a misnomer because there is &#039;&#039;absolutely no way&#039;&#039; for anyone using Bitcoin to use these opcodes (they simply &#039;&#039;do not exist anymore&#039;&#039; in the protocol), and there are also no solid plans to ever re-enable all of these opcodes. They are listed here for historical interest only.&lt;br /&gt;
&lt;br /&gt;
New opcodes can be added by means of a carefully designed and executed [[softfork]] using OP_NOP1-OP_NOP10.&lt;br /&gt;
&lt;br /&gt;
Zero, negative zero (using any number of bytes), and empty array are all treated as false. Anything else is treated as true.&lt;br /&gt;
&lt;br /&gt;
=== Notation on this page ===&lt;br /&gt;
&lt;br /&gt;
In the tables below, the inputs and outputs are both described by items as if they were pushed on the stack in that order. So for example, &amp;quot;x1 x2&amp;quot; indicates pushing value x1 on the stack, then x2, such that x1 is at the bottom of the stack, and x2 is at the top. &lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
When talking about scripts, these value-pushing words are usually omitted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_0, OP_FALSE&lt;br /&gt;
|0&lt;br /&gt;
|0x00&lt;br /&gt;
|Nothing.&lt;br /&gt;
|(empty value)&lt;br /&gt;
|An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)&lt;br /&gt;
|-&lt;br /&gt;
|N/A&lt;br /&gt;
|1-75&lt;br /&gt;
|0x01-0x4b&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next &#039;&#039;opcode&#039;&#039; bytes is data to be pushed onto the stack&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA1&lt;br /&gt;
|76&lt;br /&gt;
|0x4c&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next byte contains the number of bytes to be pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA2&lt;br /&gt;
|77&lt;br /&gt;
|0x4d&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next two bytes contain the number of bytes to be pushed onto the stack in little endian order.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA4&lt;br /&gt;
|78&lt;br /&gt;
|0x4e&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next four bytes contain the number of bytes to be pushed onto the stack in little endian order.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1NEGATE&lt;br /&gt;
|79&lt;br /&gt;
|0x4f&lt;br /&gt;
|Nothing.&lt;br /&gt;
| -1&lt;br /&gt;
|The number -1 is pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1, OP_TRUE&lt;br /&gt;
|81&lt;br /&gt;
|0x51&lt;br /&gt;
|Nothing.&lt;br /&gt;
|1&lt;br /&gt;
|The number 1 is pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2-OP_16&lt;br /&gt;
|82-96&lt;br /&gt;
|0x52-0x60&lt;br /&gt;
|Nothing.&lt;br /&gt;
|2-16&lt;br /&gt;
|The number in the word name (2-16) is pushed onto the stack.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Flow control ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOP&lt;br /&gt;
|97&lt;br /&gt;
|0x61&lt;br /&gt;
|Nothing&lt;br /&gt;
|Nothing&lt;br /&gt;
|Does nothing.&lt;br /&gt;
|-&lt;br /&gt;
|OP_IF&lt;br /&gt;
|99&lt;br /&gt;
|0x63&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|If the top stack value is not False, the statements are executed. The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOTIF&lt;br /&gt;
|100&lt;br /&gt;
|0x64&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; notif [statements] [else [statements]]* endif&lt;br /&gt;
|If the top stack value is False, the statements are executed. The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ELSE&lt;br /&gt;
|103&lt;br /&gt;
|0x67&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not. &lt;br /&gt;
|-&lt;br /&gt;
|OP_ENDIF&lt;br /&gt;
|104&lt;br /&gt;
|0x68&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|Ends an if/else block. All blocks must end, or the transaction is &#039;&#039;&#039;invalid&#039;&#039;&#039;. An OP_ENDIF without OP_IF earlier is also &#039;&#039;&#039;invalid&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERIFY&lt;br /&gt;
|105&lt;br /&gt;
|0x69&lt;br /&gt;
|True / false&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if top stack value is not true.  The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|[[OP_RETURN]]&lt;br /&gt;
|106&lt;br /&gt;
|0x6a&lt;br /&gt;
|Nothing&lt;br /&gt;
|&#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039;. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since [https://bitcoin.org/en/release/v0.12.0#relay-any-sequence-of-pushdatas-in-opreturn-outputs-now-allowed 0.12], standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED&amp;lt;ref&amp;gt;see code for IsPushOnly [https://github.com/bitcoin/bitcoin/blob/bccb4d29a8080bf1ecda1fc235415a11d903a680/src/script/script.cpp#L232]&amp;lt;/ref&amp;gt;) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stack ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_TOALTSTACK&lt;br /&gt;
|107&lt;br /&gt;
|0x6b&lt;br /&gt;
|x1&lt;br /&gt;
|(alt)x1&lt;br /&gt;
|Puts the input onto the top of the alt stack. Removes it from the main stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_FROMALTSTACK&lt;br /&gt;
|108&lt;br /&gt;
|0x6c&lt;br /&gt;
|(alt)x1&lt;br /&gt;
|x1&lt;br /&gt;
|Puts the input onto the top of the main stack. Removes it from the alt stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_IFDUP&lt;br /&gt;
|115&lt;br /&gt;
|0x73&lt;br /&gt;
|x&lt;br /&gt;
|x / x x&lt;br /&gt;
|If the top stack value is not 0, duplicate it.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DEPTH&lt;br /&gt;
|116&lt;br /&gt;
|0x74&lt;br /&gt;
|Nothing&lt;br /&gt;
|&amp;lt;Stack size&amp;gt;&lt;br /&gt;
|Puts the number of stack items onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DROP&lt;br /&gt;
|117&lt;br /&gt;
|0x75&lt;br /&gt;
|x&lt;br /&gt;
|Nothing&lt;br /&gt;
|Removes the top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DUP&lt;br /&gt;
|118&lt;br /&gt;
|0x76&lt;br /&gt;
|x&lt;br /&gt;
|x x&lt;br /&gt;
|Duplicates the top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NIP&lt;br /&gt;
|119&lt;br /&gt;
|0x77&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2&lt;br /&gt;
|Removes the second-to-top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_OVER&lt;br /&gt;
|120&lt;br /&gt;
|0x78&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x1 x2 x1&lt;br /&gt;
|Copies the second-to-top stack item to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PICK&lt;br /&gt;
|121&lt;br /&gt;
|0x79&lt;br /&gt;
|xn ... x2 x1 x0 &amp;lt;n&amp;gt;&lt;br /&gt;
|xn ... x2 x1 x0 xn&lt;br /&gt;
|The item &#039;&#039;n&#039;&#039; back in the stack is copied to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ROLL&lt;br /&gt;
|122&lt;br /&gt;
|0x7a&lt;br /&gt;
|xn ... x2 x1 x0 &amp;lt;n&amp;gt;&lt;br /&gt;
|... x2 x1 x0 xn&lt;br /&gt;
|The item &#039;&#039;n&#039;&#039; back in the stack is moved to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ROT&lt;br /&gt;
|123&lt;br /&gt;
|0x7b&lt;br /&gt;
|x1 x2 x3&lt;br /&gt;
|x2 x3 x1&lt;br /&gt;
|The 3rd item down the stack is moved to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SWAP&lt;br /&gt;
|124&lt;br /&gt;
|0x7c&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2 x1&lt;br /&gt;
|The top two items on the stack are swapped.&lt;br /&gt;
|-&lt;br /&gt;
|OP_TUCK&lt;br /&gt;
|125&lt;br /&gt;
|0x7d&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2 x1 x2&lt;br /&gt;
|The item at the top of the stack is copied and inserted before the second-to-top item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DROP&lt;br /&gt;
|109&lt;br /&gt;
|0x6d&lt;br /&gt;
|x1 x2&lt;br /&gt;
|Nothing&lt;br /&gt;
|Removes the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DUP&lt;br /&gt;
|110&lt;br /&gt;
|0x6e&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x1 x2 x1 x2&lt;br /&gt;
|Duplicates the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_3DUP&lt;br /&gt;
|111&lt;br /&gt;
|0x6f&lt;br /&gt;
|x1 x2 x3&lt;br /&gt;
|x1 x2 x3 x1 x2 x3&lt;br /&gt;
|Duplicates the top three stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2OVER&lt;br /&gt;
|112&lt;br /&gt;
|0x70&lt;br /&gt;
|x1 x2 x3 x4&lt;br /&gt;
|x1 x2 x3 x4 x1 x2&lt;br /&gt;
|Copies the pair of items two spaces back in the stack to the front.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2ROT&lt;br /&gt;
|113&lt;br /&gt;
|0x71&lt;br /&gt;
|x1 x2 x3 x4 x5 x6&lt;br /&gt;
|x3 x4 x5 x6 x1 x2&lt;br /&gt;
|The fifth and sixth items back are moved to the top of the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2SWAP&lt;br /&gt;
|114&lt;br /&gt;
|0x72&lt;br /&gt;
|x1 x2 x3 x4&lt;br /&gt;
|x3 x4 x1 x2&lt;br /&gt;
|Swaps the top two pairs of items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Splice ===&lt;br /&gt;
&lt;br /&gt;
If any opcode marked as disabled is present in a script, it must abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_CAT&lt;br /&gt;
|126&lt;br /&gt;
|0x7e&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Concatenates two strings. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_SUBSTR&lt;br /&gt;
|127&lt;br /&gt;
|0x7f&lt;br /&gt;
|in begin size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Returns a section of a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_LEFT&lt;br /&gt;
|128&lt;br /&gt;
|0x80&lt;br /&gt;
|in size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Keeps only characters left of the specified point in a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RIGHT&lt;br /&gt;
|129&lt;br /&gt;
|0x81&lt;br /&gt;
|in size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Keeps only characters right of the specified point in a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_SIZE&lt;br /&gt;
|130&lt;br /&gt;
|0x82&lt;br /&gt;
|in&lt;br /&gt;
|in size&lt;br /&gt;
|Pushes the string length of the top element of the stack (without popping it).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Bitwise logic ===&lt;br /&gt;
&lt;br /&gt;
If any opcode marked as disabled is present in a script, it must abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_INVERT&lt;br /&gt;
|131&lt;br /&gt;
|0x83&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Flips all of the bits in the input. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_AND&lt;br /&gt;
|132&lt;br /&gt;
|0x84&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;and&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_OR&lt;br /&gt;
|133&lt;br /&gt;
|0x85&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;or&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_XOR&lt;br /&gt;
|134&lt;br /&gt;
|0x86&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;exclusive or&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_EQUAL&lt;br /&gt;
|135&lt;br /&gt;
|0x87&lt;br /&gt;
|x1 x2&lt;br /&gt;
|True / false&lt;br /&gt;
|Returns 1 if the inputs are exactly equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_EQUALVERIFY&lt;br /&gt;
|136&lt;br /&gt;
|0x88&lt;br /&gt;
|x1 x2&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_EQUAL, but runs OP_VERIFY afterward.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic ===&lt;br /&gt;
&lt;br /&gt;
Note: Arithmetic inputs are limited to signed 32-bit integers, but may overflow their output.&lt;br /&gt;
&lt;br /&gt;
If any input value for any of these commands is longer than 4 bytes, the script must abort and fail. &lt;br /&gt;
If any opcode marked as &#039;&#039;disabled&#039;&#039; is present in a script - it must also abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_1ADD&lt;br /&gt;
|139&lt;br /&gt;
|0x8b&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|1 is added to the input.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1SUB&lt;br /&gt;
|140&lt;br /&gt;
|0x8c&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|1 is subtracted from the input.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2MUL&lt;br /&gt;
|141&lt;br /&gt;
|0x8d&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|The input is multiplied by 2. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DIV&lt;br /&gt;
|142&lt;br /&gt;
|0x8e&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|The input is divided by 2. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_NEGATE&lt;br /&gt;
|143&lt;br /&gt;
|0x8f&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|The sign of the input is flipped.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ABS&lt;br /&gt;
|144&lt;br /&gt;
|0x90&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|The input is made positive.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOT&lt;br /&gt;
|145&lt;br /&gt;
|0x91&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|If the input is 0 or 1, it is flipped. Otherwise the output will be 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_0NOTEQUAL&lt;br /&gt;
|146&lt;br /&gt;
|0x92&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|Returns 0 if the input is 0. 1 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ADD&lt;br /&gt;
|147&lt;br /&gt;
|0x93&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|a is added to b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SUB&lt;br /&gt;
|148&lt;br /&gt;
|0x94&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|b is subtracted from a.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MUL&lt;br /&gt;
|149&lt;br /&gt;
|0x95&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|a is multiplied by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_DIV&lt;br /&gt;
|150&lt;br /&gt;
|0x96&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|a is divided by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_MOD&lt;br /&gt;
|151&lt;br /&gt;
|0x97&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Returns the remainder after dividing a by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_LSHIFT&lt;br /&gt;
|152&lt;br /&gt;
|0x98&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Shifts a left b bits, preserving sign. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RSHIFT&lt;br /&gt;
|153&lt;br /&gt;
|0x99&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Shifts a right b bits, preserving sign. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_BOOLAND&lt;br /&gt;
|154&lt;br /&gt;
|0x9a&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|If both a and b are not 0, the output is 1. Otherwise 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_BOOLOR&lt;br /&gt;
|155&lt;br /&gt;
|0x9b&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|If a or b is not 0, the output is 1. Otherwise 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMEQUAL&lt;br /&gt;
|156&lt;br /&gt;
|0x9c&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if the numbers are equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMEQUALVERIFY&lt;br /&gt;
|157&lt;br /&gt;
|0x9d&lt;br /&gt;
|a b&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMNOTEQUAL&lt;br /&gt;
|158&lt;br /&gt;
|0x9e&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if the numbers are not equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_LESSTHAN&lt;br /&gt;
|159&lt;br /&gt;
|0x9f&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is less than b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_GREATERTHAN&lt;br /&gt;
|160&lt;br /&gt;
|0xa0&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is greater than b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_LESSTHANOREQUAL&lt;br /&gt;
|161&lt;br /&gt;
|0xa1&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is less than or equal to b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_GREATERTHANOREQUAL&lt;br /&gt;
|162&lt;br /&gt;
|0xa2&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is greater than or equal to b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MIN&lt;br /&gt;
|163&lt;br /&gt;
|0xa3&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns the smaller of a and b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MAX&lt;br /&gt;
|164&lt;br /&gt;
|0xa4&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns the larger of a and b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_WITHIN&lt;br /&gt;
|165&lt;br /&gt;
|0xa5&lt;br /&gt;
|x min max&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Crypto ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_RIPEMD160&lt;br /&gt;
|166&lt;br /&gt;
|0xa6&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using RIPEMD-160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SHA1&lt;br /&gt;
|167&lt;br /&gt;
|0xa7&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using SHA-1.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SHA256&lt;br /&gt;
|168&lt;br /&gt;
|0xa8&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using SHA-256.&lt;br /&gt;
|-&lt;br /&gt;
|OP_HASH160&lt;br /&gt;
|169&lt;br /&gt;
|0xa9&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed twice: first with SHA-256 and then with RIPEMD-160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_HASH256&lt;br /&gt;
|170&lt;br /&gt;
|0xaa&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed two times with SHA-256.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CODESEPARATOR&lt;br /&gt;
|171&lt;br /&gt;
|0xab&lt;br /&gt;
|Nothing&lt;br /&gt;
|Nothing&lt;br /&gt;
|All of the signature checking words will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.&lt;br /&gt;
|-&lt;br /&gt;
|[[OP_CHECKSIG]]&lt;br /&gt;
|172&lt;br /&gt;
|0xac&lt;br /&gt;
|sig pubkey&lt;br /&gt;
|True / false&lt;br /&gt;
|The entire transaction&#039;s outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKSIGVERIFY&lt;br /&gt;
|173&lt;br /&gt;
|0xad&lt;br /&gt;
|sig pubkey&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKMULTISIG&lt;br /&gt;
|174&lt;br /&gt;
|0xae&lt;br /&gt;
|x sig1 sig2 ... &amp;lt;number of signatures&amp;gt; pub1 pub2 &amp;lt;number of public keys&amp;gt;&lt;br /&gt;
|True / False&lt;br /&gt;
|Compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result.  All signatures need to match a public key. Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the scriptSig using the same order as their corresponding public keys were placed in the scriptPubKey or redeemScript.  If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKMULTISIGVERIFY&lt;br /&gt;
|175&lt;br /&gt;
|0xaf&lt;br /&gt;
|x sig1 sig2 ... &amp;lt;number of signatures&amp;gt; pub1 pub2 ... &amp;lt;number of public keys&amp;gt;&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Locktime ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKLOCKTIMEVERIFY (previously OP_NOP2)&lt;br /&gt;
|177&lt;br /&gt;
|0xb1&lt;br /&gt;
|x&lt;br /&gt;
|x / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if the top stack item is greater than the transaction&#039;s nLockTime field, otherwise script evaluation continues as though an OP_NOP was executed. Transaction is also invalid if 1. the stack is empty; or 2. the top stack item is negative; or 3. the top stack item is greater than or equal to 500000000 while the transaction&#039;s nLockTime field is less than 500000000, or vice versa; or 4. the input&#039;s nSequence field is equal to 0xffffffff. The precise semantics are described in [https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki BIP 0065].&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKSEQUENCEVERIFY (previously OP_NOP3)&lt;br /&gt;
|178&lt;br /&gt;
|0xb2&lt;br /&gt;
|x&lt;br /&gt;
|x / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if the relative lock time of the input (enforced by [https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki BIP 0068] with nSequence) is not equal to or longer than the value of the top stack item. The precise semantics are described in [https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki BIP 0112].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Pseudo-words===&lt;br /&gt;
These words are used internally for assisting with transaction matching. They are invalid if used in actual scripts.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUBKEYHASH&lt;br /&gt;
|253&lt;br /&gt;
|0xfd&lt;br /&gt;
|Represents a public key hashed with OP_HASH160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUBKEY&lt;br /&gt;
|254&lt;br /&gt;
|0xfe&lt;br /&gt;
|Represents a public key compatible with OP_CHECKSIG.&lt;br /&gt;
|-&lt;br /&gt;
|OP_INVALIDOPCODE&lt;br /&gt;
|255&lt;br /&gt;
|0xff&lt;br /&gt;
|Matches any opcode that is not yet assigned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reserved words ===&lt;br /&gt;
Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction &#039;&#039;&#039;invalid&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!When used...&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED&lt;br /&gt;
|80&lt;br /&gt;
|0x50&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_VER&lt;br /&gt;
|98&lt;br /&gt;
|0x62&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERIF&lt;br /&gt;
|101&lt;br /&gt;
|0x65&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid even when occuring in an unexecuted OP_IF branch&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERNOTIF&lt;br /&gt;
|102&lt;br /&gt;
|0x66&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid even when occuring in an unexecuted OP_IF branch&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED1&lt;br /&gt;
|137&lt;br /&gt;
|0x89&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED2&lt;br /&gt;
|138&lt;br /&gt;
|0x8a&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOP1, OP_NOP4-OP_NOP10&lt;br /&gt;
|176, 179-185&lt;br /&gt;
|0xb0, 0xb3-0xb9&lt;br /&gt;
|The word is ignored. Does not mark transaction as invalid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Script examples ==&lt;br /&gt;
The following is a list of interesting scripts.&lt;br /&gt;
When notating scripts, data to be pushed to the stack is generally enclosed in angle brackets&lt;br /&gt;
and data push commands are omitted.&lt;br /&gt;
Non-bracketed words are opcodes.&lt;br /&gt;
These examples include the “OP_” prefix, but it is permissible to omit it.&lt;br /&gt;
Thus&lt;br /&gt;
“&amp;lt;pubkey1&amp;gt; &amp;lt;pubkey2&amp;gt; OP_2 OP_CHECKMULTISIG”&lt;br /&gt;
may be abbreviated to&lt;br /&gt;
“&amp;lt;pubkey1&amp;gt; &amp;lt;pubkey2&amp;gt; 2 CHECKMULTISIG”.&lt;br /&gt;
Note that there is a small number of standard script forms that are relayed from node to node;&lt;br /&gt;
non-standard scripts are accepted if they are in a block, but nodes will not relay them.&lt;br /&gt;
&lt;br /&gt;
=== Standard Transaction to Bitcoin address (pay-to-pubkey-hash) ===&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To demonstrate how scripts look on the wire, here is a raw scriptPubKey:&lt;br /&gt;
&amp;lt;pre&amp;gt;  76       A9             14&lt;br /&gt;
OP_DUP OP_HASH160    Bytes to push&lt;br /&gt;
&lt;br /&gt;
89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA   88         AC&lt;br /&gt;
                      Data to push                     OP_EQUALVERIFY OP_CHECKSIG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: scriptSig is in the input of the spending transaction and scriptPubKey is in the output of the previously unspent i.e. &amp;quot;available&amp;quot; transaction.&lt;br /&gt;
&lt;br /&gt;
Here is how each word is processed:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Obsolete pay-to-pubkey transaction ===&lt;br /&gt;
&lt;br /&gt;
OP_CHECKSIG is used directly without first hashing the public key.&lt;br /&gt;
This was used by early versions of Bitcoin where people paid directly to IP addresses, before Bitcoin addresses were introduced.&lt;br /&gt;
scriptPubKeys of this transaction form are still recognized as payments to user by Bitcoin Core.&lt;br /&gt;
The disadvantage of this transaction form is that the whole public key needs to be known in advance, implying longer payment addresses, and that it provides less protection in the event of a break in the ECDSA signature algorithm.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: &amp;lt;pubKey&amp;gt; OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_CHECKSIG&lt;br /&gt;
|scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_CHECKSIG&lt;br /&gt;
|Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Provably Unspendable/Prunable Outputs ===&lt;br /&gt;
&lt;br /&gt;
The standard way to mark a transaction as provably unspendable is with a scriptPubKey of the following form:&lt;br /&gt;
&lt;br /&gt;
  scriptPubKey: OP_RETURN {zero or more ops}&lt;br /&gt;
&lt;br /&gt;
OP_RETURN immediately marks the script as invalid, guaranteeing that no scriptSig exists that could possibly spend that output. Thus the output can be immediately pruned from the [[UTXO|UTXO set]] even if it has not been spent. [http://blockexplorer.com/tx/eb31ca1a4cbd97c2770983164d7560d2d03276ae1aee26f12d7c2c6424252f29 eb31ca1a4cbd97c2770983164d7560d2d03276ae1aee26f12d7c2c6424252f29] is an example: it has a single output of zero value, thus giving the full 0.125BTC fee to the miner who mined the transaction without adding an entry to the UTXO set. You can also use OP_RETURN to add data to a transaction without the data ever appearing in the UTXO set, as seen in 1a2e22a717d626fc5db363582007c46924ae6b28319f07cb1b907776bd8293fc; [[P2Pool]] does this with the share chain hash txout in the coinbase of blocks it creates.&lt;br /&gt;
&lt;br /&gt;
=== Freezing funds until a time in the future ===&lt;br /&gt;
&lt;br /&gt;
Using OP_CHECKLOCKTIMEVERIFY it is possible to make funds provably unspendable until a certain point in the future.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: &amp;lt;expiry time&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt;&lt;br /&gt;
| OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt;&lt;br /&gt;
| OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is checked against the current time or block height.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is removed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Transaction puzzle ===&lt;br /&gt;
&lt;br /&gt;
Transaction a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b is an interesting puzzle.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL&lt;br /&gt;
 scriptSig: &amp;lt;data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To spend the transaction you need to come up with some data such that hashing the data twice results in the given hash.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
|&amp;lt;data&amp;gt; OP_HASH256 &amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data&amp;gt;&lt;br /&gt;
|OP_HASH256 &amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|scriptSig added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data_hash&amp;gt;&lt;br /&gt;
|&amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|The data is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data_hash&amp;gt; &amp;lt;given_hash&amp;gt;&lt;br /&gt;
|OP_EQUAL&lt;br /&gt;
|The given hash is pushed to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|The hashes are compared, leaving true on the stack.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This transaction was successfully spent by 09f691b2263260e71f363d1db51ff3100d285956a40cc0e4f8c8c2c4a80559b1. The required data happened to be the [[Genesis block]], and the given hash in the script was the genesis block header hashed twice with SHA-256. Note that while transactions like this are fun, they are not secure, because they do not contain any signatures and thus any transaction attempting to spend them can be replaced with a different transaction sending the funds somewhere else.&lt;br /&gt;
&lt;br /&gt;
=== Incentivized finding of hash collisions ===&lt;br /&gt;
&lt;br /&gt;
In 2013 Peter Todd created scripts that result in true if a hash collision is found. Bitcoin addresses resulting from these scripts can have money sent to them. If someone finds a hash collision they can spend the bitcoins on that address, so this setup acts as an incentive for somebody to do so.&lt;br /&gt;
&lt;br /&gt;
For example the SHA1 script:&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_2DUP OP_EQUAL OP_NOT OP_VERIFY OP_SHA1 OP_SWAP OP_SHA1 OP_EQUAL&lt;br /&gt;
 scriptSig: &amp;lt;preimage1&amp;gt; &amp;lt;preimage2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the bitcointalk thread &amp;lt;ref&amp;gt;[https://bitcointalk.org/index.php?topic=293382.0 bitcointalk forum thread on the hash collision bounties]&amp;lt;/ref&amp;gt; and reddit thread&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/1mavh9/trustless_bitcoin_bounty_for_sha1_sha256_etc/&amp;lt;/ref&amp;gt; for more details.&lt;br /&gt;
&lt;br /&gt;
In February 2017 the SHA1 bounty worth 2.48 bitcoins was claimed.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Transactions]]&lt;br /&gt;
* [[Contracts]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[https://bitcoin.sipa.be/miniscript] - Miniscript: a language for writing (a subset of) Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more.&lt;br /&gt;
*[https://github.com/siminchen/bitcoinIDE Bitcoin IDE] – Bitcoin Script for dummies&lt;br /&gt;
*[https://webbtc.com/script Bitcoin Debug Script Execution] – web tool which executes a script opcode-by-opcode&lt;br /&gt;
*[http://www.crmarsh.com/script-playground/ Script Playground] — convert Script to JavaScript&lt;br /&gt;
*[https://bitauth.com/ide BitAuth IDE] — an Integrated Development Environment for Bitcoin Authentication&lt;br /&gt;
&amp;lt;sup&amp;gt;(cf. &amp;quot;[http://bitcoin.stackexchange.com/q/42576/4334 Online Bitcoin Script simulator or debugger?]&amp;quot;)&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Script&amp;diff=68612</id>
		<title>Talk:Script</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Script&amp;diff=68612"/>
		<updated>2021-04-18T19:10:43Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{WikiProject|Protocol|quality=QNR|importance=TOP}}&lt;br /&gt;
xOP_IFDUP	115	0x73	x	x / x x	If the input is true or false, duplicate it.&lt;br /&gt;
&lt;br /&gt;
Shouldn&#039;t it be: &amp;quot;If the input is true, duplicate it.&amp;quot;?&lt;br /&gt;
--[[User:ThePiachu|ThePiachu]] 11:37, 20 December 2011 (GMT)&lt;br /&gt;
&lt;br /&gt;
The byte vectors in the stack are specified as being signed integers of variable-length. Then there&#039;s an explanation that these integers are considered false if they are either zero or negative zero, which is 0x80. For this to be the case, the elements should be represented in an old binary format called sign-magnitude, which is important to state explicitly, since today virtually all computers use two&#039;s complement as representation, and there&#039;s no such thing as a negative zero. There&#039;s even another representation, one&#039;s complement, where negative zero looks like 0xff.&lt;br /&gt;
&lt;br /&gt;
Reading the source code of the application, I see that arithmetic operations expect unsigned integers, for example, operations OP_2MUL and OP_2DIV are implemented as byte-shifting, which wouldn&#039;t work with signed representations.&lt;br /&gt;
&lt;br /&gt;
It seems to me that, at best, variable-length sign-magnitued integer format is only used for testing for truth, although I haven&#039;t read all the code yet.&lt;br /&gt;
&lt;br /&gt;
--[[User:Jpierre|Jean-Pierre Rupp]] 10:43, 4 March 2012 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Provably Unspendable/Prunable Outputs ==&lt;br /&gt;
&lt;br /&gt;
If im not mistaken this kind of transaction would not result in donating the output to the miner. It would instead make the output unusable by anyone forever. In my opinion the best and easiest way to donate to miner is just transfer BTC between your own addresses and set a high fee. [[User:Norill|Norill]] ([[User talk:Norill|talk]]) 22:32, 14 April 2013 (GMT)&lt;br /&gt;
&lt;br /&gt;
:norill: Fixed wording for OP_RETURN; it is mining fee in the example because the output value is zero, not 0.125BTC as I think you thought. Sorry about that.&lt;br /&gt;
:[[User:Petertodd|Peter Todd]] ([[User talk:Petertodd|talk]]) 02:51, 23 July 2013 (GMT)&lt;br /&gt;
&lt;br /&gt;
== Common confusion on Turing-completeness. ==&lt;br /&gt;
&lt;br /&gt;
Script isn&#039;t turing-complete under the precise definition of the term because it executes with bounded time and memory.&lt;br /&gt;
&lt;br /&gt;
But by the precise definition a conventional desktop computer is also not &amp;quot;turing-complete&amp;quot;: there are functions a universal turing machine can compute that a desktop cannot because the desktop computer runs out of memory first.&lt;br /&gt;
&lt;br /&gt;
The precise definition isn&#039;t terribly useful for most people, since it excludes most things we think of as computers. Many people read the &amp;quot;not Turing-complete&amp;quot; as a statement that Script is only as expressive as a regular language or only capable of expressing monotone functions or something like that. Not so, if you ignore the time/memory bounds script is technically universal for computation. Consider the fragment &amp;quot;2 OP_PICK OP_IF OP_SWAP OP_ENDIF&amp;quot;: This implements a [http://en.wikipedia.org/wiki/Fredkin_gate fredkin gate] which is universal and could just be wired up and repeated up to the operation limit Q.E.D.&lt;br /&gt;
&lt;br /&gt;
It&#039;s absolutely important for the Bitcoin system that script&#039;s execution has an quickly checkable, bounded, and very short runtime. The relevance of turing completeness to any of that is easily and often overstated. The greater limits of script&#039;s expressiveness come from the computation bound, not the computational model. --[[User:Gmaxwell|Gmaxwell]] ([[User talk:Gmaxwell|talk]]) 05:47, 28 March 2015 (UTC)&lt;br /&gt;
: I think that often when people talk about &amp;quot;Turing completeness&amp;quot;, they mean that any program written in a normal programming language can ~always be compiled into any &amp;quot;Turing complete&amp;quot; language, even though this isn&#039;t really the definition of Turing completeness. You can write a program in C to calculate pi to the n&amp;lt;sup&amp;gt;th&amp;lt;/sup&amp;gt; digit, and even if you were using regular C integers n could be pretty large without needing to modify the program. But the equivalent Script program would need to increase in size every time you increase the maximum size of n by 1, and this is what makes Script much weaker than C or any other normal programming language. [[User:Theymos|theymos]] ([[User talk:Theymos|talk]]) 18:32, 28 March 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
== OP_xVERIFY output is Nothing ==&lt;br /&gt;
&lt;br /&gt;
The commands OP_CHECKSIGVERIFY, OP_CHECKMULTISIGVERIFY, OP_VERIFY, OP_EQUALVERIFY, OP_NUMEQUALVERIFY shows a boolean output on the table of this page, however the output is Nothing. Is that correct? --[[User:Thelink2012|Thelink2012]] ([[User talk:Thelink2012|talk]]) 16:57, 15 November 2015 (UTC)&lt;br /&gt;
&lt;br /&gt;
== Order of inputs and outputs is not explained ==&lt;br /&gt;
&lt;br /&gt;
The way the inputs and outputs are listed isn&#039;t intuitive and isn&#039;t explained on this page. For example, for OP_SUB, it shows inputs as &amp;quot;x1 x2 x3&amp;quot; and outputs as &amp;quot;x2 x3 x1&amp;quot;. I would have expected that x1 would indicate the top of the stack, but instead it seems to indicate the first item pushed onto the stack (and therefore, the bottom of the stack). The outputs are described in the same way, which is even more unintuitive, since the outputs aren&#039;t pushed onto the stack individually but are just moved around. So the way to understand the way its written here is that the outputs are as if they were pushed in the order given (or to just understand that the top of the stack is the last item listed). &lt;br /&gt;
&lt;br /&gt;
I think we should reverse this so that the top of the stack is listed first. It would be a lot more intuitive I think. Alternatively, we can change the notation so that &amp;quot;x1&amp;quot; indicates the top of the stack, then writing &amp;quot;x3 x2 x1&amp;quot; would be easier to read intuitively either way - ie you clearly see the order they&#039;re pushed, but you can also look at the numbers to check their position on the stack. This could also be reversed so &amp;quot;x3 x2 x1&amp;quot; means that x3 is on the top of the stack (but was pushed third). &lt;br /&gt;
&lt;br /&gt;
Thoughts?&lt;br /&gt;
&lt;br /&gt;
Also it looks like OP_PICK and OP_ROLL are writing these values in a way that&#039;s not consistent with the rest of the page. Eg ROLL has inputs &amp;quot;xn ... x2 x1 x0 &amp;lt;n&amp;gt;&amp;quot;. It looks like its using 0-based indexes instead of the 1-based indexes the rest of the page uses, and it isn&#039;t numbering the xs in order of being pushed. But then again, this is a case where using this notation is useful - and I think it might make sense to change the rest of the page to using this convention. &lt;br /&gt;
&lt;br /&gt;
[[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 19:10, 18 April 2021 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Script&amp;diff=68611</id>
		<title>Script</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Script&amp;diff=68611"/>
		<updated>2021-04-18T19:04:36Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Opcodes */ Adding explanation of inputs and outputs ordering.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bitcoin uses a scripting system for [[transactions]]. [[Wikipedia:FORTH|Forth]]-like, &#039;&#039;&#039;Script&#039;&#039;&#039; is simple, stack-based, and processed from left to right. It is intentionally not Turing-complete, with no loops.&lt;br /&gt;
&lt;br /&gt;
A script is essentially a list of instructions recorded with each transaction that describe how the next person wanting to spend the Bitcoins being transferred can gain access to them.  The script for a typical Bitcoin transfer to destination Bitcoin address D simply encumbers future spending of the bitcoins with two things: the spender must provide&lt;br /&gt;
# a public key that, when hashed, yields destination address D embedded in the script, and&lt;br /&gt;
# a signature to prove ownership of the private key corresponding to the public key just provided.&lt;br /&gt;
&lt;br /&gt;
Scripting provides the flexibility to change the parameters of what&#039;s needed to spend transferred Bitcoins.  For example, the scripting system could be used to require two private keys, or a combination of several keys, or even no keys at all.&lt;br /&gt;
&lt;br /&gt;
A transaction is valid if nothing in the combined script triggers failure and the top stack item is True (non-zero) when the script exits.  The party that originally &#039;&#039;sent&#039;&#039; the Bitcoins now being spent dictates the script operations that will occur &#039;&#039;last&#039;&#039; in order to release them for use in another transaction.  The party wanting to spend them must provide the input(s) to the previously recorded script that results in the combined script completing execution with a true value on the top of the stack.&lt;br /&gt;
&lt;br /&gt;
This document is for information purposes only. De facto, Bitcoin script is defined by the code run by the network to check the validity of blocks.&lt;br /&gt;
&lt;br /&gt;
The stacks hold byte vectors.&lt;br /&gt;
When used as numbers, byte vectors are interpreted as little-endian variable-length integers with the most significant bit determining the sign of the integer.&lt;br /&gt;
Thus 0x81 represents -1.&lt;br /&gt;
0x80 is another representation of zero (so called negative 0).&lt;br /&gt;
Positive 0 is represented by a null-length vector.&lt;br /&gt;
Byte vectors are interpreted as Booleans where False is represented by any representation of zero and True is represented by any representation of non-zero.&lt;br /&gt;
&lt;br /&gt;
Leading zeros in an integer and negative zero are allowed in blocks but get rejected by the stricter requirements which standard full nodes put on transactions before retransmitting them.&lt;br /&gt;
Byte vectors on the stack are not allowed to be more than 520 bytes long. Opcodes which take integers and bools off the stack require that they be no more than 4 bytes long, but addition and subtraction can overflow and result in a 5 byte integer being put on the stack.&lt;br /&gt;
&lt;br /&gt;
== Opcodes ==&lt;br /&gt;
This is a list of all Script words, also known as opcodes, commands, or functions.&lt;br /&gt;
&lt;br /&gt;
There are some words which existed in very early versions of Bitcoin but were removed out of concern that the client might have a bug in their implementation. This fear was motivated by a bug found in OP_LSHIFT that could crash any Bitcoin node if exploited and by other bugs that allowed anyone to spend anyone&#039;s bitcoins. The removed opcodes are sometimes said to be &amp;quot;disabled&amp;quot;, but this is something of a misnomer because there is &#039;&#039;absolutely no way&#039;&#039; for anyone using Bitcoin to use these opcodes (they simply &#039;&#039;do not exist anymore&#039;&#039; in the protocol), and there are also no solid plans to ever re-enable all of these opcodes. They are listed here for historical interest only.&lt;br /&gt;
&lt;br /&gt;
New opcodes can be added by means of a carefully designed and executed [[softfork]] using OP_NOP1-OP_NOP10.&lt;br /&gt;
&lt;br /&gt;
Zero, negative zero (using any number of bytes), and empty array are all treated as false. Anything else is treated as true.&lt;br /&gt;
&lt;br /&gt;
=== Notation on this page ===&lt;br /&gt;
&lt;br /&gt;
In the tables below, the inputs and outputs are both described by items as if they were pushed on the stack in that order. So for example, &amp;quot;x1 x2&amp;quot; indicates pushing value x1 on the stack, then x2, such that x1 is at the bottom of the stack, and x2 is at the top. &lt;br /&gt;
&lt;br /&gt;
=== Constants ===&lt;br /&gt;
When talking about scripts, these value-pushing words are usually omitted.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_0, OP_FALSE&lt;br /&gt;
|0&lt;br /&gt;
|0x00&lt;br /&gt;
|Nothing.&lt;br /&gt;
|(empty value)&lt;br /&gt;
|An empty array of bytes is pushed onto the stack. (This is not a no-op: an item is added to the stack.)&lt;br /&gt;
|-&lt;br /&gt;
|N/A&lt;br /&gt;
|1-75&lt;br /&gt;
|0x01-0x4b&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next &#039;&#039;opcode&#039;&#039; bytes is data to be pushed onto the stack&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA1&lt;br /&gt;
|76&lt;br /&gt;
|0x4c&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next byte contains the number of bytes to be pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA2&lt;br /&gt;
|77&lt;br /&gt;
|0x4d&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next two bytes contain the number of bytes to be pushed onto the stack in little endian order.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUSHDATA4&lt;br /&gt;
|78&lt;br /&gt;
|0x4e&lt;br /&gt;
|(special)&lt;br /&gt;
|data&lt;br /&gt;
|The next four bytes contain the number of bytes to be pushed onto the stack in little endian order.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1NEGATE&lt;br /&gt;
|79&lt;br /&gt;
|0x4f&lt;br /&gt;
|Nothing.&lt;br /&gt;
| -1&lt;br /&gt;
|The number -1 is pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1, OP_TRUE&lt;br /&gt;
|81&lt;br /&gt;
|0x51&lt;br /&gt;
|Nothing.&lt;br /&gt;
|1&lt;br /&gt;
|The number 1 is pushed onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2-OP_16&lt;br /&gt;
|82-96&lt;br /&gt;
|0x52-0x60&lt;br /&gt;
|Nothing.&lt;br /&gt;
|2-16&lt;br /&gt;
|The number in the word name (2-16) is pushed onto the stack.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Flow control ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOP&lt;br /&gt;
|97&lt;br /&gt;
|0x61&lt;br /&gt;
|Nothing&lt;br /&gt;
|Nothing&lt;br /&gt;
|Does nothing.&lt;br /&gt;
|-&lt;br /&gt;
|OP_IF&lt;br /&gt;
|99&lt;br /&gt;
|0x63&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|If the top stack value is not False, the statements are executed. The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOTIF&lt;br /&gt;
|100&lt;br /&gt;
|0x64&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; notif [statements] [else [statements]]* endif&lt;br /&gt;
|If the top stack value is False, the statements are executed. The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ELSE&lt;br /&gt;
|103&lt;br /&gt;
|0x67&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|If the preceding OP_IF or OP_NOTIF or OP_ELSE was not executed then these statements are and if the preceding OP_IF or OP_NOTIF or OP_ELSE was executed then these statements are not. &lt;br /&gt;
|-&lt;br /&gt;
|OP_ENDIF&lt;br /&gt;
|104&lt;br /&gt;
|0x68&lt;br /&gt;
| colspan=&amp;quot;2&amp;quot;|&amp;lt;expression&amp;gt; if [statements] [else [statements]]* endif&lt;br /&gt;
|Ends an if/else block. All blocks must end, or the transaction is &#039;&#039;&#039;invalid&#039;&#039;&#039;. An OP_ENDIF without OP_IF earlier is also &#039;&#039;&#039;invalid&#039;&#039;&#039;.&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERIFY&lt;br /&gt;
|105&lt;br /&gt;
|0x69&lt;br /&gt;
|True / false&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if top stack value is not true.  The top stack value is removed.&lt;br /&gt;
|-&lt;br /&gt;
|[[OP_RETURN]]&lt;br /&gt;
|106&lt;br /&gt;
|0x6a&lt;br /&gt;
|Nothing&lt;br /&gt;
|&#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039;. Since bitcoin 0.9, a standard way of attaching extra data to transactions is to add a zero-value output with a scriptPubKey consisting of OP_RETURN followed by data. Such outputs are provably unspendable and specially discarded from storage in the UTXO set, reducing their cost to the network. Since [https://bitcoin.org/en/release/v0.12.0#relay-any-sequence-of-pushdatas-in-opreturn-outputs-now-allowed 0.12], standard relay rules allow a single output with OP_RETURN, that contains any sequence of push statements (or OP_RESERVED&amp;lt;ref&amp;gt;see code for IsPushOnly [https://github.com/bitcoin/bitcoin/blob/bccb4d29a8080bf1ecda1fc235415a11d903a680/src/script/script.cpp#L232]&amp;lt;/ref&amp;gt;) after the OP_RETURN provided the total scriptPubKey length is at most 83 bytes.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Stack ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_TOALTSTACK&lt;br /&gt;
|107&lt;br /&gt;
|0x6b&lt;br /&gt;
|x1&lt;br /&gt;
|(alt)x1&lt;br /&gt;
|Puts the input onto the top of the alt stack. Removes it from the main stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_FROMALTSTACK&lt;br /&gt;
|108&lt;br /&gt;
|0x6c&lt;br /&gt;
|(alt)x1&lt;br /&gt;
|x1&lt;br /&gt;
|Puts the input onto the top of the main stack. Removes it from the alt stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_IFDUP&lt;br /&gt;
|115&lt;br /&gt;
|0x73&lt;br /&gt;
|x&lt;br /&gt;
|x / x x&lt;br /&gt;
|If the top stack value is not 0, duplicate it.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DEPTH&lt;br /&gt;
|116&lt;br /&gt;
|0x74&lt;br /&gt;
|Nothing&lt;br /&gt;
|&amp;lt;Stack size&amp;gt;&lt;br /&gt;
|Puts the number of stack items onto the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DROP&lt;br /&gt;
|117&lt;br /&gt;
|0x75&lt;br /&gt;
|x&lt;br /&gt;
|Nothing&lt;br /&gt;
|Removes the top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_DUP&lt;br /&gt;
|118&lt;br /&gt;
|0x76&lt;br /&gt;
|x&lt;br /&gt;
|x x&lt;br /&gt;
|Duplicates the top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NIP&lt;br /&gt;
|119&lt;br /&gt;
|0x77&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2&lt;br /&gt;
|Removes the second-to-top stack item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_OVER&lt;br /&gt;
|120&lt;br /&gt;
|0x78&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x1 x2 x1&lt;br /&gt;
|Copies the second-to-top stack item to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PICK&lt;br /&gt;
|121&lt;br /&gt;
|0x79&lt;br /&gt;
|xn ... x2 x1 x0 &amp;lt;n&amp;gt;&lt;br /&gt;
|xn ... x2 x1 x0 xn&lt;br /&gt;
|The item &#039;&#039;n&#039;&#039; back in the stack is copied to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ROLL&lt;br /&gt;
|122&lt;br /&gt;
|0x7a&lt;br /&gt;
|xn ... x2 x1 x0 &amp;lt;n&amp;gt;&lt;br /&gt;
|... x2 x1 x0 xn&lt;br /&gt;
|The item &#039;&#039;n&#039;&#039; back in the stack is moved to the top.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ROT&lt;br /&gt;
|123&lt;br /&gt;
|0x7b&lt;br /&gt;
|x1 x2 x3&lt;br /&gt;
|x2 x3 x1&lt;br /&gt;
|The top three items on the stack are rotated to the left.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SWAP&lt;br /&gt;
|124&lt;br /&gt;
|0x7c&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2 x1&lt;br /&gt;
|The top two items on the stack are swapped.&lt;br /&gt;
|-&lt;br /&gt;
|OP_TUCK&lt;br /&gt;
|125&lt;br /&gt;
|0x7d&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x2 x1 x2&lt;br /&gt;
|The item at the top of the stack is copied and inserted before the second-to-top item.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DROP&lt;br /&gt;
|109&lt;br /&gt;
|0x6d&lt;br /&gt;
|x1 x2&lt;br /&gt;
|Nothing&lt;br /&gt;
|Removes the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DUP&lt;br /&gt;
|110&lt;br /&gt;
|0x6e&lt;br /&gt;
|x1 x2&lt;br /&gt;
|x1 x2 x1 x2&lt;br /&gt;
|Duplicates the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_3DUP&lt;br /&gt;
|111&lt;br /&gt;
|0x6f&lt;br /&gt;
|x1 x2 x3&lt;br /&gt;
|x1 x2 x3 x1 x2 x3&lt;br /&gt;
|Duplicates the top three stack items.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2OVER&lt;br /&gt;
|112&lt;br /&gt;
|0x70&lt;br /&gt;
|x1 x2 x3 x4&lt;br /&gt;
|x1 x2 x3 x4 x1 x2&lt;br /&gt;
|Copies the pair of items two spaces back in the stack to the front.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2ROT&lt;br /&gt;
|113&lt;br /&gt;
|0x71&lt;br /&gt;
|x1 x2 x3 x4 x5 x6&lt;br /&gt;
|x3 x4 x5 x6 x1 x2&lt;br /&gt;
|The fifth and sixth items back are moved to the top of the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2SWAP&lt;br /&gt;
|114&lt;br /&gt;
|0x72&lt;br /&gt;
|x1 x2 x3 x4&lt;br /&gt;
|x3 x4 x1 x2&lt;br /&gt;
|Swaps the top two pairs of items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Splice ===&lt;br /&gt;
&lt;br /&gt;
If any opcode marked as disabled is present in a script, it must abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_CAT&lt;br /&gt;
|126&lt;br /&gt;
|0x7e&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Concatenates two strings. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_SUBSTR&lt;br /&gt;
|127&lt;br /&gt;
|0x7f&lt;br /&gt;
|in begin size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Returns a section of a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_LEFT&lt;br /&gt;
|128&lt;br /&gt;
|0x80&lt;br /&gt;
|in size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Keeps only characters left of the specified point in a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RIGHT&lt;br /&gt;
|129&lt;br /&gt;
|0x81&lt;br /&gt;
|in size&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Keeps only characters right of the specified point in a string. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_SIZE&lt;br /&gt;
|130&lt;br /&gt;
|0x82&lt;br /&gt;
|in&lt;br /&gt;
|in size&lt;br /&gt;
|Pushes the string length of the top element of the stack (without popping it).&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Bitwise logic ===&lt;br /&gt;
&lt;br /&gt;
If any opcode marked as disabled is present in a script, it must abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_INVERT&lt;br /&gt;
|131&lt;br /&gt;
|0x83&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Flips all of the bits in the input. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_AND&lt;br /&gt;
|132&lt;br /&gt;
|0x84&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;and&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_OR&lt;br /&gt;
|133&lt;br /&gt;
|0x85&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;or&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_XOR&lt;br /&gt;
|134&lt;br /&gt;
|0x86&lt;br /&gt;
|x1 x2&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Boolean &#039;&#039;exclusive or&#039;&#039; between each bit in the inputs. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_EQUAL&lt;br /&gt;
|135&lt;br /&gt;
|0x87&lt;br /&gt;
|x1 x2&lt;br /&gt;
|True / false&lt;br /&gt;
|Returns 1 if the inputs are exactly equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_EQUALVERIFY&lt;br /&gt;
|136&lt;br /&gt;
|0x88&lt;br /&gt;
|x1 x2&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_EQUAL, but runs OP_VERIFY afterward.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Arithmetic ===&lt;br /&gt;
&lt;br /&gt;
Note: Arithmetic inputs are limited to signed 32-bit integers, but may overflow their output.&lt;br /&gt;
&lt;br /&gt;
If any input value for any of these commands is longer than 4 bytes, the script must abort and fail. &lt;br /&gt;
If any opcode marked as &#039;&#039;disabled&#039;&#039; is present in a script - it must also abort and fail.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_1ADD&lt;br /&gt;
|139&lt;br /&gt;
|0x8b&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|1 is added to the input.&lt;br /&gt;
|-&lt;br /&gt;
|OP_1SUB&lt;br /&gt;
|140&lt;br /&gt;
|0x8c&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|1 is subtracted from the input.&lt;br /&gt;
|-&lt;br /&gt;
|OP_2MUL&lt;br /&gt;
|141&lt;br /&gt;
|0x8d&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|The input is multiplied by 2. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_2DIV&lt;br /&gt;
|142&lt;br /&gt;
|0x8e&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|The input is divided by 2. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_NEGATE&lt;br /&gt;
|143&lt;br /&gt;
|0x8f&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|The sign of the input is flipped.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ABS&lt;br /&gt;
|144&lt;br /&gt;
|0x90&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|The input is made positive.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOT&lt;br /&gt;
|145&lt;br /&gt;
|0x91&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|If the input is 0 or 1, it is flipped. Otherwise the output will be 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_0NOTEQUAL&lt;br /&gt;
|146&lt;br /&gt;
|0x92&lt;br /&gt;
|in&lt;br /&gt;
|out&lt;br /&gt;
|Returns 0 if the input is 0. 1 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_ADD&lt;br /&gt;
|147&lt;br /&gt;
|0x93&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|a is added to b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SUB&lt;br /&gt;
|148&lt;br /&gt;
|0x94&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|b is subtracted from a.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MUL&lt;br /&gt;
|149&lt;br /&gt;
|0x95&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|a is multiplied by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_DIV&lt;br /&gt;
|150&lt;br /&gt;
|0x96&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|a is divided by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_MOD&lt;br /&gt;
|151&lt;br /&gt;
|0x97&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Returns the remainder after dividing a by b. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_LSHIFT&lt;br /&gt;
|152&lt;br /&gt;
|0x98&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Shifts a left b bits, preserving sign. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RSHIFT&lt;br /&gt;
|153&lt;br /&gt;
|0x99&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|style=&amp;quot;background:#D97171;&amp;quot;|Shifts a right b bits, preserving sign. &#039;&#039;disabled.&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_BOOLAND&lt;br /&gt;
|154&lt;br /&gt;
|0x9a&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|If both a and b are not 0, the output is 1. Otherwise 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_BOOLOR&lt;br /&gt;
|155&lt;br /&gt;
|0x9b&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|If a or b is not 0, the output is 1. Otherwise 0.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMEQUAL&lt;br /&gt;
|156&lt;br /&gt;
|0x9c&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if the numbers are equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMEQUALVERIFY&lt;br /&gt;
|157&lt;br /&gt;
|0x9d&lt;br /&gt;
|a b&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.&lt;br /&gt;
|-&lt;br /&gt;
|OP_NUMNOTEQUAL&lt;br /&gt;
|158&lt;br /&gt;
|0x9e&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if the numbers are not equal, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_LESSTHAN&lt;br /&gt;
|159&lt;br /&gt;
|0x9f&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is less than b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_GREATERTHAN&lt;br /&gt;
|160&lt;br /&gt;
|0xa0&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is greater than b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_LESSTHANOREQUAL&lt;br /&gt;
|161&lt;br /&gt;
|0xa1&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is less than or equal to b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_GREATERTHANOREQUAL&lt;br /&gt;
|162&lt;br /&gt;
|0xa2&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if a is greater than or equal to b, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MIN&lt;br /&gt;
|163&lt;br /&gt;
|0xa3&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns the smaller of a and b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_MAX&lt;br /&gt;
|164&lt;br /&gt;
|0xa4&lt;br /&gt;
|a b&lt;br /&gt;
|out&lt;br /&gt;
|Returns the larger of a and b.&lt;br /&gt;
|-&lt;br /&gt;
|OP_WITHIN&lt;br /&gt;
|165&lt;br /&gt;
|0xa5&lt;br /&gt;
|x min max&lt;br /&gt;
|out&lt;br /&gt;
|Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Crypto ===&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_RIPEMD160&lt;br /&gt;
|166&lt;br /&gt;
|0xa6&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using RIPEMD-160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SHA1&lt;br /&gt;
|167&lt;br /&gt;
|0xa7&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using SHA-1.&lt;br /&gt;
|-&lt;br /&gt;
|OP_SHA256&lt;br /&gt;
|168&lt;br /&gt;
|0xa8&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed using SHA-256.&lt;br /&gt;
|-&lt;br /&gt;
|OP_HASH160&lt;br /&gt;
|169&lt;br /&gt;
|0xa9&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed twice: first with SHA-256 and then with RIPEMD-160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_HASH256&lt;br /&gt;
|170&lt;br /&gt;
|0xaa&lt;br /&gt;
|in&lt;br /&gt;
|hash&lt;br /&gt;
|The input is hashed two times with SHA-256.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CODESEPARATOR&lt;br /&gt;
|171&lt;br /&gt;
|0xab&lt;br /&gt;
|Nothing&lt;br /&gt;
|Nothing&lt;br /&gt;
|All of the signature checking words will only match signatures to the data after the most recently-executed OP_CODESEPARATOR.&lt;br /&gt;
|-&lt;br /&gt;
|[[OP_CHECKSIG]]&lt;br /&gt;
|172&lt;br /&gt;
|0xac&lt;br /&gt;
|sig pubkey&lt;br /&gt;
|True / false&lt;br /&gt;
|The entire transaction&#039;s outputs, inputs, and script (from the most recently-executed OP_CODESEPARATOR to the end) are hashed. The signature used by OP_CHECKSIG must be a valid signature for this hash and public key. If it is, 1 is returned, 0 otherwise.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKSIGVERIFY&lt;br /&gt;
|173&lt;br /&gt;
|0xad&lt;br /&gt;
|sig pubkey&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_CHECKSIG, but OP_VERIFY is executed afterward.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKMULTISIG&lt;br /&gt;
|174&lt;br /&gt;
|0xae&lt;br /&gt;
|x sig1 sig2 ... &amp;lt;number of signatures&amp;gt; pub1 pub2 &amp;lt;number of public keys&amp;gt;&lt;br /&gt;
|True / False&lt;br /&gt;
|Compares the first signature against each public key until it finds an ECDSA match. Starting with the subsequent public key, it compares the second signature against each remaining public key until it finds an ECDSA match. The process is repeated until all signatures have been checked or not enough public keys remain to produce a successful result.  All signatures need to match a public key. Because public keys are not checked again if they fail any signature comparison, signatures must be placed in the scriptSig using the same order as their corresponding public keys were placed in the scriptPubKey or redeemScript.  If all signatures are valid, 1 is returned, 0 otherwise. Due to a bug, one extra unused value is removed from the stack.&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKMULTISIGVERIFY&lt;br /&gt;
|175&lt;br /&gt;
|0xaf&lt;br /&gt;
|x sig1 sig2 ... &amp;lt;number of signatures&amp;gt; pub1 pub2 ... &amp;lt;number of public keys&amp;gt;&lt;br /&gt;
|Nothing / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|Same as OP_CHECKMULTISIG, but OP_VERIFY is executed afterward.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Locktime ===&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Input&lt;br /&gt;
!Output&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKLOCKTIMEVERIFY (previously OP_NOP2)&lt;br /&gt;
|177&lt;br /&gt;
|0xb1&lt;br /&gt;
|x&lt;br /&gt;
|x / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if the top stack item is greater than the transaction&#039;s nLockTime field, otherwise script evaluation continues as though an OP_NOP was executed. Transaction is also invalid if 1. the stack is empty; or 2. the top stack item is negative; or 3. the top stack item is greater than or equal to 500000000 while the transaction&#039;s nLockTime field is less than 500000000, or vice versa; or 4. the input&#039;s nSequence field is equal to 0xffffffff. The precise semantics are described in [https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki BIP 0065].&lt;br /&gt;
|-&lt;br /&gt;
|OP_CHECKSEQUENCEVERIFY (previously OP_NOP3)&lt;br /&gt;
|178&lt;br /&gt;
|0xb2&lt;br /&gt;
|x&lt;br /&gt;
|x / &#039;&#039;fail&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Marks transaction as invalid&#039;&#039;&#039; if the relative lock time of the input (enforced by [https://github.com/bitcoin/bips/blob/master/bip-0068.mediawiki BIP 0068] with nSequence) is not equal to or longer than the value of the top stack item. The precise semantics are described in [https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki BIP 0112].&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
===Pseudo-words===&lt;br /&gt;
These words are used internally for assisting with transaction matching. They are invalid if used in actual scripts.&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!Description&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUBKEYHASH&lt;br /&gt;
|253&lt;br /&gt;
|0xfd&lt;br /&gt;
|Represents a public key hashed with OP_HASH160.&lt;br /&gt;
|-&lt;br /&gt;
|OP_PUBKEY&lt;br /&gt;
|254&lt;br /&gt;
|0xfe&lt;br /&gt;
|Represents a public key compatible with OP_CHECKSIG.&lt;br /&gt;
|-&lt;br /&gt;
|OP_INVALIDOPCODE&lt;br /&gt;
|255&lt;br /&gt;
|0xff&lt;br /&gt;
|Matches any opcode that is not yet assigned.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Reserved words ===&lt;br /&gt;
Any opcode not assigned is also reserved. Using an unassigned opcode makes the transaction &#039;&#039;&#039;invalid&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
!Word&lt;br /&gt;
!Opcode&lt;br /&gt;
!Hex&lt;br /&gt;
!When used...&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED&lt;br /&gt;
|80&lt;br /&gt;
|0x50&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_VER&lt;br /&gt;
|98&lt;br /&gt;
|0x62&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERIF&lt;br /&gt;
|101&lt;br /&gt;
|0x65&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid even when occuring in an unexecuted OP_IF branch&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_VERNOTIF&lt;br /&gt;
|102&lt;br /&gt;
|0x66&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid even when occuring in an unexecuted OP_IF branch&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED1&lt;br /&gt;
|137&lt;br /&gt;
|0x89&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_RESERVED2&lt;br /&gt;
|138&lt;br /&gt;
|0x8a&lt;br /&gt;
|&#039;&#039;&#039;Transaction is invalid&#039;&#039;&#039; unless occuring in an unexecuted OP_IF branch&lt;br /&gt;
|-&lt;br /&gt;
|OP_NOP1, OP_NOP4-OP_NOP10&lt;br /&gt;
|176, 179-185&lt;br /&gt;
|0xb0, 0xb3-0xb9&lt;br /&gt;
|The word is ignored. Does not mark transaction as invalid.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Script examples ==&lt;br /&gt;
The following is a list of interesting scripts.&lt;br /&gt;
When notating scripts, data to be pushed to the stack is generally enclosed in angle brackets&lt;br /&gt;
and data push commands are omitted.&lt;br /&gt;
Non-bracketed words are opcodes.&lt;br /&gt;
These examples include the “OP_” prefix, but it is permissible to omit it.&lt;br /&gt;
Thus&lt;br /&gt;
“&amp;lt;pubkey1&amp;gt; &amp;lt;pubkey2&amp;gt; OP_2 OP_CHECKMULTISIG”&lt;br /&gt;
may be abbreviated to&lt;br /&gt;
“&amp;lt;pubkey1&amp;gt; &amp;lt;pubkey2&amp;gt; 2 CHECKMULTISIG”.&lt;br /&gt;
Note that there is a small number of standard script forms that are relayed from node to node;&lt;br /&gt;
non-standard scripts are accepted if they are in a block, but nodes will not relay them.&lt;br /&gt;
&lt;br /&gt;
=== Standard Transaction to Bitcoin address (pay-to-pubkey-hash) ===&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To demonstrate how scripts look on the wire, here is a raw scriptPubKey:&lt;br /&gt;
&amp;lt;pre&amp;gt;  76       A9             14&lt;br /&gt;
OP_DUP OP_HASH160    Bytes to push&lt;br /&gt;
&lt;br /&gt;
89 AB CD EF AB BA AB BA AB BA AB BA AB BA AB BA AB BA AB BA   88         AC&lt;br /&gt;
                      Data to push                     OP_EQUALVERIFY OP_CHECKSIG&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: scriptSig is in the input of the spending transaction and scriptPubKey is in the output of the previously unspent i.e. &amp;quot;available&amp;quot; transaction.&lt;br /&gt;
&lt;br /&gt;
Here is how each word is processed:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Obsolete pay-to-pubkey transaction ===&lt;br /&gt;
&lt;br /&gt;
OP_CHECKSIG is used directly without first hashing the public key.&lt;br /&gt;
This was used by early versions of Bitcoin where people paid directly to IP addresses, before Bitcoin addresses were introduced.&lt;br /&gt;
scriptPubKeys of this transaction form are still recognized as payments to user by Bitcoin Core.&lt;br /&gt;
The disadvantage of this transaction form is that the whole public key needs to be known in advance, implying longer payment addresses, and that it provides less protection in the event of a break in the ECDSA signature algorithm.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: &amp;lt;pubKey&amp;gt; OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Checking process:&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; OP_CHECKSIG&lt;br /&gt;
|scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_CHECKSIG&lt;br /&gt;
|Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Provably Unspendable/Prunable Outputs ===&lt;br /&gt;
&lt;br /&gt;
The standard way to mark a transaction as provably unspendable is with a scriptPubKey of the following form:&lt;br /&gt;
&lt;br /&gt;
  scriptPubKey: OP_RETURN {zero or more ops}&lt;br /&gt;
&lt;br /&gt;
OP_RETURN immediately marks the script as invalid, guaranteeing that no scriptSig exists that could possibly spend that output. Thus the output can be immediately pruned from the [[UTXO|UTXO set]] even if it has not been spent. [http://blockexplorer.com/tx/eb31ca1a4cbd97c2770983164d7560d2d03276ae1aee26f12d7c2c6424252f29 eb31ca1a4cbd97c2770983164d7560d2d03276ae1aee26f12d7c2c6424252f29] is an example: it has a single output of zero value, thus giving the full 0.125BTC fee to the miner who mined the transaction without adding an entry to the UTXO set. You can also use OP_RETURN to add data to a transaction without the data ever appearing in the UTXO set, as seen in 1a2e22a717d626fc5db363582007c46924ae6b28319f07cb1b907776bd8293fc; [[P2Pool]] does this with the share chain hash txout in the coinbase of blocks it creates.&lt;br /&gt;
&lt;br /&gt;
=== Freezing funds until a time in the future ===&lt;br /&gt;
&lt;br /&gt;
Using OP_CHECKLOCKTIMEVERIFY it is possible to make funds provably unspendable until a certain point in the future.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: &amp;lt;expiry time&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
 scriptSig: &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
| &amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt; OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| scriptSig and scriptPubKey are combined.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt;&lt;br /&gt;
| OP_CHECKLOCKTIMEVERIFY OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Constants are added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;expiry time&amp;gt;&lt;br /&gt;
| OP_DROP OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is checked against the current time or block height.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_DUP OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is removed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
| OP_HASH160 &amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG &lt;br /&gt;
| Top stack item is duplicated.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt;&lt;br /&gt;
|&amp;lt;pubKeyHash&amp;gt; OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Top stack item is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt; &amp;lt;pubHashA&amp;gt; &amp;lt;pubKeyHash&amp;gt;&lt;br /&gt;
|OP_EQUALVERIFY OP_CHECKSIG&lt;br /&gt;
| Constant added.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;sig&amp;gt; &amp;lt;pubKey&amp;gt;&lt;br /&gt;
|OP_CHECKSIG&lt;br /&gt;
| Equality is checked between the top two stack items.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|Signature is checked for top two stack items.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== Transaction puzzle ===&lt;br /&gt;
&lt;br /&gt;
Transaction a4bfa8ab6435ae5f25dae9d89e4eb67dfa94283ca751f393c1ddc5a837bbc31b is an interesting puzzle.&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_HASH256 6fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d6190000000000 OP_EQUAL&lt;br /&gt;
 scriptSig: &amp;lt;data&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To spend the transaction you need to come up with some data such that hashing the data twice results in the given hash.&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot; &lt;br /&gt;
|-&lt;br /&gt;
! Stack &lt;br /&gt;
! Script &lt;br /&gt;
! Description &lt;br /&gt;
|-&lt;br /&gt;
|Empty.&lt;br /&gt;
|&amp;lt;data&amp;gt; OP_HASH256 &amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data&amp;gt;&lt;br /&gt;
|OP_HASH256 &amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|scriptSig added to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data_hash&amp;gt;&lt;br /&gt;
|&amp;lt;given_hash&amp;gt; OP_EQUAL&lt;br /&gt;
|The data is hashed.&lt;br /&gt;
|-&lt;br /&gt;
|&amp;lt;data_hash&amp;gt; &amp;lt;given_hash&amp;gt;&lt;br /&gt;
|OP_EQUAL&lt;br /&gt;
|The given hash is pushed to the stack.&lt;br /&gt;
|-&lt;br /&gt;
|true&lt;br /&gt;
|Empty.&lt;br /&gt;
|The hashes are compared, leaving true on the stack.&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
This transaction was successfully spent by 09f691b2263260e71f363d1db51ff3100d285956a40cc0e4f8c8c2c4a80559b1. The required data happened to be the [[Genesis block]], and the given hash in the script was the genesis block header hashed twice with SHA-256. Note that while transactions like this are fun, they are not secure, because they do not contain any signatures and thus any transaction attempting to spend them can be replaced with a different transaction sending the funds somewhere else.&lt;br /&gt;
&lt;br /&gt;
=== Incentivized finding of hash collisions ===&lt;br /&gt;
&lt;br /&gt;
In 2013 Peter Todd created scripts that result in true if a hash collision is found. Bitcoin addresses resulting from these scripts can have money sent to them. If someone finds a hash collision they can spend the bitcoins on that address, so this setup acts as an incentive for somebody to do so.&lt;br /&gt;
&lt;br /&gt;
For example the SHA1 script:&lt;br /&gt;
&lt;br /&gt;
 scriptPubKey: OP_2DUP OP_EQUAL OP_NOT OP_VERIFY OP_SHA1 OP_SWAP OP_SHA1 OP_EQUAL&lt;br /&gt;
 scriptSig: &amp;lt;preimage1&amp;gt; &amp;lt;preimage2&amp;gt;&lt;br /&gt;
&lt;br /&gt;
See the bitcointalk thread &amp;lt;ref&amp;gt;[https://bitcointalk.org/index.php?topic=293382.0 bitcointalk forum thread on the hash collision bounties]&amp;lt;/ref&amp;gt; and reddit thread&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/1mavh9/trustless_bitcoin_bounty_for_sha1_sha256_etc/&amp;lt;/ref&amp;gt; for more details.&lt;br /&gt;
&lt;br /&gt;
In February 2017 the SHA1 bounty worth 2.48 bitcoins was claimed.&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Transactions]]&lt;br /&gt;
* [[Contracts]]&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
*[https://bitcoin.sipa.be/miniscript] - Miniscript: a language for writing (a subset of) Bitcoin Scripts in a structured way, enabling analysis, composition, generic signing and more.&lt;br /&gt;
*[https://github.com/siminchen/bitcoinIDE Bitcoin IDE] – Bitcoin Script for dummies&lt;br /&gt;
*[https://webbtc.com/script Bitcoin Debug Script Execution] – web tool which executes a script opcode-by-opcode&lt;br /&gt;
*[http://www.crmarsh.com/script-playground/ Script Playground] — convert Script to JavaScript&lt;br /&gt;
*[https://bitauth.com/ide BitAuth IDE] — an Integrated Development Environment for Bitcoin Authentication&lt;br /&gt;
&amp;lt;sup&amp;gt;(cf. &amp;quot;[http://bitcoin.stackexchange.com/q/42576/4334 Online Bitcoin Script simulator or debugger?]&amp;quot;)&amp;lt;/sup&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Vocabulary]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=NSequence&amp;diff=68608</id>
		<title>NSequence</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=NSequence&amp;diff=68608"/>
		<updated>2021-04-15T08:20:31Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Correcting link&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Transaction#General_format_.28inside_a_block.29_of_each_input_of_a_transaction_-_Txin]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=NSequence&amp;diff=68607</id>
		<title>NSequence</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=NSequence&amp;diff=68607"/>
		<updated>2021-04-15T08:19:56Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Redirecting to the transaction format section that mentions the sequence no&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[#General_format_.28inside_a_block.29_of_each_input_of_a_transaction_-_Txin]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67875</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67875"/>
		<updated>2020-06-06T19:29:48Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding see also section linking to the list of storage methods.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;tl;dr&#039;&#039;&#039; The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). Ideally the wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;metal seed phrase backup&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they are genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.&lt;br /&gt;
&lt;br /&gt;
These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. &lt;br /&gt;
&lt;br /&gt;
Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
A user might have a &#039;&#039;spending account&#039;&#039; hot wallet for day-to-day convenient spending with the majority of their funds on a &#039;&#039;savings account&#039;&#039; which is stored with much more security (cold storage / hardware wallet / multisignature).&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is a quote of waxwing on reddit&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor. Furthermore, there are a variety of ways in which 2FA can be compromised, in particular SMS-based 2FA, such as via a SIM-Swap.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Physical&amp;quot; Bitcoins === &lt;br /&gt;
&lt;br /&gt;
Physical Coins and other mechanism with a pre-manufactured key or seed are not a good way to store bitcoins because they keys are already potentially compromised by whoever created the key. You should not consider bitcoin yours if its stored on a key created by someone else. It only becomes yours when you transfer the bitcoin to a key that you own and exclusively control.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are multiple ways that can be utilized to beat this attack: by hiding, by defending yourself, by not letting others know your Bitcoin wealth or holdings, or by implementing security procedures which would prevent you from being able to surrender funds in such an attack, thereby reducing the appeal for an attacker to perform such an attack in the first place.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
&lt;br /&gt;
* [[Links to Storage Methods]]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
* [[Backup and Storage Methods]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Wallets| ]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67541</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67541"/>
		<updated>2020-05-27T18:46:18Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: casa keys&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial teaches users to deal with raw private keys and write them down on paper. [[Deterministic wallet]]s 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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== SmartCustody&#039;s Simple Self-Custody Cold Storage ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md github.com/BlockchainCommons/SmartCustodyWhitePapers]&lt;br /&gt;
&lt;br /&gt;
This guide show how to store coins in a cold storage situation with the ability for heirs to recover your funds if you die. The guide is a bit hard to read with many optional steps, and the &amp;quot;basic scenario&amp;quot; uses 2 hardware wallets with the same seed for some reason. It recommends putting information in a safe deposit box that is enough to steal funds, so you&#039;re putting a lot of trust in the safe deposit box. There are Alternate scenarios, but they don&#039;t make themselves very clear.&lt;br /&gt;
&lt;br /&gt;
===Yeticold ===&lt;br /&gt;
&lt;br /&gt;
https://yeticold.com/&lt;br /&gt;
&lt;br /&gt;
This website helps you set up an ubuntu machine that you then can run a utility from to create a wallet. It can create hot, warm, or cold wallets. The project is still in Beta and has limited information on how it works.&lt;br /&gt;
&lt;br /&gt;
=== Casa Keys ===&lt;br /&gt;
&lt;br /&gt;
[Casa Keys](https://docs.keys.casa/wealth-security-protocol/) is a multisig wallet system that uses a mobile wallet, hardware wallet, and remote key.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Schnorr&amp;diff=67516</id>
		<title>Schnorr</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Schnorr&amp;diff=67516"/>
		<updated>2020-05-25T19:17:41Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Some details about the advantages of schnorr.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Bitcoin currently uses the [[ECDSA]] algorithm to generate cryptographic signatures for a given message and [[secp256k1]] keypair. Schnorr is an alternative algorithm with several advantages. One key advantage is that when multiple keys are used to sign the same message with Schnorr, the resulting signatures can be combined into a single signature. This can be used to significantly reduce the size of multisig payments and other multisig related transactions, for example lightning channel transactions.&lt;br /&gt;
&lt;br /&gt;
The main reason that Bitcoin did not originally use Schnorr signatures is that Schnorr was not standardized, and was not available in common crypto libraries.&lt;br /&gt;
&lt;br /&gt;
==Technical details==&lt;br /&gt;
&lt;br /&gt;
Schnorr signatures are a proposed future extension that give a new way to generate signatures (R,s) on a hash h.&lt;br /&gt;
&lt;br /&gt;
Given a hash value h, hash function f(), private key x, group generator G, and public key P=xG, we can generate a Schnorr signature on h as follows:&lt;br /&gt;
&lt;br /&gt;
Choose a random nonce k. Let R=Gk, and let s = k - f(h . R . P)x. The Schnorr signature is the pair (R, s). Note that R is a public key, so would require 33 bytes to represent (32 bytes + 1 bit indicating &amp;quot;even&amp;quot; vs &amp;quot;odd&amp;quot;).&lt;br /&gt;
&lt;br /&gt;
To check the validity of a signature (R, s) against a public key P, do the following:&lt;br /&gt;
&lt;br /&gt;
Note that sG = (k- f(h . R . P)x)G = kG - f(h . R . P)xG = R - f(h . R . P)P. So we simply compare sG + f(h . R . P)P to R to check the signature.&lt;br /&gt;
&lt;br /&gt;
An advantage of this method is that, if parties cooperate, we can generate a single signature that validates two or more separate transactions.&lt;br /&gt;
&lt;br /&gt;
Choose h1, h2, x1, x2, G, P1=Gx1, P2=Gx2. Each party chooses a nonce yielding k1 and k2, and publicly shares R1=Gk1, R2=Gk2.&lt;br /&gt;
&lt;br /&gt;
Let R = R1+R2. Each signer generates an s, s1 = k1 - f(h . R . P)x1, s2 = k2 - f(h . R . P)x2. The signature (R, s) where s = s1 + s2 proves both transactions are signed.&lt;br /&gt;
&lt;br /&gt;
Note that sG = (s1 + s2)G = s1G + s2G = (k1 - f(h . R . P)x1)G + (k2 - f(h . R . P)x2)G = k1G - f(h . R . P)x1G + k2G - f(h . R . P)x2G = R1 + R2 - f(h . R . P)(P1 + P2) = R - f(h . R . P)(P1 + P2)&lt;br /&gt;
&lt;br /&gt;
To verify, check that sG +f(h . R . P)(P1+P2) is R.&lt;br /&gt;
&lt;br /&gt;
This can be easily generalized from 2 to N.&lt;br /&gt;
&lt;br /&gt;
==See also==&lt;br /&gt;
[https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki Draft Schnorr specification for future use in Bitcoin]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67515</id>
		<title>Atomic multipath payments</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67515"/>
		<updated>2020-05-25T19:12:39Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: adding info about MPP and stage-three AMP&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Atomic Multipath Payments&#039;&#039;&#039; (&#039;&#039;&#039;AMP&#039;&#039;&#039;) are payments that use multiple paths to complete a transaction that either all complete successfully or none complete successfully. &lt;br /&gt;
&lt;br /&gt;
One of the problems the lightning network has had is limited ability to send higher-value payments, because of limitations in channel capacity along possible routes to the payee. Using AMP, a payer can send a payment using many paths, which can make larger payments far more reliable.&lt;br /&gt;
&lt;br /&gt;
== Roadmap ==&lt;br /&gt;
&lt;br /&gt;
AMP is not yet available yet on any lightning implementation, but non-atomic multipath payments (MPP) have recently been implemented by LND in v0.10.0. MPP is the first stage in a three-stage process for AMP. The second stage is hash-based AMP, and the third step is a better form of AMP that uses points and scalars instead of hashes. The third stage requires [[Eltoo]] and [[Schnorr]].&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67514</id>
		<title>Atomic multipath payments</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67514"/>
		<updated>2020-05-25T19:04:26Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Atomic Multpath Payments&#039;&#039;&#039; (&#039;&#039;&#039;AMP&#039;&#039;&#039;) are payments that use multiple paths to complete a transaction that either all complete successfully or none complete successfully. &lt;br /&gt;
&lt;br /&gt;
One of the problems the lightning network has had is limited ability to send higher-value payments, because of limitations in channel capacity along possible routes to the payee. Using AMP, a payer can send a payment using many paths, which can make larger payments far more reliable.&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Atomic_multi-path_payments&amp;diff=67513</id>
		<title>Atomic multi-path payments</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Atomic_multi-path_payments&amp;diff=67513"/>
		<updated>2020-05-25T19:04:08Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Redirected page to Atomic multipath payments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Atomic multipath payments]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=AMP&amp;diff=67512</id>
		<title>AMP</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=AMP&amp;diff=67512"/>
		<updated>2020-05-25T19:03:53Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Redirected page to Atomic multipath payments&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Atomic multipath payments]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67511</id>
		<title>Atomic multipath payments</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Atomic_multipath_payments&amp;diff=67511"/>
		<updated>2020-05-25T19:03:33Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: stub&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;Atomic Multpath Payments&#039;&#039; (&#039;&#039;AMP&#039;&#039;) are payments that use multiple paths to complete a transaction that either all complete successfully or none complete successfully. &lt;br /&gt;
&lt;br /&gt;
One of the problems the lightning network has had is limited ability to send higher-value payments, because of limitations in channel capacity along possible routes to the payee. Using AMP, a payer can send a payment using many paths, which can make larger payments far more reliable.&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Links_to_Storage_Methods&amp;diff=67503</id>
		<title>Talk:Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Links_to_Storage_Methods&amp;diff=67503"/>
		<updated>2020-05-24T08:24:45Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
==Name of this page==&lt;br /&gt;
This page doesn&#039;t actually have much content about backup and storage methods (compare with [[Storing bitcoins]]). Perhaps it should be renamed to something like &amp;quot;links to storing bitcoin guides&amp;quot; or &amp;quot;external links to storing bitcoin tutorials&amp;quot;. [[User:Belcher|Belcher]] ([[User talk:Belcher|talk]]) 16:34, 27 November 2019 (UTC)&lt;br /&gt;
: I think &amp;quot;Links to Storage Methods&amp;quot; isn&#039;t very accurate. This doesn&#039;t just list links. It evaluates and discusses published methods for storing bitcoin. I think this should be renamed to maybe something like &amp;quot;Discussion of Published Storage Methods&amp;quot; or something like that. [[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 08:24, 24 May 2020 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67502</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67502"/>
		<updated>2020-05-24T08:21:50Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* https://yeticold.com/ Yeticold */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial teaches users to deal with raw private keys and write them down on paper. [[Deterministic wallet]]s 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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== SmartCustody&#039;s Simple Self-Custody Cold Storage ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md github.com/BlockchainCommons/SmartCustodyWhitePapers]&lt;br /&gt;
&lt;br /&gt;
This guide show how to store coins in a cold storage situation with the ability for heirs to recover your funds if you die. The guide is a bit hard to read with many optional steps, and the &amp;quot;basic scenario&amp;quot; uses 2 hardware wallets with the same seed for some reason. It recommends putting information in a safe deposit box that is enough to steal funds, so you&#039;re putting a lot of trust in the safe deposit box. There are Alternate scenarios, but they don&#039;t make themselves very clear.&lt;br /&gt;
&lt;br /&gt;
===Yeticold ===&lt;br /&gt;
&lt;br /&gt;
https://yeticold.com/&lt;br /&gt;
&lt;br /&gt;
This website helps you set up an ubuntu machine that you then can run a utility from to create a wallet. It can create hot, warm, or cold wallets. The project is still in Beta and has limited information on how it works.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67501</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67501"/>
		<updated>2020-05-24T08:21:37Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Cold Storage Methods */ Adding Yeticold&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial teaches users to deal with raw private keys and write them down on paper. [[Deterministic wallet]]s 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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== SmartCustody&#039;s Simple Self-Custody Cold Storage ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md github.com/BlockchainCommons/SmartCustodyWhitePapers]&lt;br /&gt;
&lt;br /&gt;
This guide show how to store coins in a cold storage situation with the ability for heirs to recover your funds if you die. The guide is a bit hard to read with many optional steps, and the &amp;quot;basic scenario&amp;quot; uses 2 hardware wallets with the same seed for some reason. It recommends putting information in a safe deposit box that is enough to steal funds, so you&#039;re putting a lot of trust in the safe deposit box. There are Alternate scenarios, but they don&#039;t make themselves very clear.&lt;br /&gt;
&lt;br /&gt;
=== https://yeticold.com/ Yeticold ===&lt;br /&gt;
&lt;br /&gt;
https://yeticold.com/&lt;br /&gt;
&lt;br /&gt;
This website helps you set up an ubuntu machine that you then can run a utility from to create a wallet. It can create hot, warm, or cold wallets. The project is still in Beta and has limited information on how it works.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67087</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67087"/>
		<updated>2019-12-05T07:31:26Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* SmartCustody&amp;#039;s Simple Self-Custody Cold Storage */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== SmartCustody&#039;s Simple Self-Custody Cold Storage ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md github.com/BlockchainCommons/SmartCustodyWhitePapers]&lt;br /&gt;
&lt;br /&gt;
This guide show how to store coins in a cold storage situation with the ability for heirs to recover your funds if you die. The guide is a bit hard to read with many optional steps, and the &amp;quot;basic scenario&amp;quot; uses 2 hardware wallets with the same seed for some reason. The information it recommends putting in a safe deposit box is enough to steal funds, so you&#039;re putting a lot of trust in the safe deposit box. There are Alternate scenarios, but they don&#039;t make themselves very clear.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67086</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67086"/>
		<updated>2019-12-05T06:58:14Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding SmartCustody&amp;#039;s cold storage guide&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== SmartCustody&#039;s Simple Self-Custody Cold Storage ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md github.com/BlockchainCommons/SmartCustodyWhitePapers]&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Storing_bitcoins&amp;diff=67085</id>
		<title>Talk:Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Storing_bitcoins&amp;diff=67085"/>
		<updated>2019-12-05T06:48:28Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Created page with &amp;quot;== Verifying that something looks/is genuine ==  @Belcher, you edited the text to say &amp;quot;you wouldn&amp;#039;t accept [banknotes or gold coins] without inspecting them and verifying that...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Verifying that something looks/is genuine ==&lt;br /&gt;
&lt;br /&gt;
@Belcher, you edited the text to say &amp;quot;you wouldn&#039;t accept [banknotes or gold coins] without inspecting them and verifying that they are genuine&amp;quot;. However, most people would in fact accept banknotes without verifying that they are genuine. Often its simply infeasible to verify things like that. How do you verify a banknote is genuine and not a copy? If its a perfect copy, its impossible. If you think this nuance is important, maybe we can find a more accurate way to say it. But even with bitcoin, you can only verify it looks genuine from a number of angles. Verifying it is genuine for certain is not strictly possible. [[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 06:48, 5 December 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67053</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67053"/>
		<updated>2019-11-25T07:21:45Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Storage Method Components */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
** https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
** https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
** https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67052</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67052"/>
		<updated>2019-11-25T07:21:29Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding Storage method components, wasabi wallet&amp;#039;s &amp;quot;cold wasabi&amp;quot; guide, and a section on storage method components, including Pamela Morgan&amp;#039;s guides to bitcoin inheritance planning&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
=== Cold Wasabi ===&lt;br /&gt;
&lt;br /&gt;
https://docs.wasabiwallet.io/using-wasabi/ColdWasabi.html&lt;br /&gt;
&lt;br /&gt;
This is a pretty basic guide that focuses on using the Wasabi wallet to mix your coins before sending them to a hardware wallet. There is supplementary information about how to setup a hardware wallet and backup your seed, but this doesn&#039;t make for a complete or easy-to-use guide. It is open source, and so might be somewhat vetted.&lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== Storage Method Components ==&lt;br /&gt;
&lt;br /&gt;
The items in this section are methods that do not outline a complete backup or storage mechanism, and thus must be combined with other techniques in order to create a security backup or storage mechanism. &lt;br /&gt;
&lt;br /&gt;
* A small paper on bitcoin storage best practices - [https://github.com/devrandom/btc-papers/blob/master/storage-best-practices.md github.com/devrandom/../storage-best-practices.md]&lt;br /&gt;
* Pamela Morgan&#039;s guides to bitcoin inheritance planning - [https://medium.com/@pamelawjd medium.com/@pamelawjd]&lt;br /&gt;
  * https://medium.com/@pamelawjd/inheritance-planning-for-cryptocurrencies-3-steps-in-3-minutes-83ebb3e916a2&lt;br /&gt;
  * https://www.youtube.com/watch?v=ddwWNWg8YSQ&amp;amp;feature=youtu.be&lt;br /&gt;
  * https://empoweredlaw.com/&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Cold_storage&amp;diff=67051</id>
		<title>Cold storage</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Cold_storage&amp;diff=67051"/>
		<updated>2019-11-25T07:21:13Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Moving information about specific published cold storage guides to Backup And Storage Methods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Cold storage&#039;&#039;&#039; in the context of Bitcoin refers to [[Storing bitcoins|storing Bitcoins]] offline and spending without the [[private key]]s 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.&lt;br /&gt;
&lt;br /&gt;
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 &#039;&#039;cold storage&#039;&#039;, 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.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
See [[Backup and Storage Methods#Cold Storage Methods]] for a review of published cold storage methods.&lt;br /&gt;
&lt;br /&gt;
== Conceptual How-to ==&lt;br /&gt;
# 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].&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# 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.&lt;br /&gt;
# For spending have the watch-only wallet create an [[transaction]] without the signatures which makes it valid.&lt;br /&gt;
# Transfer the unsigned transaction to the offline computer and use the wallet software to sign the transaction.&lt;br /&gt;
# 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 [[confirmation]]s.&lt;br /&gt;
&lt;br /&gt;
== Setting up a secure offline computer ==&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;ref&amp;gt;https://twitter.com/peterktodd/status/1078350142644731904&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/a8m031/proof_of_keys_proof_of_trust_bitcoin_independence/ecdz47t/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Wallet software ==&lt;br /&gt;
&lt;br /&gt;
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 [[Full node#Why should you use a full node wallet|privacy, security and validation benefits]].&lt;br /&gt;
&lt;br /&gt;
== Transferring data between offline and online ==&lt;br /&gt;
&lt;br /&gt;
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:&lt;br /&gt;
&lt;br /&gt;
=== USB flash drive ===&lt;br /&gt;
&lt;br /&gt;
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 [https://en.wikipedia.org/wiki/Stuxnet Stuxnet] and [https://en.wikipedia.org/wiki/2008_cyberattack_on_United_States 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.&lt;br /&gt;
&lt;br /&gt;
The [https://en.wikipedia.org/wiki/SecureDrop SecureDrop] platform for securely leaking documents to journalists also uses USB drives for secure communication.&lt;br /&gt;
&lt;br /&gt;
=== QR codes ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
=== Transcribing by hand ===&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== Private key backup storage ==&lt;br /&gt;
&lt;br /&gt;
This article only recommends using [[seed phrase]]s (possibly with [[Seed phrase#Two-Factor Seed Phrases|encryption]]) to store private key backups. Seed phrases written into metal or on paper support [[Deterministic wallet|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.&lt;br /&gt;
&lt;br /&gt;
Other methods are discussed here for completeness.&lt;br /&gt;
&lt;br /&gt;
Raw [[private keys]] written on a piece of paper:&lt;br /&gt;
* Anyone who can see it, can steal it.&lt;br /&gt;
* Handwriting can be hard to read or completely illegible, especially when mixing upper and lower-case letters.&lt;br /&gt;
* Human error in transcription can cause errors on end product, many private key formats can fail even if a single letter is transcribed incorrectly.&lt;br /&gt;
* Paper can rot, be torn, burn, or be smoke damaged.&lt;br /&gt;
* Doesn&#039;t support [[Deterministic wallet|deterministic wallets]], only a single keypair is stored.&lt;br /&gt;
 &lt;br /&gt;
Printed on a piece of paper:&lt;br /&gt;
* Anyone who can see it, can steal it&lt;br /&gt;
* Non-laser printer ink can run if paper gets wet&lt;br /&gt;
* The printer itself is a security risk - some have internet connections, wifi, and disk memory.&lt;br /&gt;
* Paper can rot, be torn, burn, or be smoke damaged&lt;br /&gt;
&lt;br /&gt;
On laminated paper:&lt;br /&gt;
* Anyone who can see it, can steal it&lt;br /&gt;
* 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&lt;br /&gt;
* Can burn or be smoke damaged&lt;br /&gt;
* &#039;Fireproof&#039; &amp;amp; &#039;Fire-resistant&#039; 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.&lt;br /&gt;
* Remember people can just carry out a small safe.&lt;br /&gt;
&lt;br /&gt;
Engraved / etched/ ablated / stamped on a piece of metal:&lt;br /&gt;
* Anyone who can see it, can steal it&lt;br /&gt;
* 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.&lt;br /&gt;
* Metals can still deform or melt from heat, destroying any engraved SK. &amp;quot;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.&amp;quot;&lt;br /&gt;
* You want to pick a metal that won&#039;t be destroyed by a fire. So magnesium, tin, and lead are all out as engraving materials.&lt;br /&gt;
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. &lt;br /&gt;
&lt;br /&gt;
Stored digitally on a computer:&lt;br /&gt;
* Computers can crash, making data recovery expensive&lt;br /&gt;
* 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.&lt;br /&gt;
* Can burn or be smoke damaged&lt;br /&gt;
* A traditional hard disc drive can have data corrupted by powerful magnetic fields and can physically shatter&lt;br /&gt;
* A non-negligible amount of HDDs suffer from factory defects that will cause them to fail unexpectedly during their lifetime&lt;br /&gt;
* Accidents can happen that could result in loss of data&lt;br /&gt;
* 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&lt;br /&gt;
* If connected to internet it is another attack vector and the safety is only as good as the encryption used; I don&#039;t know what I would recommend but it wouldn&#039;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.&lt;br /&gt;
* There are a lot of ongoing threats with computers, from 0-day exploits to firmware exploits and malicious USB cords&lt;br /&gt;
* External hdds are good for storage for a few years at least if stored properly&lt;br /&gt;
* 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?&lt;br /&gt;
&lt;br /&gt;
Stored digitally on CD, floppy disk, laserdisc, or mini-disc&lt;br /&gt;
* 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.&lt;br /&gt;
* Can burn or be smoke damaged&lt;br /&gt;
* Can be physically damaged, making data recovery expensive or even impossible&lt;br /&gt;
* Magnetic media (tapes, floppy disc) can be damaged by magnets&lt;br /&gt;
* Data can become difficult to recover if the software and/or hardware to decode is old, don&#039;t use proprietary formats&lt;br /&gt;
&lt;br /&gt;
Stored digitally on a flash drive&lt;br /&gt;
* Can break and have to be physically repaired before use&lt;br /&gt;
* Rapidly changing magnetic fields (See MRIs) can damage the data stored on flash drives&lt;br /&gt;
* Can burn or be smoke damaged&lt;br /&gt;
* Can become corroded from salt water or some atmospheric conditions&lt;br /&gt;
* If they break apart, some lighting conditions can cause data corruption (you can also put them back together and often still get the data)&lt;br /&gt;
* 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&#039;t using these for anything but storage.&lt;br /&gt;
* There are some fake flash drives that look like they saved the data but you can&#039;t get it back later&lt;br /&gt;
* Flash drives are not advised for long term storage; they can be used as one part of a multi-medium-location-format plan.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Comparison between [[multisignature]] and cold storage for security ==&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
== See also ==&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
* [[BitKey]]&lt;br /&gt;
* [[How to set up a secure offline savings wallet]]&lt;br /&gt;
* [https://maxtaco.github.io/bitcoin/2014/01/16/how-jason-bourne-stores-his-bitcoin/ How Jason Bourne Stores His Bitcoins]&lt;br /&gt;
* [http://codinginmysleep.com/bitcoin-cold-storage-in-plain-english Bitcoin Cold Storage In Plain English] by David Perry&lt;br /&gt;
* [http://www.offlineaddress.com/?site=about#security-risk Security of private key] offlineaddress.com&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
[[Category:Introduction]]&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67050</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67050"/>
		<updated>2019-11-25T07:20:38Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Bad wallet ideas */ adding &amp;quot;physical&amp;quot; bitcoins&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]]. See [[Backup and Storage Methods]] for a review of published storage methods that give instructions for how to store a wallet.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.&lt;br /&gt;
&lt;br /&gt;
These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. &lt;br /&gt;
&lt;br /&gt;
Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is a quote of waxwing on reddit&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
=== &amp;quot;Physical&amp;quot; Bitcoins === &lt;br /&gt;
&lt;br /&gt;
Physical Coins and other mechanism with a pre-manufactured key or seed are not a good way to store bitcoins because they keys are already potentially compromised by whoever created the key. You should not consider bitcoin yours if its stored on a key created by someone else. It only becomes yours when you transfer the bitcoin to a key that you own.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67049</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67049"/>
		<updated>2019-11-25T06:56:23Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Other Storage Methods */ rm paper wallets which had no content&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67048</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67048"/>
		<updated>2019-11-25T06:55:56Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding link to Backup and Storage Methods&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]]. See [[Backup and Storage Methods]] for a review of published storage methods that give instructions for how to store a wallet.&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.&lt;br /&gt;
&lt;br /&gt;
These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. &lt;br /&gt;
&lt;br /&gt;
Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is a quote of waxwing on reddit&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67047</id>
		<title>Links to Storage Methods</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Links_to_Storage_Methods&amp;diff=67047"/>
		<updated>2019-11-25T06:55:13Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Creating this page with content moved from Cold storage as well as adding a couple additional published methods from Alexandr Nellson and Bitgoldwallet&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page reviews published methods for backing up and storing bitcoin wallets. &lt;br /&gt;
&lt;br /&gt;
== Cold Storage Methods ==&lt;br /&gt;
&lt;br /&gt;
=== Glacier protocol ===&lt;br /&gt;
&lt;br /&gt;
https://glacierprotocol.org/&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
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&#039;s privacy and makes them trust the website for verifying the rules of bitcoin.&lt;br /&gt;
&lt;br /&gt;
=== [[Electrum]]&#039;s cold storage guide ===&lt;br /&gt;
&lt;br /&gt;
https://electrum.readthedocs.io/en/latest/coldstorage.html&lt;br /&gt;
&lt;br /&gt;
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.&lt;br /&gt;
&lt;br /&gt;
The tutorial does not aim to discuss anything about creating a secure offline computer.&lt;br /&gt;
&lt;br /&gt;
=== Rusty Russell&#039;s &amp;quot;Remarkably Unreliable Guide To Bitcoin Storage&amp;quot; ===&lt;br /&gt;
&lt;br /&gt;
https://github.com/rustyrussell/bitcoin-storage-guide&lt;br /&gt;
&lt;br /&gt;
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&#039;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. &lt;br /&gt;
&lt;br /&gt;
However, it recommends naively splitting keys (without using a secure key-splitting algorithm like [[Shamir&#039;s secret sharing|Shamir&#039;s secret sharing algorithm]]), and so is insecure and certainly not well vetted.&lt;br /&gt;
&lt;br /&gt;
=== Alexandr Nellson&#039;s Scheme ===&lt;br /&gt;
&lt;br /&gt;
[https://medium.com/@nellsonx/how-to-properly-store-bitcoins-and-other-cryptocurrencies-14e0db1910d medium.com/@nellsonx/how-to-properly-store-bitcoins]&lt;br /&gt;
&lt;br /&gt;
This method is relatively basic, glossing over important steps like how to properly airgap a machine, how to create and handle a strong passphrase, and how to back up your seed. It uses usb drives to boot the machine and transfer transaction information, which is a significant attack vector. It also isn&#039;t open source and is definitely not well vetted. &lt;br /&gt;
&lt;br /&gt;
== Other Storage Methods == &lt;br /&gt;
&lt;br /&gt;
=== Bitgoldwallet&#039;s Storage Methods ===&lt;br /&gt;
&lt;br /&gt;
https://www.bitgoldwallet.com/how-to-store-bitcoin.html&lt;br /&gt;
&lt;br /&gt;
This site has a number of different storage methods of both the hot and cold variety. The methods are detailed and complex, and somewhat hard to read. It seems to have some odd recommendations, like using password protected PDF files and Zorin OS. &#039;&#039;More review required.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
=== Paper Wallets ===&lt;br /&gt;
&lt;br /&gt;
Paper wallet&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67045</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67045"/>
		<updated>2019-11-25T04:37:09Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* &amp;quot;Isn&amp;#039;t it just like keeping your money in a bank?&amp;quot; */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.&lt;br /&gt;
&lt;br /&gt;
These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. &lt;br /&gt;
&lt;br /&gt;
Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;The following is a quote of waxwing on reddit&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;:&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67044</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67044"/>
		<updated>2019-11-25T04:35:16Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Multisignature wallets */ Clarifying wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key. Such a wallet can be used for requiring agreement among multiple people to spend, can eliminate a single point of failure, and can be used as form of backup, among other applications.&lt;br /&gt;
&lt;br /&gt;
These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. &lt;br /&gt;
&lt;br /&gt;
Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67043</id>
		<title>Multi-signature</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67043"/>
		<updated>2019-11-25T04:34:39Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding sections with more details on each major type of application&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multisignature (multisig) refers to requiring multiple keys to authorize a Bitcoin [[transaction]], rather than a single signature from one key. It has a number of applications.&lt;br /&gt;
&lt;br /&gt;
* Dividing up responsibility for possession of bitcoins among multiple people.&lt;br /&gt;
* Avoiding a single-point of failure, making it substantially more difficult for the wallet to be compromised.&lt;br /&gt;
* M-of-N backup where loss of a single seed doesn&#039;t lead to loss of the wallet.&lt;br /&gt;
&lt;br /&gt;
== Use as a joint account ==&lt;br /&gt;
&lt;br /&gt;
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.&lt;br /&gt;
&lt;br /&gt;
== Use for increasing security ==&lt;br /&gt;
&lt;br /&gt;
The private keys needed to spend from a wallet can be spread across multiple machines, eliminating any one of those machines as a single point of failure, with the rationale that malware and hackers are unlikely to infect all of them. The higher the number of keys required to spend the funds (ie the higher M is in M-of-N), the more difficult it would be for an attacker to successfully steal your funds, however the more cumbersome actually using that wallet becomes. &lt;br /&gt;
&lt;br /&gt;
The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise of any one key cannot result in theft.&lt;br /&gt;
&lt;br /&gt;
This can be used in conjunction with hardware wallets. By requiring that keys from multiple hardware wallets sign transactions, it can vastly reduce the likelihood that a malicious party that handled your hardware wallet could steal your funds, because in order for it to do that, the malicious party would have to compromise multiple hardware wallets. If each hardware wallet you use in a multisig wallet is made by a different company, it would be incredibly difficult for them to secretly conspire on an attack.&lt;br /&gt;
&lt;br /&gt;
== Use as a backup ==&lt;br /&gt;
&lt;br /&gt;
Storing multiple keys to an M-of-N wallet in different locations can serve as a backup. For example, in a 2-of-3 multisig wallet, the loss of one key does not result in loss of the wallet, since the other two keys can be used to recover the funds. The redundancy of the backup is the difference N minus M, so for example a 3-of-5 multisig wallet (with no additional seed backups) has a redundancy of 2, meaning that the loss of any 2 keys can still be recovered from.&lt;br /&gt;
&lt;br /&gt;
== Multisignature Application Examples ==&lt;br /&gt;
&lt;br /&gt;
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Husband and wife savings account — both signatures are required to spend the funds, preventing one spouse from spending the money without the approval of the other&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)&lt;br /&gt;
&lt;br /&gt;
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project&#039;s address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Buyer-seller with trustless escrow - buyer commits money into a 2-of-3 address with the seller and a third-party arbitrator. If transaction goes smoothly, then both buyer and seller sign the transaction to forward the money to the seller. If something goes wrong, they can sign a transaction to refund the buyer. If they cannot agree, they both appeal to the third-party who will arbitrate and provide a second signature to the party that it deems deserves it. The arbitrator cannot steal the money as they have only one key.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: A board of three directors maintaining funds for their organization — those funds cannot be spent unless any two of those directors agrees. Bigger multi-signature transactions are possible for bigger organizations, such as 3-of-5, 5-of-9, etc.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Improved [[hot wallet]] security for businesses - A bitcoin business such as an exchange holds one private key online and one private key as paper backup. A separate bitcoin security firm holds the third key online and will only sign transactions after checking certain conditions (blacklists, whitelists, not more than X withdrawn per time period, two-factor authentication, comply with regulatory environment, etc). If the bitcoin business or the security firm&#039;s hot wallets individually get hacked, the bitcoins cannot be stolen. If the bitcoin security firm disappears the business can use the paper backup to access coins.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Decentralized [[cold storage]] vault - One of the keys is held in your own home, the second in a bank safe deposit box and copies of the third key are distributed to a close friend, a relative and stored in the office. The home vault is not vulnerable to raiding or burglary because spending the money requires a visit to either the friend, bank or office. Losing the safe deposit box also doesn&#039;t result in loss.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].&lt;br /&gt;
&lt;br /&gt;
* 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More [https://bitcoin.stackexchange.com/questions/89589/is-it-possible-to-do-a-3-of-5-or-1-multi-sig-for-backup-purposes/89590?noredirect=1#comment102505_89590 complex] multisig wallets can be created if desired.&lt;br /&gt;
&lt;br /&gt;
See also: [[Storing_bitcoins#Multisignature_wallets]]&lt;br /&gt;
&lt;br /&gt;
==History of Multisignature==&lt;br /&gt;
&lt;br /&gt;
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use &amp;quot;hard&amp;quot; &amp;quot;multisignature&amp;quot; security today.]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multisignature Wallets==&lt;br /&gt;
&lt;br /&gt;
A number of wallets have implemented multisig:&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* [[Armory]]&lt;br /&gt;
* [[CarbonWallet]]&lt;br /&gt;
* [[Copay]]&lt;br /&gt;
* [[Bitgo]]&lt;br /&gt;
* [[Blocktrail]]&lt;br /&gt;
* [[GreenAddress]]&lt;br /&gt;
* [https://keys.casa Casa]&lt;br /&gt;
* [[Electrum]] - [http://docs.electrum.org/en/latest/multisig.html See tutorial].&lt;br /&gt;
* [[Xapo]]&lt;br /&gt;
* [[Coinkite]]&lt;br /&gt;
* Coinb.in - (&#039;&#039;See the warnings about [[Javascript cryptography]]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
===Creating a Multisignature Address with Bitcoin-Qt===&lt;br /&gt;
&lt;br /&gt;
A 2of3 multisig address can be created by following these steps:&amp;lt;ref&amp;gt;https://bitcoin.stackexchange.com/a/10593/4334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Gather (or generate) 3 bitcoin addresses, on whichever machines will be participating, using getnewaddress or getaccountaddress RPC commands (or copy and paste from the GUI).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Get their public keys using the &amp;lt;tt&amp;gt;validateaddress&amp;lt;/tt&amp;gt; [[API_reference_%28JSON-RPC%29|RPC]] command 3 times.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then create a 2-of-3 multisig address using addmultisigaddress; e.g.&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;bitcoind addmultisigaddress 2 &#039;[&amp;quot;044322868cb17d64dcc22185ae2d4493111d73244c3668f8ac79ecc79c0ba8d30a6756d0fa20157 709af3281cc721c7f53321a8cabda29b77900b7e4fe0174b114&amp;quot;,&amp;quot;..second pubkey..&amp;quot;,&amp;quot;..third pubkey..&amp;quot;]&#039;&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;tt&amp;gt;addmultisigaddress&amp;lt;/tt&amp;gt; returns the multisignature address. Be a little careful, the public keys are raw hexadecimal and don&#039;t contain checksums like bitcoin addresses do. You can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that&#039;s been updated to recognize multisig addresses).&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=82213.msg906833#msg906833&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gavin Andresen has an example of using multisig with bitcoin-qt [[Raw Transactions]]: https://gist.github.com/gavinandresen/3966071&lt;br /&gt;
&lt;br /&gt;
== Notable examples in practice ==&lt;br /&gt;
&lt;br /&gt;
* The cold storage wallet of the [[Bitfinex]] exchange is a single 3-of-6 multisig address &amp;lt;code&amp;gt;3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r&amp;lt;/code&amp;gt; which as of December 2017 contains &#039;&#039;&#039;141 177 btc&#039;&#039;&#039; ($1.5 billion). Presumably the keys are kept very safe by Bitfinex&#039;s operators. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]&lt;br /&gt;
* [https://bitcointalk.org/index.php?topic=507297.msg5594085 Discussion of multi-sig on Bitcoin talk]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67042</id>
		<title>Multi-signature</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67042"/>
		<updated>2019-11-25T04:07:02Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Adding a fuller list of types of uses at the top. Removing coinbase since it no longer supports creation of multisig &amp;quot;vaults&amp;quot;. Merging the multisig wallets and implementation sections&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multisignature (multisig) refers to requiring multiple keys to authorize a Bitcoin [[transaction]], rather than a single signature from one key. It has a number of applications, including:&lt;br /&gt;
&lt;br /&gt;
* Dividing up responsibility for possession of bitcoins among multiple people.&lt;br /&gt;
* Avoiding a single-point of failure, making it substantially more difficult for the wallet to be compromised.&lt;br /&gt;
* M-of-N backup where loss of a single seed doesn&#039;t lead to loss of the wallet.&lt;br /&gt;
&lt;br /&gt;
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.&lt;br /&gt;
&lt;br /&gt;
== Multisignature Applications ==&lt;br /&gt;
&lt;br /&gt;
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Husband and wife savings account — both signatures are required to spend the funds, preventing one spouse from spending the money without the approval of the other&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)&lt;br /&gt;
&lt;br /&gt;
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project&#039;s address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Buyer-seller with trustless escrow - buyer commits money into a 2-of-3 address with the seller and a third-party arbitrator. If transaction goes smoothly, then both buyer and seller sign the transaction to forward the money to the seller. If something goes wrong, they can sign a transaction to refund the buyer. If they cannot agree, they both appeal to the third-party who will arbitrate and provide a second signature to the party that it deems deserves it. The arbitrator cannot steal the money as they have only one key.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: A board of three directors maintaining funds for their organization — those funds cannot be spent unless any two of those directors agrees. Bigger multi-signature transactions are possible for bigger organizations, such as 3-of-5, 5-of-9, etc.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Improved [[hot wallet]] security for businesses - A bitcoin business such as an exchange holds one private key online and one private key as paper backup. A separate bitcoin security firm holds the third key online and will only sign transactions after checking certain conditions (blacklists, whitelists, not more than X withdrawn per time period, two-factor authentication, comply with regulatory environment, etc). If the bitcoin business or the security firm&#039;s hot wallets individually get hacked, the bitcoins cannot be stolen. If the bitcoin security firm disappears the business can use the paper backup to access coins.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Decentralized [[cold storage]] vault - One of the keys is held in your own home, the second in a bank safe deposit box and copies of the third key are distributed to a close friend, a relative and stored in the office. The home vault is not vulnerable to raiding or burglary because spending the money requires a visit to either the friend, bank or office. Losing the safe deposit box also doesn&#039;t result in loss.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].&lt;br /&gt;
&lt;br /&gt;
* 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More [https://bitcoin.stackexchange.com/questions/89589/is-it-possible-to-do-a-3-of-5-or-1-multi-sig-for-backup-purposes/89590?noredirect=1#comment102505_89590 complex] multisig wallets can be created if desired.&lt;br /&gt;
&lt;br /&gt;
See also: [[Storing_bitcoins#Multisignature_wallets]]&lt;br /&gt;
&lt;br /&gt;
==History of Multisignature==&lt;br /&gt;
&lt;br /&gt;
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use &amp;quot;hard&amp;quot; &amp;quot;multisignature&amp;quot; security today.]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multisignature Wallets==&lt;br /&gt;
&lt;br /&gt;
A number of wallets have implemented multisig:&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/&amp;lt;/ref&amp;gt; &lt;br /&gt;
&lt;br /&gt;
* [[Armory]]&lt;br /&gt;
* [[CarbonWallet]]&lt;br /&gt;
* [[Copay]]&lt;br /&gt;
* [[Bitgo]]&lt;br /&gt;
* [[Blocktrail]]&lt;br /&gt;
* [[GreenAddress]]&lt;br /&gt;
* [https://keys.casa Casa]&lt;br /&gt;
* [[Electrum]] - [http://docs.electrum.org/en/latest/multisig.html See tutorial].&lt;br /&gt;
* [[Xapo]]&lt;br /&gt;
* [[Coinkite]]&lt;br /&gt;
* Coinb.in - (&#039;&#039;See the warnings about [[Javascript cryptography]]&#039;&#039;)&lt;br /&gt;
&lt;br /&gt;
===Creating a Multisignature Address with Bitcoin-Qt===&lt;br /&gt;
&lt;br /&gt;
A 2of3 multisig address can be created by following these steps:&amp;lt;ref&amp;gt;https://bitcoin.stackexchange.com/a/10593/4334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Gather (or generate) 3 bitcoin addresses, on whichever machines will be participating, using getnewaddress or getaccountaddress RPC commands (or copy and paste from the GUI).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Get their public keys using the &amp;lt;tt&amp;gt;validateaddress&amp;lt;/tt&amp;gt; [[API_reference_%28JSON-RPC%29|RPC]] command 3 times.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then create a 2-of-3 multisig address using addmultisigaddress; e.g.&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;bitcoind addmultisigaddress 2 &#039;[&amp;quot;044322868cb17d64dcc22185ae2d4493111d73244c3668f8ac79ecc79c0ba8d30a6756d0fa20157 709af3281cc721c7f53321a8cabda29b77900b7e4fe0174b114&amp;quot;,&amp;quot;..second pubkey..&amp;quot;,&amp;quot;..third pubkey..&amp;quot;]&#039;&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;tt&amp;gt;addmultisigaddress&amp;lt;/tt&amp;gt; returns the multisignature address. Be a little careful, the public keys are raw hexadecimal and don&#039;t contain checksums like bitcoin addresses do. You can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that&#039;s been updated to recognize multisig addresses).&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=82213.msg906833#msg906833&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gavin Andresen has an example of using multisig with bitcoin-qt [[Raw Transactions]]: https://gist.github.com/gavinandresen/3966071&lt;br /&gt;
&lt;br /&gt;
== Notable examples in practice ==&lt;br /&gt;
&lt;br /&gt;
* The cold storage wallet of the [[Bitfinex]] exchange is a single 3-of-6 multisig address &amp;lt;code&amp;gt;3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r&amp;lt;/code&amp;gt; which as of December 2017 contains &#039;&#039;&#039;141 177 btc&#039;&#039;&#039; ($1.5 billion). Presumably the keys are kept very safe by Bitfinex&#039;s operators. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]&lt;br /&gt;
* [https://bitcointalk.org/index.php?topic=507297.msg5594085 Discussion of multi-sig on Bitcoin talk]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67041</id>
		<title>Multi-signature</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=67041"/>
		<updated>2019-11-25T03:44:24Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Shamir&amp;#039;s secret sharing is not at all multi-sig. Removing it and its dead-link reference.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multisignature (multisig) refers to requiring more than one key to authorize a Bitcoin [[transaction]]. It is generally used to divide up responsibility for possession of bitcoins.&lt;br /&gt;
&lt;br /&gt;
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.&lt;br /&gt;
&lt;br /&gt;
Consider the following scenario:&amp;lt;blockquote&amp;gt;Suppose I am working with a company that wants to accept Bitcoin for international trades.&lt;br /&gt;
&lt;br /&gt;
The company, for security reasons, would not want a single one of its employees to have access to the company BTC wallet&#039;s password. Any transaction would have to meet the approval of more than one employee.&lt;br /&gt;
&lt;br /&gt;
Is this possible already? If not, how could it be implemented with public-key cryptography?&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=507297.msg5594085&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementations==&lt;br /&gt;
Specific to Bitcoin, [[GreenAddress|GreenAddress.it]], for example, has 2-of-2 and 2-of-3 accounts (requiring at least two keys to authorize a transaction). [[Electrum]] allows a multisig wallet made of any combination of m-of-n. [[Coinbase (business)|Coinbase]] also offers 2-of-3 and 3-of-5 multisig, which they call [https://support.coinbase.com/customer/portal/articles/1743782-what-is-the-multisig-vault- Vault]. [[Blocktrail]] offers 2-of-3 multisig.&lt;br /&gt;
&lt;br /&gt;
This javascript page can create and spend from multisig addresses: https://coinb.in/ But see the warnings about [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
See also the [[Electrum]] tutorial: http://docs.electrum.org/en/latest/multisig.html&lt;br /&gt;
&lt;br /&gt;
== Multisignature Applications ==&lt;br /&gt;
&lt;br /&gt;
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Husband and wife savings account — both signatures are required to spend the funds, preventing one spouse from spending the money without the approval of the other&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)&lt;br /&gt;
&lt;br /&gt;
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project&#039;s address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Buyer-seller with trustless escrow - buyer commits money into a 2-of-3 address with the seller and a third-party arbitrator. If transaction goes smoothly, then both buyer and seller sign the transaction to forward the money to the seller. If something goes wrong, they can sign a transaction to refund the buyer. If they cannot agree, they both appeal to the third-party who will arbitrate and provide a second signature to the party that it deems deserves it. The arbitrator cannot steal the money as they have only one key.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: A board of three directors maintaining funds for their organization — those funds cannot be spent unless any two of those directors agrees. Bigger multi-signature transactions are possible for bigger organizations, such as 3-of-5, 5-of-9, etc.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Improved [[hot wallet]] security for businesses - A bitcoin business such as an exchange holds one private key online and one private key as paper backup. A separate bitcoin security firm holds the third key online and will only sign transactions after checking certain conditions (blacklists, whitelists, not more than X withdrawn per time period, two-factor authentication, comply with regulatory environment, etc). If the bitcoin business or the security firm&#039;s hot wallets individually get hacked, the bitcoins cannot be stolen. If the bitcoin security firm disappears the business can use the paper backup to access coins.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Decentralized [[cold storage]] vault - One of the keys is held in your own home, the second in a bank safe deposit box and copies of the third key are distributed to a close friend, a relative and stored in the office. The home vault is not vulnerable to raiding or burglary because spending the money requires a visit to either the friend, bank or office. Losing the safe deposit box also doesn&#039;t result in loss.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].&lt;br /&gt;
&lt;br /&gt;
* 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More [https://bitcoin.stackexchange.com/questions/89589/is-it-possible-to-do-a-3-of-5-or-1-multi-sig-for-backup-purposes/89590?noredirect=1#comment102505_89590 complex] multisig wallets can be created if desired.&lt;br /&gt;
&lt;br /&gt;
See also: [[Storing_bitcoins#Multisignature_wallets]]&lt;br /&gt;
&lt;br /&gt;
==History of Multisignature==&lt;br /&gt;
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use &amp;quot;hard&amp;quot; &amp;quot;multisignature&amp;quot; security today.]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multisignature Wallets==&lt;br /&gt;
&lt;br /&gt;
A number of companies have developed multisig wallets:&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/&amp;lt;/ref&amp;gt; &lt;br /&gt;
* [[Armory]]&lt;br /&gt;
* [[CarbonWallet]]&lt;br /&gt;
* [[Copay]]&lt;br /&gt;
* [[Bitgo]]&lt;br /&gt;
* [[Blocktrail]]&lt;br /&gt;
* [[GreenAddress]]&lt;br /&gt;
* [https://keys.casa Casa]&lt;br /&gt;
* [[Coinbase]]&lt;br /&gt;
* [[Electrum]]&lt;br /&gt;
* [[Xapo]]&lt;br /&gt;
* [[Coinkite]]&lt;br /&gt;
&lt;br /&gt;
===Creating a Multisignature Address with Bitcoin-Qt===&lt;br /&gt;
A 2of3 multisig address can be created by following these steps:&amp;lt;ref&amp;gt;https://bitcoin.stackexchange.com/a/10593/4334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Gather (or generate) 3 bitcoin addresses, on whichever machines will be participating, using getnewaddress or getaccountaddress RPC commands (or copy and paste from the GUI).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Get their public keys using the &amp;lt;tt&amp;gt;validateaddress&amp;lt;/tt&amp;gt; [[API_reference_%28JSON-RPC%29|RPC]] command 3 times.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then create a 2-of-3 multisig address using addmultisigaddress; e.g.&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;bitcoind addmultisigaddress 2 &#039;[&amp;quot;044322868cb17d64dcc22185ae2d4493111d73244c3668f8ac79ecc79c0ba8d30a6756d0fa20157 709af3281cc721c7f53321a8cabda29b77900b7e4fe0174b114&amp;quot;,&amp;quot;..second pubkey..&amp;quot;,&amp;quot;..third pubkey..&amp;quot;]&#039;&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;tt&amp;gt;addmultisigaddress&amp;lt;/tt&amp;gt; returns the multisignature address. Be a little careful, the public keys are raw hexadecimal and don&#039;t contain checksums like bitcoin addresses do. You can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that&#039;s been updated to recognize multisig addresses).&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=82213.msg906833#msg906833&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gavin Andresen has an example of using multisig with bitcoin-qt [[Raw Transactions]]: https://gist.github.com/gavinandresen/3966071&lt;br /&gt;
&lt;br /&gt;
== Notable examples in practice ==&lt;br /&gt;
&lt;br /&gt;
* The cold storage wallet of the [[Bitfinex]] exchange is a single 3-of-6 multisig address &amp;lt;code&amp;gt;3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r&amp;lt;/code&amp;gt; which as of December 2017 contains &#039;&#039;&#039;141 177 btc&#039;&#039;&#039; ($1.5 billion). Presumably the keys are kept very safe by Bitfinex&#039;s operators. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67040</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67040"/>
		<updated>2019-11-25T03:41:50Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Multisignature wallets */ Removing note about paper backups, because the fact that multi-sig wallets can be backed up is irrelevant to the use of multisig. Other minor improvements. Removing incomplete information best left to the main article.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop, and smartphone, any two of which are required to move the money, but the compromise or total loss of any one key does not result in loss of money, even if that key has no backups.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, and can be nearly as convenient since all keys are online and the wallet user interfaces are typically easy to use. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67039</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67039"/>
		<updated>2019-11-25T03:32:24Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Types of wallets */ Moving main-article links to the section tops, as is standard on wikipedia&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Multisignature]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Cold storage]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Main article: [[Hot wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67038</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67038"/>
		<updated>2019-11-25T03:21:23Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Hardware wallets */ rewording to be a bit more specific and clear&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] holds the seed in its internal storage and is typically designed to be resistant to both physical and digital attacks. The device signs the transactions internally and only transmits the signed transactions to the computer, never communicating any secret data to the devices it connects to. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are one of the best ways to store bitcoins.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which give away that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still, physical access to a hardware wallet does not mean that the keys are easily compromised, even though it does make it easier to compromise the hardware wallet. The groups that have created the most popular hardware wallets have gone to great lengths to harden the devices to physical threats and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s consent. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67037</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67037"/>
		<updated>2019-11-25T02:57:53Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Discussion of wallet solutions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Types of wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67036</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67036"/>
		<updated>2019-11-25T00:26:30Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Protection from accidental loss */ Moving most content about storing the seed from this section to Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term as a more canonical location. Also adding information about redundancy in backups.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, corrupted SSD devices, or numerous other slip ups. &lt;br /&gt;
&lt;br /&gt;
The key to protecting yourself from data loss of any kind is to have redundant backups so that if one is lost or destroyed, you still have others you can use when you need them. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet as a backup, so that if your primary wallet is lost or damaged, you can use the seed recovery phrase to restore access to your coins. If you have more than one backup location, they should be in places where various disasters won&#039;t affect both of your backups. For example, its much better to store two backups in a home safe and in a safe deposit box (as long as your seed is protected by a passphrase) than to store two backups in your bedroom and one in your garage. &lt;br /&gt;
&lt;br /&gt;
Also important is regularly verifying that your backup still exists and is in good condition. This can be as simple as ensuring your backups are still where you put them a couple times a year.&lt;br /&gt;
&lt;br /&gt;
The best practices for backing up a seed is to store the seed using &#039;&#039;&#039;pencil and paper&#039;&#039;&#039; or &#039;&#039;&#039;stamped metal&#039;&#039;&#039; and storing in multiple secure locations. See [[Seed_phrase#Storing_Seed_Phrases_for_the_Long_Term]] for details.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Discussion of wallet solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Seed_phrase&amp;diff=67035</id>
		<title>Seed phrase</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Seed_phrase&amp;diff=67035"/>
		<updated>2019-11-25T00:26:27Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Storing Seed Phrases for the Long Term */ Moving some content here from Storing bitcoins, some organization&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;seed phrase&#039;&#039;&#039;, &#039;&#039;&#039;seed recovery phrase&#039;&#039;&#039; or &#039;&#039;&#039;backup seed phrase&#039;&#039;&#039; is a list of words which [[Storing bitcoins|store]] all the information needed to recover a Bitcoin wallet. Wallet software will typically generate a seed phrase and instruct the user to write it down on paper. If the user&#039;s computer breaks or their hard drive becomes corrupted, they can download the same wallet software again and use the paper backup to get their bitcoins back.&lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers the phrase can steal the bitcoins, so it must be kept safe like jewels or cash. For example, it must not be typed into any website.&lt;br /&gt;
&lt;br /&gt;
Seed phrases are an excellent way of backing up and [[storing bitcoins]] and so they are used by almost all well-regarded wallets.&amp;lt;ref&amp;gt;[https://bitcoin.org/en/choose-your-wallet Bitcoin.org: Choose your wallet]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example ==&lt;br /&gt;
&lt;br /&gt;
An example of a seed phrase is:&lt;br /&gt;
&lt;br /&gt;
    witch collapse practice feed shame open despair creek road again ice least&lt;br /&gt;
&lt;br /&gt;
The word order is important.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|none|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
== Explanation ==&lt;br /&gt;
&lt;br /&gt;
A simplified explanation of how seed phrases work is that the wallet software has a list of words taken from a dictionary, with each word assigned to a number. The seed phrase can be converted to a number which is used as the seed integer to a [[Deterministic wallet|deterministic wallet]] that generates all the [[Private key|key pairs]] used in the wallet.&lt;br /&gt;
&lt;br /&gt;
The English-language wordlist for the BIP39 standard has 2048 words, so if the phrase contained only 12 random words, the number of possible combinations would be 2048^12 = 2^132 and the phrase would have 132 bits of security.  However, some of the data in a BIP39 phrase is not random,&amp;lt;ref&amp;gt;[https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#Generating_the_mnemonic BIP39: Generating the mnemonic]&amp;lt;/ref&amp;gt; so the actual security of a 12-word BIP39 seed phrase is only 128 bits.  This is approximately the same strength as all Bitcoin private keys, so most experts consider it to be sufficiently secure.&amp;lt;ref&amp;gt;[https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Security BIP32: Security]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is not safe to invent your own seed phrase because humans are bad at generating randomness.  The best way is to allow the wallet software to generate a phrase which you write down.&lt;br /&gt;
&lt;br /&gt;
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_Lists|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. This compares well with writing down a raw [[private key]] where a single letter being unreadable or incorrect can make the private key useless (depending on the serialization format).&lt;br /&gt;
&lt;br /&gt;
== Two-Factor Seed Phrases ==&lt;br /&gt;
&lt;br /&gt;
Seed phrases, like all backups, can store any amount of bitcoins. It&#039;s a concerning idea to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a password.&lt;br /&gt;
&lt;br /&gt;
The password can be used to create a two-factor seed phrase where both &#039;&#039;&amp;quot;something you have&amp;quot;&#039;&#039; plus &#039;&#039;&amp;quot;something you know&amp;quot;&#039;&#039; is required to unlock the bitcoins.&lt;br /&gt;
&lt;br /&gt;
This works by the wallet creating a seed phrase and asking the user for a password. Then both the seed phrase and extra word are required to recover the wallet. Electrum and some other wallets call the passphrase a &#039;&#039;&#039;&amp;quot;seed extension&amp;quot;&#039;&#039;&#039;, &#039;&#039;&#039;&amp;quot;extension word&amp;quot;&#039;&#039;&#039; or &#039;&#039;&#039;&amp;quot;13th/25th word&amp;quot;&#039;&#039;&#039;. The BIP39 standard defines a way of passphrase-protecting a seed phrase. A similar scheme is also used in the Electrum standard. If a passphrase is not present, an empty string &amp;quot;&amp;quot; is used instead.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: Forgetting this password will result in the bitcoin wallet and any contained money being lost. Do not overestimate your ability to remember passphrases especially when you may not use it very often.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Warning&#039;&#039;&#039;: The seed phrase password should not be confused with the password used to encrypt the wallet file on disk. This is probably why many wallets call it an extension word instead of a password.&lt;br /&gt;
&lt;br /&gt;
== Storing Seed Phrases for the Long Term == &lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives, or corrupted SSD devices. It&#039;s also important to protect the seed from theft. It is best not to get creative with your security, and instead use tried and true methods.&lt;br /&gt;
&lt;br /&gt;
It could be a good idea to write some words of explanation on the same paper as the seed phrase. If storing for the long term you may forget what a phrase is how it should be treated. A sample explanation that can be adapted is:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;These twelve words have control over BITCOINS. Keep this paper safe and secret, like cash or jewelry. The bitcoin information on this paper is encrypted with a passphrase. It is part of a multisignature wallet and was made by Electrum bitcoin wallet software on 1/1/2019.&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Paper and Pencil Backup ====&lt;br /&gt;
&lt;br /&gt;
Through bitter experience it has been found that one of the most practical storage mediums is &#039;&#039;&#039;pencil and paper&#039;&#039;&#039;. The private keys of a bitcoin wallet are encoded into [[seed phrase|random words from a dictionary]] which can be written down. If your hard drive crashes, you can find the paper with the [[seed phrase]] and restore the entire wallet. As [[seed phrase]]s use natural language words, they have good error correction. Words written in bad handwriting can often still be read. If one or two letters are missing the word can often still be deduced. The [[Seed_phrase#Word_Lists|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.&lt;br /&gt;
&lt;br /&gt;
For storing on paper writing with pencil is much better than pen&lt;br /&gt;
&amp;lt;ref&amp;gt;[http://www.joethorn.net/blog/2011/12/07/pencil-does-not-fade Pencil Does Not Fade]&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[https://www.quora.com/How-do-I-maintain-a-paper-notebook-that-can-remain-for-years How do I maintain a paper notebook that can remain for years?]&lt;br /&gt;
&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Paper should be acid-free or archival paper, and stored in the dark avoiding extremes of heat and moisture&lt;br /&gt;
&amp;lt;ref&amp;gt;[https://www.loc.gov/preservation/care/deterioratebrochure.html Essential facts about preservation of Paper]&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[https://www.quora.com/If-I-write-with-a-pencil-on-my-notebook-will-the-writing-last-for-a-long-time-say-50-years-or-will-it-just-fade-away-gradually Writing in a notebook with pencil]&lt;br /&gt;
&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;[http://copar.org/bulletin14.htm CoPAR: Creating records that will last]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
==== Stamped Metal Backup ====&lt;br /&gt;
&lt;br /&gt;
Even better than paper, there are a number of more [https://blog.lopp.net/metal-bitcoin-seed-storage-stress-test--part-ii-/ durable seed storage methods], like stamped metal plates. These are far more durable and can last a lot longer than paper. One of these methods is certainly recommended for anyone storing a significant amount of bitcoin. &lt;br /&gt;
&lt;br /&gt;
==== Methods that are not recommended ====&lt;br /&gt;
&lt;br /&gt;
Some methods that are not recommended are: memorizing ([[Brainwallets]]), storing in a file on a computer (including online), or storing online.&lt;br /&gt;
&lt;br /&gt;
Some people get the idea to split up their phrases, like storing 6 words in one location and the other 6 words in another location. This is a bad idea and should not be done, because if one set of 6 words is discovered then it becomes far easier to bruteforce the rest of the phrase. Storing bitcoins in multiple locations like this should be done via [[multisignature]] wallets instead. Note that [[Shamir&#039;s secret sharing]] algorithm is also theoretically a secure way to store a seed in parts, but that it is currently difficult to find good-quality tools for doing it and there are many pitfalls in implementing it. Also, multi-signature wallets are better in a lot of ways, and most of the benefits Sharmir&#039;s algorithm has over multisig at the moment will disappear once technologies like [[Schnorr|Schnorr signatures]] are released.&lt;br /&gt;
&lt;br /&gt;
Another bad idea is to add random decoy words that are somehow meaningful to you, and later remove them to be left only with the 12 word phrase. The phrase words come from a known dictionary (see next section), so anybody can use that dictionary to weed out the decoy words.&lt;br /&gt;
&lt;br /&gt;
== Word Lists ==&lt;br /&gt;
&lt;br /&gt;
Generally a seed phrase only works with the same wallet software that created it. If storing for a long period of time it&#039;s a good idea to write the name of the wallet too.&lt;br /&gt;
&lt;br /&gt;
The BIP39 English word list has each word being uniquely identified by the first four letters, which can be useful when space to write them is scarce.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bitcoin/bips/blob/master/bip-0039/bip-0039-wordlists.md BIP39 wordlists]&lt;br /&gt;
* [https://github.com/spesmilo/electrum/blob/1.9.8/lib/mnemonic.py Electrum old-style wordlist]&lt;br /&gt;
* [https://github.com/spesmilo/electrum/blob/master/electrum/wordlist/english.txt Electrum new-style wordlist]&lt;br /&gt;
&lt;br /&gt;
== Alternative name &amp;quot;Mnemonic Phrase&amp;quot; ==&lt;br /&gt;
&lt;br /&gt;
Seed phrases are sometimes called &amp;quot;mnemonic phrases&amp;quot; especially in older literature. This is a bad name because the word mnemonic implies that the phrase should be memorized. It is less misleading to call them seed phrases.&lt;br /&gt;
&lt;br /&gt;
== The power of backups ==&lt;br /&gt;
&lt;br /&gt;
An especially interesting aspect in the power of paper backups is allowing your money to be two places at once. At the London Inside Bitcoin conference the keynote speaker showed 25 paper backups they were carrying -- all password-protected. With that one can carry $100,000 which can instantly be moved to a phone or transferred yet with total security. If it&#039;s stolen then there is no risk because it is backed up elsewhere. That is powerful.&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/2hmnru/poll_do_you_use_paper_wallets_why_why_not_what/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki BIP39 mnemonic phrase standard]&lt;br /&gt;
* [[Deterministic wallet]]&lt;br /&gt;
* [[Storing bitcoins]]&lt;br /&gt;
* [[Brainwallet]]&lt;br /&gt;
* [https://github.com/6102bitcoin/FAQ/blob/master/seed.md FAQ regarding bitcoin seeds]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Shamir_Secret_Snakeoil&amp;diff=67034</id>
		<title>Talk:Shamir Secret Snakeoil</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Shamir_Secret_Snakeoil&amp;diff=67034"/>
		<updated>2019-11-25T00:20:20Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Created page with &amp;quot;This article should be cleaned up to remove bias. I understand Greg Maxwell is well respected in terms of his cryptography knowledge, but its clear that this article is writte...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This article should be cleaned up to remove bias. I understand Greg Maxwell is well respected in terms of his cryptography knowledge, but its clear that this article is written in a way that includes many [https://en.wikipedia.org/wiki/Weasel_word weasel words], including in the title itself. Shamir&#039;s secret sharing algorithm is, even by Greg Maxwell&#039;s own admission here, a perfectly valid and secure algorithm. The fact that many programmers have botched the implementation is not an indictment of the algorithm itself. This page should be upgraded to be a bit more professional and unbiased, noting the pitfalls as well as the downsides in comparison to multisig alternatives, but also being clear that it is a secure tool people can use as long as they find well vetted implementations (like anything in cryptography). [[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 00:20, 25 November 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Talk:Javascript_cryptography&amp;diff=67033</id>
		<title>Talk:Javascript cryptography</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Talk:Javascript_cryptography&amp;diff=67033"/>
		<updated>2019-11-24T23:54:35Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: Created page with &amp;quot;I take issue with a lot of this. I think there is no reason that javascript should be seen as a bad language for cryptography. The reasoning here is quite weak. All modern bro...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;I take issue with a lot of this. I think there is no reason that javascript should be seen as a bad language for cryptography. The reasoning here is quite weak. All modern browsers come with secure encryption functions that can and have been used to create secure cryptographic functions and tools using javascript. Also, node.js has an enormous amount of well vetted code, including in the space of cryptography. Its a little bit absurd so say that because some people wrote bad cryptographic functions in javascript, no one should ever use cryptography in javascript. [[User:Fresheneesz|Fresheneesz]] ([[User talk:Fresheneesz|talk]]) 23:54, 24 November 2019 (UTC)&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67032</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67032"/>
		<updated>2019-11-24T23:28:37Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Protection from theft */ password -&amp;gt; passphrase and adding some nuaunces to the text about theft of a seed&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives or corrupted SSD devices. Through bitter experience it was found that one of the most practical storage mediums is &#039;&#039;&#039;pencil and paper&#039;&#039;&#039;. The private keys of a bitcoin wallet are encoded into [[seed phrase|random words from a dictionary]] which can be written down. If your hard drive crashes, you can find the paper with the [[seed phrase]] and restore the entire wallet. Even better than paper, there are a number of more [https://blog.lopp.net/metal-bitcoin-seed-storage-stress-test--part-ii-/ durable seed storage methods], like stamped metal plates. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet. It is a good idea to keep backup copies in several locations.&lt;br /&gt;
&lt;br /&gt;
As [[seed phrase]]s use natural language words, they have good error correction. Words written in bad handwriting can often still be read. If one or two letters are missing the word can often still be deduced. The [[Seed_phrase#Word_Lists|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.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware, so that must be taken into account when deciding on storage solutions. &lt;br /&gt;
&lt;br /&gt;
Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins if the seed isn&#039;t also protected by a secret passphrase. Even when using a passphrase, a seed should be kept safe and secret like jewels or cash. For example, no part of a seed should ever be typed into any website, and no one should store a seed on an internet-connected computer unless they are an advanced user who has researched what they&#039;re doing.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a passphrase. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Discussion of wallet solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67031</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67031"/>
		<updated>2019-11-24T23:17:37Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Verification and privacy */ Removing misleading information about &amp;quot;counterfeit bitcoin&amp;quot;, removing some redundant linking, and fixing some wording&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives or corrupted SSD devices. Through bitter experience it was found that one of the most practical storage mediums is &#039;&#039;&#039;pencil and paper&#039;&#039;&#039;. The private keys of a bitcoin wallet are encoded into [[seed phrase|random words from a dictionary]] which can be written down. If your hard drive crashes, you can find the paper with the [[seed phrase]] and restore the entire wallet. Even better than paper, there are a number of more [https://blog.lopp.net/metal-bitcoin-seed-storage-stress-test--part-ii-/ durable seed storage methods], like stamped metal plates. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet. It is a good idea to keep backup copies in several locations.&lt;br /&gt;
&lt;br /&gt;
As [[seed phrase]]s use natural language words, they have good error correction. Words written in bad handwriting can often still be read. If one or two letters are missing the word can often still be deduced. The [[Seed_phrase#Word_Lists|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.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without inspecting them and verifying that they look genuine. The same is true with bitcoin. Wallet software can automatically verify that a payment has been made and when that payment has been completed (by being mined into a number of blocks). The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. When receiving large volumes, it is essential to use wallet software that connects to a full node you run yourself. If bitcoin is digital gold, then a full node is your own personal digital goldsmith who checks that received bitcoin payments are actually real. [[Lightweight node|Lightweight wallets]] have a number of security downsides because they don&#039;t check all of bitcoin&#039;s rules, and so should only be used for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a full node avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The full node wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, effectively stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware so that must be taken into account when deciding on storage solutions. Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins, so it must be kept safe and secret like jewels or cash. In particular phrases should not be typed into any website.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a password. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Discussion of wallet solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67030</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67030"/>
		<updated>2019-11-24T23:04:10Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Introduction */ Adding image of a seed stamped on metal&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
[[File:Blockplate_2.0.jpg|200px|thumb|alt=Example seed stamped on metal.|Example seed stamped on metal.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives or corrupted SSD devices. Through bitter experience it was found that one of the most practical storage mediums is &#039;&#039;&#039;pencil and paper&#039;&#039;&#039;. The private keys of a bitcoin wallet are encoded into [[seed phrase|random words from a dictionary]] which can be written down. If your hard drive crashes, you can find the paper with the [[seed phrase]] and restore the entire wallet. Even better than paper, there are a number of more [https://blog.lopp.net/metal-bitcoin-seed-storage-stress-test--part-ii-/ durable seed storage methods], like stamped metal plates. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet. It is a good idea to keep backup copies in several locations.&lt;br /&gt;
&lt;br /&gt;
As [[seed phrase]]s use natural language words, they have good error correction. Words written in bad handwriting can often still be read. If one or two letters are missing the word can often still be deduced. The [[Seed_phrase#Word_Lists|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.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without verifying that the banknotes were genuine and that the gold was real. The same is true with bitcoin. Payments must be genuine or else you may be slipped counterfeit bitcoins and be left out of pocket. The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. For receiving large volumes it is essential to use wallet software backed by a [[full node]]. If bitcoin is digital gold, then a [[full node]] is your own personal goldsmith who checks that received bitcoin payments are actually real. Lightweight wallets which don&#039;t check all of bitcoin&#039;s rules are only appropriate for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a [[full node]] avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The [[full node]] wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, effectively stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware so that must be taken into account when deciding on storage solutions. Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins, so it must be kept safe and secret like jewels or cash. In particular phrases should not be typed into any website.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a password. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Discussion of wallet solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=File:Blockplate_2.0.jpg&amp;diff=67029</id>
		<title>File:Blockplate 2.0.jpg</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=File:Blockplate_2.0.jpg&amp;diff=67029"/>
		<updated>2019-11-24T23:02:31Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: A stamped Blockplate.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Summary ==&lt;br /&gt;
A stamped Blockplate.&lt;br /&gt;
== Licensing ==&lt;br /&gt;
{{PD-ineligible}}&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67028</id>
		<title>Storing bitcoins</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Storing_bitcoins&amp;diff=67028"/>
		<updated>2019-11-24T22:55:23Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Protection from accidental loss */ adding mention of more durable seed storage and link to Jameson Lopp&amp;#039;s stress tests&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is a discussion of the different ways of storing bitcoins, whether for [[Bitcoin as an investment|investment purposes]] or as a [[Bitcoin as a medium of exchange|medium of exchange]].&lt;br /&gt;
&lt;br /&gt;
As bitcoin is a digital asset, it can be very un-intuitive to store safely. Historically many people have lost their coins but with proper understanding the risks can be eliminated. If your bitcoins do end up lost or stolen then there&#039;s almost certainly nothing that can be done to get them back.&lt;br /&gt;
&lt;br /&gt;
tl;dr The best way to store bitcoin is to either use a [[hardware wallet]], a [[Multisignature|multisignature wallet]] or a [[Cold storage|cold storage wallet]]. Have your wallet create a [[seed phrase]], write it down on paper and store it in a safe place (or several safe places, as backups). The wallet should be backed by your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Introduction ==&lt;br /&gt;
&lt;br /&gt;
Storage of bitcoin can be broken down in a few independent goals:&lt;br /&gt;
&lt;br /&gt;
* Protection against accidental loss&lt;br /&gt;
* Verification that the bitcoins are genuine&lt;br /&gt;
* Privacy and protection against spying&lt;br /&gt;
* Protection against theft&lt;br /&gt;
* Easy access for spending or moving bitcoins&lt;br /&gt;
&lt;br /&gt;
The art and science of storing bitcoins is about keeping your private keys safe, yet remaining easily available to you when you want to make a transaction. It also requires verifying that you received real bitcoins, and stopping an adversary from spying on you.&lt;br /&gt;
&lt;br /&gt;
[[File:Mnemonic-seed-still-life.jpg|300px|thumb|alt=An example seed phrase written on paper|Example seed phrase on paper.]]&lt;br /&gt;
&lt;br /&gt;
=== Protection from accidental loss ===&lt;br /&gt;
&lt;br /&gt;
In the past many people have accidentally lost bitcoins because of failed backups, mistyped letters, forgotten hard drives or corrupted SSD devices. Through bitter experience it was found that one of the most practical storage mediums is &#039;&#039;&#039;pencil and paper&#039;&#039;&#039;. The private keys of a bitcoin wallet are encoded into [[seed phrase|random words from a dictionary]] which can be written down. If your hard drive crashes, you can find the paper with the [[seed phrase]] and restore the entire wallet. Even better than paper, there are a number of more [https://blog.lopp.net/metal-bitcoin-seed-storage-stress-test--part-ii-/ durable seed storage methods], like stamped metal plates. All good wallet software asks their users to write down the [[seed phrase|seed recovery phrase]] of the wallet. It is a good idea to keep backup copies in several locations.&lt;br /&gt;
&lt;br /&gt;
As [[seed phrase]]s use natural language words, they have good error correction. Words written in bad handwriting can often still be read. If one or two letters are missing the word can often still be deduced. The [[Seed_phrase#Word_Lists|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.&lt;br /&gt;
&lt;br /&gt;
=== Verification and privacy ===&lt;br /&gt;
&lt;br /&gt;
Storing a [[seed phrase]] only stores [[Private key|private keys]], but it cannot tell you if or how many bitcoins you have actually received. For that you need wallet software.&lt;br /&gt;
&lt;br /&gt;
If you received cash banknotes or gold coins as payment, you wouldn&#039;t accept them without verifying that the banknotes were genuine and that the gold was real. The same is true with bitcoin. Payments must be genuine or else you may be slipped counterfeit bitcoins and be left out of pocket. The most secure kind of wallet is one which independently verifies &#039;&#039;all&#039;&#039; the rules of bitcoin, known as a [[full node]]. For receiving large volumes it is essential to use wallet software backed by a [[full node]]. If bitcoin is digital gold, then a [[full node]] is your own personal goldsmith who checks that received bitcoin payments are actually real. Lightweight wallets which don&#039;t check all of bitcoin&#039;s rules are only appropriate for receiving smaller amounts or when you trust the sender. See the article about [[full node|full nodes]].&lt;br /&gt;
&lt;br /&gt;
Your wallet software will also need to learn the history and balance of its wallet. For a lightweight wallet this usually involves querying a third-party server which leads to a privacy problem as that server can spy on you by seeing your entire balance, all your transactions and usually linking it with your IP address. Using a [[full node]] avoids this problem because the software connects directly to the bitcoin p2p network and downloads the entire [[blockchain]], so any adversary will find it much harder to obtain information. See also: [[Anonymity]]&lt;br /&gt;
&lt;br /&gt;
So for verification and privacy, a good storage solution should be backed by a [[full node]] under your own control for use when receiving payments. The [[full node]] wallet on an online computer can be a watch-only wallet. This means that it can detect transaction involving addresses belonging to the user and can display transaction information about them, but still does not have the ability to actually spend the bitcoins.&lt;br /&gt;
&lt;br /&gt;
=== Protection from theft ===&lt;br /&gt;
&lt;br /&gt;
Possession of bitcoins comes from your ability to keep the private keys under your exclusive control. In bitcoin, keys are money. Any malware or hackers who learn what your private keys are can create a valid bitcoin transaction sending your coins to themselves, effectively stealing your bitcoins. The average person&#039;s computer is usually vulnerable to malware so that must be taken into account when deciding on storage solutions. Anybody else who discovers a wallet&#039;s [[seed phrase]] can steal all the bitcoins, so it must be kept safe and secret like jewels or cash. In particular phrases should not be typed into any website.&lt;br /&gt;
&lt;br /&gt;
[[Seed phrase]]s can store any amount of bitcoins. It doesn&#039;t seem secure to possibly have enough money to purchase the entire building just sitting on a sheet of paper without any protection. For this reason many wallets make it possible to encrypt a seed phrase with a password. See [[Seed phrase#Two-Factor_Seed_Phrases]]&lt;br /&gt;
&lt;br /&gt;
=== Easy access ===&lt;br /&gt;
&lt;br /&gt;
Some users may not need to actually move their bitcoins very often, especially if they [[Bitcoin as an investment|own bitcoin as an investment]]. Other users will want to be able to quickly and easily move their coins. A solution for storing bitcoins should take into account how convenient it is to spend from depending on the user&#039;s needs.&lt;br /&gt;
&lt;br /&gt;
=== Summary ===&lt;br /&gt;
&lt;br /&gt;
In summary: bitcoin wallets should be backed up by writing down their [[seed phrase]], this phrase must be kept safe and secret, and when sending or receiving transactions the wallet software should obtain information about the bitcoin network from your own [[full node]].&lt;br /&gt;
&lt;br /&gt;
== Discussion of wallet solutions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware wallets ===&lt;br /&gt;
&lt;br /&gt;
[[Hardware wallet]]s are special purpose security-hardened devices for storing Bitcoins on a peripheral that is trusted to generate wallet keys and sign transactions.&lt;br /&gt;
&lt;br /&gt;
A [[hardware wallet]] typically holds the private keys in its internal storage and is designed to be malware resistant. The device signs the transactions internally and only transmits the signed transactions to the computer. The separation of the private keys from the vulnerable environment allows the user to spend bitcoins without running any risk even when using an untrustworthy computer. Hardware wallets are relatively user-friendly and are a top solution for holding private keys.&lt;br /&gt;
&lt;br /&gt;
Some downsides are that hardware wallets are recognizable physical objects which could be discovered and which prove that you probably own bitcoins. This is worth considering when for example crossing borders. They also cost more than software wallets. Still physical access to a hardware wallet, even though it reduces its security strength, does not mean that the keys are easily compromised. The companies creating them, have gone to great lengths to secure them and, though not impossible, only technically skilled people with specialized equipment have been able to get access to the private keys without the owner&#039;s knowledge. However, physically-powerful people such as armed border guards upon seeing the hardware wallet could force you to type in the PIN number to unlock the device and steal the bitcoins.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hardware wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Multisignature wallets ===&lt;br /&gt;
&lt;br /&gt;
A multisignature wallet is one where multiple private keys are required to move the bitcoins instead of a single key, avoiding a single point of failure. These private keys can be spread across multiple machines in various locations with the rationale that malware and hackers are unlikely to infect all of them. The multisig wallet can be of the m-of-n type where any m private keys out of a possible n are required to move the money. For example a 2-of-3 multisig wallet might have your private keys spread across a desktop, laptop and smartphone; any two are required to move the money but the loss of any one does not result in loss of money especially because they can be restored from paper backup.&lt;br /&gt;
&lt;br /&gt;
Multisignature wallets have the advantage of being cheaper than hardware wallets since they are implemented in software and can be downloaded for free, as well as being convenient as all keys are online and the wallet user interfaces are typically easy to use. Wallet software [[Electrum]] and [[Armory]] can create multisig wallets. Hardware and multisignature wallets can be combined by having a multisignature wallet with the private keys held on hardware wallets; after all a single hardware wallet is still a single point of failure. Cold storage and multisignature can also be combined, by having the multisignature wallet with the private keys held in cold storage to avoid them being kept online.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Multisignature]]&lt;br /&gt;
&lt;br /&gt;
=== Cold storage wallets ===&lt;br /&gt;
&lt;br /&gt;
A cold wallet generates and stores private wallet keys offline on a clean, newly-installed [https://en.wikipedia.org/wiki/Air_gap_(networking) air-gapped] computer. Payments are received online with a watch-only wallet. Unsigned transactions are generated online, transferred offline for signing, and the signed transaction is transferred online to be broadcast to the Bitcoin network.&lt;br /&gt;
&lt;br /&gt;
This allows funds to be managed offline in [[Cold storage]]. Used correctly a cold wallet is protected against online threats, such as viruses and hackers. Cold wallets are similar to hardware wallets, except that a general purpose computing device is used instead of a special purpose peripheral. The downside is that the transferring of transactions to and fro can be fiddly and unweilding, and less practical for carrying around like a hardware wallet.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
=== Hot wallets ===&lt;br /&gt;
&lt;br /&gt;
A hot wallet refers to keeping single-signature wallets with private keys kept on an online computer or mobile phone. Most bitcoin wallet software out there is a hot wallet. The bitcoins are easy to spend but are maximally vulnerable to malware or hackers. Hot wallets may be appropriate for small amounts and day-to-day spending.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Hot wallet]]&lt;br /&gt;
&lt;br /&gt;
== Bad wallet ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Custodial wallets ===&lt;br /&gt;
&lt;br /&gt;
Custodial wallets are where an exchange, broker or other third party holds your bitcoins in trust.&lt;br /&gt;
&lt;br /&gt;
The number one rule to storing bitcoin is this: if you don’t hold the private keys, you don’t actually own the assets. There are many historical examples of loss due to custodial wallets: Bitcoinica, Silk Road, Bitfloor, [[Collapse of Mt. Gox|MTGOX]], Sheep Marketplace, BTC-e, Bitstamp, Bitfinex, Bithumb, Cryptsy, Bter, Mintpal and many more&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=576337&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== &amp;quot;Isn&#039;t it just like keeping your money in a bank?&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
:There are trade offs with everything, but trusting Coinbase with your Bitcoin is &#039;&#039;not&#039;&#039; the same as trusting a bank with your dollars:&lt;br /&gt;
&lt;br /&gt;
:Suppose 5 people are needed to access the funds, within Coinbase, e.g. the CEO, the tech lead engineer and 3 other senior employees. Suppose one day they wake up and decide to be evil and move all the Bitcoin to some private account of theirs, and perhaps make up a story in the press about how they&#039;ve been &amp;quot;hacked&amp;quot;. You have a serious problem, as you might find there is a protracted legal battle (see MtGox), but you can&#039;t actually retrieve the funds unless in some way the company is re-stocked with Bitcoin, or perhaps an equivalent in fiat.&lt;br /&gt;
&lt;br /&gt;
:If on the other hand you controlled the funds with a majority of keys in a multisig i.e. you own both of the two needed keys of a 2-of-3 multisig, then it would always effectively be your bitcoin, even though the third key may belong to a trusted third party custodian. But this also comes with the responsibility that if you get hacked, you lose all your funds. That is why it&#039;s prudent, in a 2-of-3 multisig where you have the two needed keys, to have them in separate systems/locations. If one of them fails, you can go to the custodian to supply the third key and transfer your funds again to safety. But the custodian alone, cannot touch your funds just by virtue of having the third key.&lt;br /&gt;
&lt;br /&gt;
:Now, if your bank gets hacked similarly - 5 key operatives in the bank decide to swipe your money and pretend it was external hackers - SWIFT transfers are made to accounts in Russia and China. Here it will always ultimately be at the discretion of legal agencies whether you &amp;quot;actually&amp;quot; still have the money that is stolen. Because dollars are not real, they can be created at a whim&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Fractional-reserve_banking&amp;lt;/ref&amp;gt;, and while reversing international transfers is not &#039;&#039;quite&#039;&#039; so simple, very often that reversal can be achieved (e.g. recent SWIFT hack at bangladesh&amp;lt;ref&amp;gt;https://www.wired.com/2016/05/insane-81m-bangladesh-bank-heist-heres-know/&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Bangladesh_Bank_robbery&amp;lt;/ref&amp;gt; bank; $1 billion stolen, all but $80 million &amp;quot;recovered&amp;quot; (just means wire transfers reversed)). Added to that consider that fiat money is insured, so even when transfers can&#039;t be reversed, the money can be &amp;quot;recovered&amp;quot;. If too many banks get hacked all at once the Federal Reserve and the government together can make up some &amp;quot;fund&amp;quot; that magically reassigns balances any time they like, with sufficient political will (that&#039;s essentially what was happening in 2008 TARP etc).&lt;br /&gt;
&lt;br /&gt;
:So far no insurance company has ever paid out on a Bitcoin company&#039;s claim. Worth considering also.&lt;br /&gt;
&lt;br /&gt;
:You might say, since it&#039;s risky both ways, why not trust Coinbase? Aren&#039;t they more competent in security than me?&lt;br /&gt;
&lt;br /&gt;
:Almost certainly, but this argument has two massive holes in it: (1) because they &#039;&#039;concentrate&#039;&#039; funds they are a massive target for hackers, while you are not - at all. (2) they are a &#039;&#039;trusted third party&#039;&#039; so the situation is strictly worse - not only do you have to trust their security skills, but you also have to trust them not to steal (modulo multisig, as mentioned above) (edited to add: as well as literal stealing, there is things like political confiscation, don&#039;t forget).&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/5py495/brian_armstrong_controlling_your_own_wealth_as_a/dcve9xx/?context=3&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Web wallets ===&lt;br /&gt;
&lt;br /&gt;
Web wallets have all the downsides of custodial wallets (no direct possession, private keys are held by a third party) along with all the downsides of hot wallets (exposed private keys), as well as all the downsides of lightweight wallets (not verifying bitcoin&#039;s rules, someone could send you a billion bitcoins and under certain conditions the dumb web wallet would happily accept it)&lt;br /&gt;
&lt;br /&gt;
Someone who needs the easy access of a web wallet should download a lightweight wallet like [[Electrum]].&lt;br /&gt;
&lt;br /&gt;
Main article: [[Browser-based wallet]]&lt;br /&gt;
&lt;br /&gt;
=== Paper wallets ===&lt;br /&gt;
&lt;br /&gt;
So-called [[paper wallets]] are an obsolete and unsafe method of storing bitcoin which should not be recommended to beginners. They simply store a single private/public keypair on paper. They promote [[address reuse]] and require unwieldy and complicated live OS system boots to be safe, they risk theft by printers, and typically rely on [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
Paper wallets also do not provide any method of displaying to the user when money has arrived. There&#039;s no practical way to use a [[full node]] wallet. Users are typically driven to use third-party blockchain explorers which can lie to them and spy on them.&lt;br /&gt;
&lt;br /&gt;
A much better way to accomplish what paper wallets do is to use [[seed phrase]]s instead.&lt;br /&gt;
&lt;br /&gt;
Main article: [[Paper wallets]]&lt;br /&gt;
&lt;br /&gt;
=== Cloud storage ===&lt;br /&gt;
&lt;br /&gt;
This means storing your encrypted (or not) wallet file on a cloud storage solution such as Dropbox, or emailing them to yourself on gmail. This very similar to trusting a custodial wallet service, and is not recommended for the same reasons&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/8i6via/28_btc_stolen_10_btc_reward_please_help/&amp;lt;/ref&amp;gt;. You might say you use encryption for two-factor authentication, but uploading the wallet to the cloud reduces this to one-factor.&lt;br /&gt;
&lt;br /&gt;
=== Removable media ===&lt;br /&gt;
&lt;br /&gt;
This refers to storing wallet files on removable media like SSD or hard drives.&lt;br /&gt;
&lt;br /&gt;
Refer to the warnings from these two links:&lt;br /&gt;
&lt;br /&gt;
* https://www.reddit.com/r/Bitcoin/comments/6nj0eb/reminder_beware_of_data_rot_always_make_paper/&lt;br /&gt;
&lt;br /&gt;
* https://tedjonesweb.blogspot.co.uk/2017/08/do-not-use-flash-memory-ssd-drives.html&lt;br /&gt;
&lt;br /&gt;
Those articles recommend using GPG for encryption or a printer, instead a better solution is [[seed phrase]]s.&lt;br /&gt;
&lt;br /&gt;
== Other ideas ==&lt;br /&gt;
&lt;br /&gt;
=== Time-locked wallets ===&lt;br /&gt;
&lt;br /&gt;
An interesting unconventional solution. The idea is to use [[Timelock|time-lock contracts]] to create a wallet which cannot be spent from until a certain date. One possible use-case might be by a gambling addict who locks up money for paying bills for a month, after a month has passed and their time-lock wallet is opened they use that money for paying bills instead of gambling. This is the equivalent proposal towards compulsive shoppers to freeze their credit card in a block of ice, so when they feel the urge to immediately buy something they see on the TV, they will need to wait for the block to melt until they can retrieve the credit card to be able to place the order. This hopefully gives them the time to cool off, and reconsider an otherwise meaningless purchase.&lt;br /&gt;
&lt;br /&gt;
Time lock wallets don&#039;t exist yet except for simple [https://coinb.in/#newTimeLocked javascript pages] which rely on [[Javascript cryptography]] and are therefore not safe.&lt;br /&gt;
&lt;br /&gt;
=== Consulting ===&lt;br /&gt;
&lt;br /&gt;
If you intend to store a very large amount of bitcoins, for example in a business, you should consider paying for security consulting.&lt;br /&gt;
&lt;br /&gt;
== The 5 dollar wrench attack ==&lt;br /&gt;
&lt;br /&gt;
[[File:Security.png|400px|none|alt=xkcd comic on the 5 dollar wrench attack.]]&lt;br /&gt;
&lt;br /&gt;
It&#039;s sometimes said that all this security is worthless because the $5 wrench attack can be used.&lt;br /&gt;
&lt;br /&gt;
There are two ways to beat this attack: by hiding or by defending yourself.&lt;br /&gt;
&lt;br /&gt;
Stored bitcoins are not secured by [[seed phrase]]s, [[hardware wallet]]s, [[multisignature]], passwords, hash functions or anything like that; they are secured by &#039;&#039;people&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
Technology is never the root of system security. Technology is a tool to help people secure what they value. Security requires people to act. A server cannot be secured by a firewall if there is no lock on the door to the server room, and a lock cannot secure the server room without a guard to monitor the door, and a guard cannot secure the door without risk of personal harm.&amp;lt;ref&amp;gt;[https://github.com/libbitcoin/libbitcoin/wiki/Risk-Sharing-Principle Libbitcoin wiki Risk Sharing Principle]&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin is no different. The technology discussed on this page is only a tool to tip the scales in the defender&#039;s favour. Following from this principle, the way to beat the $5 wrench attack is to bear arms. Either your own, or employ guards, or use a safety deposit box, or rely on the police forces and army; or whatever may be appropriate and proportionate in your situation. If someone physically overpowers you then no technology on Earth can save your bitcoins. You can&#039;t be your own bank without bank-level security.&lt;br /&gt;
&lt;br /&gt;
See Also: [https://twitter.com/i/moments/942083114385281024 Guns + Bitcoin Hardware Wallets]&lt;br /&gt;
&lt;br /&gt;
== Further reading ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/BlockchainCommons/SmartCustodyWhitePapers/blob/master/%23SmartCustody-_Simple_Self-Custody_Cold_Storage_Scenario.md SmartCustody: Simple Self-Custody Cold Storage Scenario]&lt;br /&gt;
&lt;br /&gt;
* https://bitzuma.com/posts/a-gentle-introduction-to-bitcoin-cold-storage/&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@lopp/thoughts-on-secure-storage-of-bitcoins-and-other-crypto-assets-210cadabb53d&lt;br /&gt;
&lt;br /&gt;
* https://medium.com/@michaelflaxman/how-should-i-store-my-bitcoin-43874ac208e4&lt;br /&gt;
&lt;br /&gt;
* Two-factor authentication on custodial wallets doesn&#039;t work as well as you might think https://medium.com/@CodyBrown/how-to-lose-8k-worth-of-bitcoin-in-15-minutes-with-verizon-and-coinbase-com-ba75fb8d0bac&lt;br /&gt;
&lt;br /&gt;
* This is why you shouldn’t use texts for two-factor authentication https://www.theverge.com/2017/9/18/16328172/sms-two-factor-authentication-hack-password-bitcoin Hacking 2FA based on SMS is easy.&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Hardware_wallet&amp;diff=66960</id>
		<title>Hardware wallet</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Hardware_wallet&amp;diff=66960"/>
		<updated>2019-10-14T06:10:45Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Commercial hardware wallets (ordered chronologically) */ open source hardware for trezor&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A &#039;&#039;&#039;hardware wallet&#039;&#039;&#039; is a special type of [[wallet|bitcoin wallet]] which stores the user&#039;s private keys in a secure hardware device.&lt;br /&gt;
&lt;br /&gt;
They have major advantages over standard software wallets:&lt;br /&gt;
&lt;br /&gt;
* private keys are often stored in a protected area of a microcontroller, and cannot be transferred out of the device in plaintext&lt;br /&gt;
* immune to computer viruses that steal from software wallets&lt;br /&gt;
* can be used securely and interactively, private keys never need to touch potentially-vulnerable software&lt;br /&gt;
* much of the time, the software is open source, allowing a user to validate the entire operation of the device&lt;br /&gt;
&lt;br /&gt;
This page is an attempt to summarize all the known developments of hardware wallets that can use Bitcoin as part of their operation.&lt;br /&gt;
&lt;br /&gt;
== Security risks ==&lt;br /&gt;
&lt;br /&gt;
To date there have been no verifiable incidents of Bitcoins stolen from hardware wallets. Hardware wallets are relatively new, but at least for the time being they have maintained a good track record, unlike the numerous incidents of Bitcoin theft from Internet-connected computers.&lt;br /&gt;
&lt;br /&gt;
However, it&#039;s important to understand that hardware wallets are a high value target and depend on various assumptions holding true to maintain security. They are not a silver bullet, and there are several realistic ways in which a hardware wallet can fail to protect your Bitcoin. These risks need to be carefully considered when deciding how much trust to place in a hardware wallet, and which hardware wallet to buy.&lt;br /&gt;
&lt;br /&gt;
How a hardware wallet could fail to protect your Bitcoin:&lt;br /&gt;
&lt;br /&gt;
# &#039;&#039;&#039;Malware swaps recipient Bitcoin addresses&#039;&#039;&#039;: a hardware wallet won&#039;t protect you from being tricked into sending Bitcoin to the wrong address. For example, malware on a PC could monitor for high value transactions and then swap out the recipient&#039;s authentic Bitcoin address for an address controlled by the attacker. When the stakes are high, multi factor (e.g., over the phone) confirmation of a recipient&#039;s Bitcoin address is recommended.&lt;br /&gt;
# &#039;&#039;&#039;Insecure RNG ([https://en.wikipedia.org/wiki/Random_number_generation Random Number Generator])&#039;&#039;&#039;: hardware wallets rely on the security of an RNG, often embedded in hardware, to generate your wallet&#039;s private keys securely. Unfortunately, it is notoriously difficult to verify the true randomness of the RNG. An insecure RNG may create wallet keys that can later be recreated by an attacker, by generating psuedo-randomness that would seem statistically indistinguishable from true randomness yet still be predictable to an advanced attacker. An RNG may become insecure as a result of malicious weakening or an unintentional mistake. This failure mode is common to any wallet generation procedure in which the true randomness of the source of entropy being used can not be verified.&lt;br /&gt;
# &#039;&#039;&#039;Imperfect implementation&#039;&#039;&#039;: the security of all computing devices relies on the quality of their implementation. Hardware wallets are no exception. Bugs at the software, firmware or hardware level may allow attackers to break into a hardware wallet and gain unauthorized access to secrets. Even if the design is perfect, proving the security of a hardware or software implementation is a very hard, mostly unsolved problem. To date, no wallet in existence is implemented using provably correct software.&lt;br /&gt;
# &#039;&#039;&#039;Compromised production process&#039;&#039;&#039;: even a perfect software and hardware implementation of a hardware wallet would be vulnerable to a corrupt production process that introduces intentional or unintentional holes into the final product. The introduction of hardware backdoors is a [https://www.wired.com/2016/06/demonically-clever-backdoor-hides-inside-computer-chip/ real concern] for high risk financial and military applications.&lt;br /&gt;
# &#039;&#039;&#039;Compromised shipping process&#039;&#039;&#039;: a compromised fulfillment process may substitute or modify secure devices for superficially identical but insecure replacements. Government programs that intercept hardware and modify them in route to insert backdoors [https://arstechnica.com/.../photos-of-an-nsa-upgrade-factory-show-cisco-router-getting-implant/ are known to exist].&lt;br /&gt;
&lt;br /&gt;
In summary:&lt;br /&gt;
&lt;br /&gt;
* While not a silver bullet hardware wallets can still be extremely useful, assuming you take care to use a good one: an authentic device manufactured by trustworthy, technically competent security experts with a good reputation (e.g., [[TREZOR]]).&lt;br /&gt;
&lt;br /&gt;
* [[Cold storage]] solutions implemented with open source software and general purpose hardware (e.g., [[BitKey]], Pi Wallet), using a verifiable source of entropy such as physical dice may provide superior security for some use cases (e.g., long term savings).&lt;br /&gt;
&lt;br /&gt;
== Connecting to a full node ==&lt;br /&gt;
&lt;br /&gt;
By default, most hardware wallets instruct the user to connect to the manufacturer&#039;s own web interface. The web page cannot steal the user&#039;s private keys but can spy on them or trick them into accept fake payments.&lt;br /&gt;
&lt;br /&gt;
Hardware wallets only keep the [[private keys]] safe and create spending transactions; they cannot tell you if you have actually received coins and in what quantity. Bitcoin&#039;s security model also requires that [[full node]] wallets are used. If not, somebody could pay you with a transaction of something other than bitcoin. If bitcoin is digital gold then a full node wallet is your own personal goldsmith who checks that the incoming payments are actually real. Also the third-party wallet will see all your [[Address|bitcoin addresses]] so this is very damaging to your privacy.&lt;br /&gt;
&lt;br /&gt;
Most hardware wallets can be connected to [[Electrum]] bitcoin wallet. Electrum can be connected to your own [[Electrum#Electrum Personal Server|full node via a server]]. &lt;br /&gt;
&lt;br /&gt;
See also: [[Full node#Why should you use a full node wallet]]&lt;br /&gt;
&lt;br /&gt;
== Commercial hardware wallets (ordered chronologically) ==&lt;br /&gt;
&lt;br /&gt;
=== [[Trezor|Trezor One]] ===&lt;br /&gt;
[[File:Trezor-tx.jpg|300px|thumb|left|Confirming the transaction with Trezor]]&lt;br /&gt;
&lt;br /&gt;
[[Trezor]] is a secure bitcoin storage and a transaction signing tool with open source hardware and software. The private keys are generated by the device and never leave it thus they cannot be accessed by a malware.&lt;br /&gt;
&lt;br /&gt;
It uses a deterministic wallet structure which means it can hold an unlimited number of keys ([[BIP 0032]]/[[BIP 0044]]). A recovery seed is generated when the device is initialized. In case Trezor gets lost or stolen, all its contents can be recovered using this seed (private keys, bitcoin balance and transaction history) into a new device or another [[BIP 0039]]/[[BIP 0044]] compatible wallet. &lt;br /&gt;
&lt;br /&gt;
Trezor also introduced a unique way of PIN entering preventing keyloggers from recording it even when entered on a compromised computer. An encryption passphrase can be set on top of the PIN protection. More passphrases can be used for plausible deniability.&lt;br /&gt;
&lt;br /&gt;
Trezor One offers everything needed to protect cryptocurrency funds together with advanced features like [https://wiki.trezor.io/User_manual:Password_Manager Password manager]  or [https://wiki.trezor.io/User_manual:Two-factor_Authentication_with_U2F U2F two-factor authorization]. &lt;br /&gt;
&lt;br /&gt;
&#039;&#039;See also [[Hardware wallet#Trezor Model T|Trezor Model T - next-generation cryptocurrency hardware wallet]]&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[https://shop.trezor.io Trezor E-shop] | [https://wiki.trezor.io Trezor Wiki] | [https://trezor.io Trezor Homepage]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== KeepKey: Your Private Bitcoin Vault ===&lt;br /&gt;
[[File:keepkey.jpg|300px|thumb|left|KeepKey showing a bitcoin transaction that needs to be manually approved.]]&lt;br /&gt;
&lt;br /&gt;
KeepKey is a USB device that stores and secures your bitcoins. When you entrust KeepKey with your money, each and every bitcoin transaction you make must be reviewed and approved via it&#039;s OLED display and confirmation button.&lt;br /&gt;
&lt;br /&gt;
KeepKey has a unique recovery feature utilizing a rotating cipher to restore private keys with a [[BIP 0039]] recovery seed.  This means it is not necessary to store your private keys on KeepKey: the recovery process is secure enough so that KeepKey can be used as a transaction device for paper backups. &lt;br /&gt;
&lt;br /&gt;
[https://www.keepkey.com keepkey.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Opendime: Bitcoin Credit Stick ===&lt;br /&gt;
&lt;br /&gt;
[[file:Opendime.jpeg|400px|thumb|left|Opendime Package]]&lt;br /&gt;
&lt;br /&gt;
The 1st Bitcoin Bearer Bond or just call it a &amp;quot;Bitcoin Stick&amp;quot; &lt;br /&gt;
&lt;br /&gt;
Opendime is a small USB stick that allows you to spend Bitcoin like a dollar bill. Pass it along multiple times. &lt;br /&gt;
Connect to any USB to check balance. Unseal anytime to spend online. Trust no one.&lt;br /&gt;
&lt;br /&gt;
It comes in the shape of a mini USB, and [[Opendime-ui.png|setting it up is astonishingly quick and simple]]. You plug OpenDime into a USB port, and it behaves just like a USB drive with a tiny amount of storage. In its folder, is a web page. You open the webpage in your browser, and there’s only one instruction to follow: “Drop a file onto the drive”. Once you do that, the OpenDime automagically generates a unique address for you to receive Bitcoin with.&lt;br /&gt;
&lt;br /&gt;
[http://www.opendime.com Opendime.com]&lt;br /&gt;
&lt;br /&gt;
* [https://opendime.com/#faq Opendime FAQ]&lt;br /&gt;
* You can watch a [https://www.youtube.com/watch?v=9UFF9d3Y1BY video here]&lt;br /&gt;
* Read this [https://medium.com/@beautyon_/exquisite-opendime-ad1195a2790e review]&lt;br /&gt;
* Multi-language user interface: 中文 • 日本語 • English • Portuguese • Français • Deutsch • Русский&lt;br /&gt;
* Works as USB drive with no need for software&lt;br /&gt;
* [https://github.com/opendime/electrum Opendime Electrum plugin]&lt;br /&gt;
* [https://github.com/opendime/ Opendime source files and key verification]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Coldcard: Ultra-secure Bitcoin Hardware Wallet ===&lt;br /&gt;
&lt;br /&gt;
[[file:Coldcard.png|524px|thumb|left|Coldcard Front and Back]]&lt;br /&gt;
&lt;br /&gt;
* Coldcard is an easy to use, ultra-secure, open-source and affordable hardware wallet that is easy to back up via an encrypted microSD card. Your private key is stored in a dedicated security chip. MicroPython software design allows you to make changes.&lt;br /&gt;
* BIP39 based, which means you can backup the secret words onto paper, and have lots of sub-accounts and unlimited independent payment addresses. Now with BIP39 passphrase support, unlocking up to 5.9e197 additional wallets from the same seed words! It knows how to understand transactions, so you can see what you are approving.&lt;br /&gt;
* The first &amp;quot;Partially Signed Bitcoin Transaction Format&amp;quot; - PSBT (BIP 174) native wallet which can be used completely offline for its entire lifecycle. See HWI for Bitcoin Core support!&lt;br /&gt;
* True air-gap cold operation via MicroSD sneakernet or standard via USB&lt;br /&gt;
&lt;br /&gt;
[http://www.coldcardwallet.com Coldcardwallet.com]&lt;br /&gt;
&lt;br /&gt;
* [https://coldcardwallet.com/faq Coldcard FAQ]&lt;br /&gt;
* [https://coldcardwallet.com/docs Coldcard Docs]&lt;br /&gt;
* [https://github.com/coldcard/firmware Coldcard Source Code]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== CoolWallet: The Ultimate Bitcoin Safe ===&lt;br /&gt;
&amp;lt;!-- 2016-04-09: Consider removing this device until actually for sale? --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:CoolWallet in the box.jpeg|300px|thumb|left|CoolWallet showing Launch App, waiting for user to connect with smartphone via Bluetooth]]&lt;br /&gt;
&lt;br /&gt;
CoolWallet is a credit card sized Bluetooth device that stores and secures your bitcoins and private keys. It fits in your wallet and works wirelessly.&lt;br /&gt;
&lt;br /&gt;
Every Bitcoin transaction must be manually confirmed and approved through its e-paper display and button. &lt;br /&gt;
&lt;br /&gt;
CoolWallet only acknowledges the paired smartphone. Whoever stole the CoolWallet are not able to steal any bitcoins. Using recovery Seed can restore all your bitcoins in case you lost the device. &lt;br /&gt;
&lt;br /&gt;
[https://coolbitx.com coolbitx.com] | [https://github.com/CoolBitX-Technology/coolwallet-ios Source and specifications]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BlochsTech card: Your user friendly Bitcoin wallet ===&lt;br /&gt;
&amp;lt;!-- 2016-04-09: Possible vaporware / scam?  Website insecure &amp;amp; badly designed with no substantial info.  Consider finding technical docs, real reviews or removing this device. --&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[file:BlochsTech Bitcoin card hardware wallet.jpg|300px|thumb|left|Graphic printed on front of BlochsTech cards.]]&lt;br /&gt;
&lt;br /&gt;
The BlochsTech open Bitcoin card is an open protocol secure hardware Bitcoin wallet your grandmother could use.&lt;br /&gt;
For shops it&#039;s faster to accept than slow QR code based wallets and more reliable as it works offline.&lt;br /&gt;
&lt;br /&gt;
Currently it&#039;s of course in a novelty phase like Casascius coins (of which thousands were sold),&lt;br /&gt;
however in the long run it is fully capable of functionally replacing the VISA system in all nations.&lt;br /&gt;
&lt;br /&gt;
[http://www.BlochsTech.com BlochsTech.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=== BitLox Bitcoin Hardware Wallet ===&lt;br /&gt;
[[file:Bitlox.jpg|300px|thumb|left|BitLox Bitcoin Hardware Wallet]]&lt;br /&gt;
&lt;br /&gt;
BitLox is a metal cased (aluminum or titanium) bitcoin hardware wallet that works with their own web based wallet by USB and apps for iPhone and Android using Bluetooth LE.&lt;br /&gt;
&lt;br /&gt;
At present it is the only bitcoin hardware wallet you can buy that works with iPhone. The device weighs one ounce and is the size of a credit card 4 mm thick.&lt;br /&gt;
 &lt;br /&gt;
Bitlox allows you to set up hidden wallets. Unlike other hardware wallets your seed is never displayed on a connected computer or phone but only on the Bitlox. All your wallet, device and transaction PINs are only entered on the BitLox and never on any app. &lt;br /&gt;
&lt;br /&gt;
BitLox has also implemented several advanced security features not available on any other bitcoin hardware wallet. &lt;br /&gt;
&lt;br /&gt;
[http://www.bitlox.com bitlox.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Digital Bitbox ===&lt;br /&gt;
[[file:Digital-bitbox.png|thumb|left|Digital Bitbox Hardware Wallet]]&lt;br /&gt;
&lt;br /&gt;
* Secure hardware RNG &amp;amp; key storage using [http://www.atmel.com/Images/Atmel-8914-CryptoAuth-ATAES132A-Datasheet.pdf crypto element] with 50 year lifespan and an epoxy-filled case.&lt;br /&gt;
* Offline backup and recovery of [[BIP_0032|BIP-32]] seed with a micro SD card rather than [[BIP_0039|BIP-39]] phrase written on paper as in Trezor.&lt;br /&gt;
* Native software wallet client and ability to use a mobile phone for 2FA and to verify transaction details.&lt;br /&gt;
* Multisig out-of-the-box including Copay support.&lt;br /&gt;
* [https://github.com/digitalbitbox Open Source] ([https://github.com/digitalbitbox/mcu#digital-bitbox-firmware firmware], [https://github.com/digitalbitbox/mcu/blob/bf48984fd4a47d9ebf6814f7d01b078964587c7c/src/bootloader.c bootloader], [https://github.com/digitalbitbox/dbb-app desktop client]).&lt;br /&gt;
* Full FIDO U2F support (https://en.wikipedia.org/wiki/Universal_2nd_Factor)&lt;br /&gt;
* Made in Switzerland (a country with strong privacy laws) by [[Bitcoin Core]] developer Jonas Schnelli.&lt;br /&gt;
&lt;br /&gt;
[https://digitalbitbox.com digitalbitbox.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ledger Nano S - USB Smartcard Hardware Wallet  ===&lt;br /&gt;
[[File:ledger_wallet_nanos_photo.png|300px|thumb|left|Ledger Wallet Nano S]]&lt;br /&gt;
&lt;br /&gt;
Ledger Nano S is a secure Bitcoin hardware wallet. It connects to any computer through USB and embeds a built-in OLED display to double-check and confirm each transaction with a single tap on its buttons. It is architectured around a Secure Element (ST31 family) and built on top of the BOLOS platform, a powerful and flexible Operating System allowing the secure execution of multiple Open Source applications in full isolation.&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* cryptographic secrets protected by a secure chip&lt;br /&gt;
* open source embedded Bitcoin app&lt;br /&gt;
* Confirmation of transactions on the embedded screen&lt;br /&gt;
* Built-in 4 digits PIN security lock&lt;br /&gt;
* Built-in onboarding (seed generation and recovery)&lt;br /&gt;
* BIP39 seed (12/18/24 words), easy backup and restoration&lt;br /&gt;
* Multi-apps support: FIDO U2F, GPG, SSH…&lt;br /&gt;
* USB connectivity&lt;br /&gt;
* Foldable and compact casing&lt;br /&gt;
&lt;br /&gt;
[https://www.ledgerwallet.com/products/12-ledger-nano-s Ledger Nano S product page]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Secalot ===&lt;br /&gt;
[[File:secalot_wallet.png|300px|thumb|left|Secalot]]&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* Software and hardware are fully open sourced.&lt;br /&gt;
* Utilizes a secure microcontroller with a high performance dedicated cryptographic co-processor.&lt;br /&gt;
* Integrates with the popular Electrum wallet.&lt;br /&gt;
* PIN-code protected.&lt;br /&gt;
* Confirm transactions with a touch button press on the device.&lt;br /&gt;
* Supports P2PKH, P2SH, and segWit transactions.&lt;br /&gt;
* Updatable firmware.&lt;br /&gt;
* Extra functionality: OpenPGP smart card, FIDO U2F authenticator, one-time password generator.&lt;br /&gt;
&lt;br /&gt;
Website: [https://www.secalot.com www.secalot.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== ELLIPAL ===&lt;br /&gt;
[[File:Ellipal wallet.png|300px|thumb|left|ELLIPAL]]&lt;br /&gt;
&lt;br /&gt;
ELLIPAL hardware wallet secures keys in cold storage without connections except LCD screen. It works with companion mobile App via QR code.&lt;br /&gt;
&lt;br /&gt;
Main features:&lt;br /&gt;
* Working with mobile phone via QR code&lt;br /&gt;
* Internet Isolated Cold Wallet&lt;br /&gt;
* Multi-currency, cross-chain&lt;br /&gt;
* Supports P2PKH, P2SH, and segWit transactions&lt;br /&gt;
* 4&amp;quot; Screen with touch panel&lt;br /&gt;
* Support private key import&lt;br /&gt;
* PIN-code and gesture pattern protect&lt;br /&gt;
* Confirmation of transactions details on screen&lt;br /&gt;
* BIP32/BIP39/BIP44&lt;br /&gt;
* iPhone and Android companion App: account management, market info and coin exchange. &lt;br /&gt;
&lt;br /&gt;
Website: [https://www.ellipal.com www.ellipal.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== [[Trezor|Trezor Model T]] ===&lt;br /&gt;
[[File:Trezor-model-t-photo-front.jpg|300px|thumb|left|Trezor Model T]]&lt;br /&gt;
&lt;br /&gt;
Trezor Model T is the premium version and next-generation cryptocurrency hardware wallet. In addition to the functionalities of Trezor One, it has a colored touchscreen for secure on-device input, modern design, an SD card slot, and some other more advanced features. &lt;br /&gt;
For more information see [https://wiki.trezor.io/Trezor_Model_T Trezor Model T] and this [https://trezor.io/#comparison comparison table]&lt;br /&gt;
&lt;br /&gt;
[https://shop.trezor.io Trezor E-shop] | [https://wiki.trezor.io Trezor Wiki] | [https://trezor.io Trezor Homepage]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Not purchasable hardware wallets ==&lt;br /&gt;
&lt;br /&gt;
=== Ledger HW.1 - USB Smartcard Hardware Wallet  ===&lt;br /&gt;
[[File:Btchip_dongle.jpg|220px|thumb|left|HW.1 inserted in a laptop]]&lt;br /&gt;
&lt;br /&gt;
HW.1 is an implementation of a deterministic ([[BIP 0032]]) Hardware Wallet on a USB smartcard.&lt;br /&gt;
&lt;br /&gt;
It is typically used as a blind secure device for multi signature transactions - holding a set of derived private keys and signing transactions without requiring user confirmation.&lt;br /&gt;
&lt;br /&gt;
Power users can rely on it to confirm all transactions with a second factor scheme turning the dongle into a keyboard typing what the user is supposed to have signed, as a protection against malware.&lt;br /&gt;
&lt;br /&gt;
It is also possible to customize HW.1 for more specific needs, such as creating a prepaid card without revealing the deterministic seed before it is received by the user, or securing bitcoin transactions on a server.&lt;br /&gt;
&lt;br /&gt;
[https://www.ledgerwallet.com/products/3-ledger-hw-1 E-shop] | [https://ledgerhq.github.io/btchip-doc/bitcoin-technical.html Technical Documentation]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ledger Nano - USB Smartcard Hardware Wallet  ===&lt;br /&gt;
[[File:ledger_wallet_photo.jpg|300px|thumb|left|Ledger Wallet USB]]&lt;br /&gt;
&lt;br /&gt;
Ledger Nano protects your Bitcoin data within a smartcard. Its micro-processor certified against all types of attacks (both physical and logical), and has been used in the banking industry for decades (think credit card chips). The device connects to your computer through the USB port and will do all the Bitcoin cryptographic heavy lifting such as signing transactions inside its secure environment. You can therefore use your Bitcoin account with maximum trust, even on an insecure or compromised computer.&lt;br /&gt;
&lt;br /&gt;
The second factor verification of the transaction signature can be done either with a paired smartphone (Android, iOS) or a physical security card.&lt;br /&gt;
&lt;br /&gt;
The Ledger Wallet Chrome application (available also on Chromium) provides an easy onboarding as well as a seamless user experience, and the Nano is compatible with numerous third party software: [[Electrum]], [[Mycelium]], [[GreenAddress]], Greenbits, [[Coinkite]] and Copay.&lt;br /&gt;
&lt;br /&gt;
[https://www.ledgerwallet.com/products/1-ledger-nano Ledger Nano product page] | [https://github.com/LedgerHQ Source and specifications]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ledger Unplugged - NFC Smartcard Hardware Wallet  ===&lt;br /&gt;
[[File:ledger_unplugged_photo.jpg|300px|thumb|left|Ledger Unplugged NFC]]&lt;br /&gt;
&lt;br /&gt;
The Ledger Unplugged is a credit card sized NFC hardware wallet. It embeds an open source Java Card app and is compatible with all NFC enabled Android phones.&lt;br /&gt;
&lt;br /&gt;
The device can be used with Mycelium or Greenbits. In case of loss, you can restore it on any Ledger Wallet (Nano or another one) or all other compatible solutions (BIP 39).&lt;br /&gt;
&lt;br /&gt;
[https://www.ledgerwallet.com/products/6-ledger-unplugged Ledger Unplugged product page] | [https://github.com/LedgerHQ/ledger-javacard Source code]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BWALLET TREZOR clone ===&lt;br /&gt;
&lt;br /&gt;
[[File:BWALLET_Trezor_Clone.jpeg|200px|thumb|left|Chinese clone of Trezor]]&lt;br /&gt;
&lt;br /&gt;
BWALLET is a clone of Trezor by a Chinese company.&lt;br /&gt;
Trezor code is open source and this device operates like a Trezor.&lt;br /&gt;
However, this product has been [https://www.reddit.com/r/Bitcoin/comments/2tyier/bwallet_review_by_trezor_developer/ reviewed by Marek aka Slush(Trezor developer)] and he has found some problems which makes this device less than 100% compatible, for example it doesn&#039;t work with [http://mytrezor.com myTREZOR.com] website and it does not work with Trezor official firmware. &lt;br /&gt;
&lt;br /&gt;
[http://mybwallet.com MyBWALLET.com] | [http://www.bidingxing.com/en/bwallet Buy BWALLET]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Pi Wallet - cold storage ===&lt;br /&gt;
[[File:Piwallet.jpeg|300px|thumb|left|Pi-Wallet]]&lt;br /&gt;
&lt;br /&gt;
The Pi-Wallet is a small computer with the [[Armory]] bitcoin client.&lt;br /&gt;
&lt;br /&gt;
Transactions are signed offline, then transferred on a USB stick via [https://en.wikipedia.org/wiki/Sneakernet Sneakernet] to an online system for broadcasting.&lt;br /&gt;
&lt;br /&gt;
[https://www.pi-wallet.com/ pi-wallet.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BitcoinCard Megion Technologies-Card based wallet ===&lt;br /&gt;
[[File:Bitcoincard-medley-large.jpg|400px|thumb|left|Bitcoin Card]]&lt;br /&gt;
[http://www.bitcoincard.org/ Bitcoincard Home Page]&lt;br /&gt;
&lt;br /&gt;
[http://blog.bitinstant.com/blog/2012/6/19/our-discovery-in-vienna-the-bitcoin-card.html Excellent review by evoorhees]&lt;br /&gt;
&lt;br /&gt;
Incorporates a e-paper display, keypad, and radio (custom ISM band protocol.) Unfortunately it is fairly limited in terms of transaction I/O, requiring a radio gateway or another bitcoincard wherever funds need to be transferred.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== BitSafe - allten/someone42&#039;s hardware wallet ===&lt;br /&gt;
[[File:Bitsafe-wallet-sizecompare.jpg|200px|thumb|left|Bitsafe wallet]]&lt;br /&gt;
[https://bitcointalk.org/index.php?topic=152517.0 Final BitSafe announcement]&lt;br /&gt;
&lt;br /&gt;
Signing transactions only, requires USB host software for transactions &amp;amp; USB power. Has a OLED display and Confirm/Cancel buttons. Evolved out of someone42&#039;s prototype below, and has significant contributions from someone42 as well.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Swiss Bank in Your Pocket - Hardware wallet ===&lt;br /&gt;
[[File:SBIYP.png|300px|thumb|left|Swiss Bank In Your Pocket]]&lt;br /&gt;
&lt;br /&gt;
The Swiss Bank in Your Pocket is a Windows Desktop Application providing functionality for 5 Bitcoin Wallets and a Bitcoin Vault. &lt;br /&gt;
&lt;br /&gt;
The Bitcoin Vault can only send Bitcoins to the Bitcoin Wallets with in the application. Each Bitcoin wallet can have up to 5 Receive addresses. The intuitive user interface is designed for ease of use. USB security key is required to make any type of transaction. frontend software is installed on windows. Package includes secure USB key, and an additional recovery USB key. So in case of an accident, customer will have an additional backup to access their wallets. &lt;br /&gt;
&lt;br /&gt;
[https://swissbankinyourpocket.com/ swissbankinyourpocket.com]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== someone42&#039;s original prototype ===&lt;br /&gt;
[[File:Someone42-wallet-prototype.jpg|300px|thumb|left|someone42&#039;s original prototype]]&lt;br /&gt;
[https://bitcointalk.org/index.php?topic=78614.0 Hardware Bitcoin wallet - a minimal Bitcoin wallet for embedded devices]&lt;br /&gt;
&lt;br /&gt;
Signing transactions only, requires USB host software for transactions &amp;amp; USB power. All work is rolled into the above BitSafe wallet currently.&lt;br /&gt;
&amp;lt;br clear=&amp;quot;all&amp;quot;&amp;gt;&lt;br /&gt;
=== Other/Defunct but with good discussion: ===&lt;br /&gt;
* natman3400&#039;s BitClip Jun 2011 [https://bitcointalk.org/index.php?topic=24852.0 https://bitcointalk.org/index.php?topic=24852.0]&lt;br /&gt;
:Seems to have gone defunct around Dec 2011. Some good ideas though and seemed to have started on execution.&lt;br /&gt;
* jim618 hardware wallet proposal Apr 2012 [https://bitcointalk.org/index.php?topic=77553.0 Dedicated bitcoin devices - dealing with untrusted networks]&lt;br /&gt;
:Great discussion and good ideas from jim618. Also linked the following video:&lt;br /&gt;
* Prof. Clemens Cap&#039;s hardware wallet? (video:)[https://www.youtube.com/watch?v=IavQ-Wc8S1U Clemens Cap about electronic bitcoin wallet at EuroBit]&lt;br /&gt;
:Clemens Cap of Uni Rostock explains the Electronic Bitcoin wallet device he&#039;s working on. It&#039;s based on adafruit microtouch device.&lt;br /&gt;
* ripper234&#039;s discussion based on Yubikeys Aug 2012 [https://bitcointalk.org/index.php?topic=99492 Having a YUBIKEY as one of the parties for m-of-n signatures]&lt;br /&gt;
:The use of Yubikeys. They only support symmetric crypto, so you&#039;d have to trust the host device.&lt;br /&gt;
* kalleguld&#039;s hardware wallet proposal Oct 2012 [https://bitcointalk.org/index.php?topic=115294.0 Proposal: Hardware wallet (Win 3 BTC)]&lt;br /&gt;
* Vaporware: Matthew N Wright&#039;s ellet [https://bitcointalk.org/index.php?topic=85931.0 ANN The world&#039;s first handheld Bitcoin device, the Ellet!] (Vaporware)&lt;br /&gt;
&lt;br /&gt;
== Smart Card based wallets ==&lt;br /&gt;
This type of device requires complete trust in the host device, as there is no method for user input.&lt;br /&gt;
See [[Smart card wallet]]&lt;br /&gt;
&lt;br /&gt;
== Related Resources ==&lt;br /&gt;
* [https://bitcoinnewsmagazine.com/best-bitcoin-hardware-wallet-2015/ Best Bitcoin Hardware Wallet 2015] - reviews of all bitcoin hardware wallets.&lt;br /&gt;
* [http://99bitcoins.com/trezor-vs-ledger-hands-hardware-wallets-review/ TREZOR vs. Ledger] - User reviews and Reddit feedback&lt;br /&gt;
* [https://bitcointalk.org/index.php?topic=125383.0 Hardware wallet wire protocol]: slush&#039;s Hardware wallet wire protocol discussion&lt;br /&gt;
* [https://bitcointalk.org/index.php?topic=19080.msg272348#msg272348 Re: Split private keys]: kjj&#039;s Todo List discussion for client protocol requirements&lt;br /&gt;
* [https://bitcointalk.org/index.php?topic=134277.0 Hardware Wallet Roundup]&lt;br /&gt;
* [https://www.buybitcoinworldwide.com/wallets/ Bitcoin Hardware Wallet Comparison] - information about using Bitcoin hardware wallets for cold storage.&lt;br /&gt;
* [https://www.weusecoins.com/bitcoin-ledger-wallet-review/ Ledger Wallet Review]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Storing bitcoins]]&lt;br /&gt;
* [[How to set up a secure offline savings wallet]]&lt;br /&gt;
* [[Cold storage]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Security]]&lt;br /&gt;
[[Category:Wallets| ]]&lt;br /&gt;
[[Category:Hardware]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=66655</id>
		<title>Multi-signature</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Multi-signature&amp;diff=66655"/>
		<updated>2019-08-06T03:40:18Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: /* Multisignature Applications */ Adding distributed backup application&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Multisignature (multisig) refers to requiring more than one key to authorize a Bitcoin [[transaction]]. It is generally used to divide up responsibility for possession of bitcoins.&lt;br /&gt;
&lt;br /&gt;
Standard transactions on the Bitcoin network could be called “single-signature transactions,” because transfers require only one signature — from the owner of the private key associated with the Bitcoin address. However, the Bitcoin network supports much more complicated transactions that require the signatures of multiple people before the funds can be transferred. These are often referred to as M-of-N transactions. The idea is that Bitcoins become “encumbered” by providing addresses of multiple parties, thus requiring cooperation of those parties in order to do anything with them. These parties can be people, institutions or programmed scripts.&lt;br /&gt;
&lt;br /&gt;
Consider the following scenario:&amp;lt;blockquote&amp;gt;Suppose I am working with a company that wants to accept Bitcoin for international trades.&lt;br /&gt;
&lt;br /&gt;
The company, for security reasons, would not want a single one of its employees to have access to the company BTC wallet&#039;s password. Any transaction would have to meet the approval of more than one employee.&lt;br /&gt;
&lt;br /&gt;
Is this possible already? If not, how could it be implemented with public-key cryptography?&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=507297.msg5594085&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Implementations==&lt;br /&gt;
Shamir&#039;s [https://en.wikipedia.org/wiki/Secret_sharing Secret Sharing] Scheme (ssss)&amp;lt;ref&amp;gt;https://point-at-infinity.org/ssss/&amp;lt;/ref&amp;gt; is a general software implementation of multisig.&lt;br /&gt;
&lt;br /&gt;
Specific to Bitcoin, [[GreenAddress|GreenAddress.it]], for example, has 2-of-2 and 2-of-3 accounts (requiring at least two keys to authorize a transaction). [[Electrum]] allows a multisig wallet made of any combination of m-of-n. [[Coinbase (business)|Coinbase]] also offers 2-of-3 and 3-of-5 multisig, which they call [https://support.coinbase.com/customer/portal/articles/1743782-what-is-the-multisig-vault- Vault]. [[Blocktrail]] offers 2-of-3 multisig.&lt;br /&gt;
&lt;br /&gt;
This javascript page can create and spend from multisig addresses: https://coinb.in/ But see the warnings about [[Javascript cryptography]].&lt;br /&gt;
&lt;br /&gt;
See also the [[Electrum]] tutorial: http://docs.electrum.org/en/latest/multisig.html&lt;br /&gt;
&lt;br /&gt;
== Multisignature Applications ==&lt;br /&gt;
&lt;br /&gt;
* 1-of-2: Husband and wife petty cash joint account — the signature of either spouse is sufficient to spend the funds.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Husband and wife savings account — both signatures are required to spend the funds, preventing one spouse from spending the money without the approval of the other&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Parents’ savings account for child — the kid can spend the money with the approval of either parent, and money cannot be taken away from the child unless both parents agree&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Two-factor authentication wallet - One private key is on your primary computer, the other on your smartphone — the funds cannot be spent without a signature from both devices. Thus, an attacker must gain access to both devices in order to steal your funds (much more difficult than one device)&lt;br /&gt;
&lt;br /&gt;
* 3-of-5: Low-trust donation address - five trusted people from a project each hold a private key. Three people are required to actually spend the money but anybody can donate to the project&#039;s address. Reduces the risk of embezzlement, hacking/malware or loss due to a single person losing interest in the project. Which private key was used in the final signature is visible on the blockchain which aids accountability.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Buyer-seller with trustless escrow - buyer commits money into a 2-of-3 address with the seller and a third-party arbitrator. If transaction goes smoothly, then both buyer and seller sign the transaction to forward the money to the seller. If something goes wrong, they can sign a transaction to refund the buyer. If they cannot agree, they both appeal to the third-party who will arbitrate and provide a second signature to the party that it deems deserves it. The arbitrator cannot steal the money as they have only one key.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: A board of three directors maintaining funds for their organization — those funds cannot be spent unless any two of those directors agrees. Bigger multi-signature transactions are possible for bigger organizations, such as 3-of-5, 5-of-9, etc.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Improved [[hot wallet]] security for businesses - A bitcoin business such as an exchange holds one private key online and one private key as paper backup. A separate bitcoin security firm holds the third key online and will only sign transactions after checking certain conditions (blacklists, whitelists, not more than X withdrawn per time period, two-factor authentication, comply with regulatory environment, etc). If the bitcoin business or the security firm&#039;s hot wallets individually get hacked, the bitcoins cannot be stolen. If the bitcoin security firm disappears the business can use the paper backup to access coins.&lt;br /&gt;
&lt;br /&gt;
* 2-of-3: Decentralized [[cold storage]] vault - One of the keys is held in your own home, the second in a bank safe deposit box and copies of the third key are distributed to a close friend, a relative and stored in the office. The home vault is not vulnerable to raiding or burglary because spending the money requires a visit to either the friend, bank or office. Losing the safe deposit box also doesn&#039;t result in loss.&lt;br /&gt;
&lt;br /&gt;
* 2-of-2: Smart [[contract]]s building block such as tumblebit, coinswap and [[Lightning Network]].&lt;br /&gt;
&lt;br /&gt;
* 1 OR 3-of-4: Distributed Backup - The primary owner can use the wallet at will, but if that owner loses their private keys, they can recover with the help of 3 of the other 4 trusted friends/organizations. One key could be kept in a security deposit box at a bank, the other 3 could be distribute to friends. In the case of death of the owner, the security deposit box can be willed to one of the trusted friends or someone who can get the help of the trusted friends. More [https://bitcoin.stackexchange.com/questions/89589/is-it-possible-to-do-a-3-of-5-or-1-multi-sig-for-backup-purposes/89590?noredirect=1#comment102505_89590 complex] multisig wallets can be created if desired.&lt;br /&gt;
&lt;br /&gt;
See also: [[Storing_bitcoins#Multisignature_wallets]]&lt;br /&gt;
&lt;br /&gt;
==History of Multisignature==&lt;br /&gt;
Multisignature has been used for thousands of years to protect the security of crypts holding the most precious relics of saints. The superior of a monastery would give monks only partial keys for gaining access to the precious relics. Thus, no single monk could gain access to and possibly steal the relics.&amp;lt;ref&amp;gt;[https://www.youtube.com/watch?v=YcmWQe29zro#t=10m27s Monks at Mt. Athos continue to use &amp;quot;hard&amp;quot; &amp;quot;multisignature&amp;quot; security today.]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Multisignature Wallets==&lt;br /&gt;
&lt;br /&gt;
A number of companies have developed multisig wallets:&amp;lt;ref&amp;gt;https://www.reddit.com/r/Bitcoin/comments/4eabpi/multisig_wallets_review_coinkite_alternatives_and/&amp;lt;/ref&amp;gt; &lt;br /&gt;
* [[Armory]]&lt;br /&gt;
* [[CarbonWallet]]&lt;br /&gt;
* [[Copay]]&lt;br /&gt;
* [[Bitgo]]&lt;br /&gt;
* [[Blocktrail]]&lt;br /&gt;
* [[GreenAddress]]&lt;br /&gt;
* [https://keys.casa Casa]&lt;br /&gt;
* [[Coinbase]]&lt;br /&gt;
* [[Electrum]]&lt;br /&gt;
* [[Xapo]]&lt;br /&gt;
* [[Coinkite]]&lt;br /&gt;
&lt;br /&gt;
===Creating a Multisignature Address with Bitcoin-Qt===&lt;br /&gt;
A 2of3 multisig address can be created by following these steps:&amp;lt;ref&amp;gt;https://bitcoin.stackexchange.com/a/10593/4334&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;blockquote&amp;gt;&amp;lt;ol&amp;gt;&amp;lt;li&amp;gt;Gather (or generate) 3 bitcoin addresses, on whichever machines will be participating, using getnewaddress or getaccountaddress RPC commands (or copy and paste from the GUI).&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Get their public keys using the &amp;lt;tt&amp;gt;validateaddress&amp;lt;/tt&amp;gt; [[API_reference_%28JSON-RPC%29|RPC]] command 3 times.&amp;lt;/li&amp;gt;&lt;br /&gt;
&amp;lt;li&amp;gt;Then create a 2-of-3 multisig address using addmultisigaddress; e.g.&amp;lt;blockquote&amp;gt;&amp;lt;code&amp;gt;bitcoind addmultisigaddress 2 &#039;[&amp;quot;044322868cb17d64dcc22185ae2d4493111d73244c3668f8ac79ecc79c0ba8d30a6756d0fa20157 709af3281cc721c7f53321a8cabda29b77900b7e4fe0174b114&amp;quot;,&amp;quot;..second pubkey..&amp;quot;,&amp;quot;..third pubkey..&amp;quot;]&#039;&amp;lt;/code&amp;gt;&amp;lt;/blockquote&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ol&amp;gt;&amp;lt;tt&amp;gt;addmultisigaddress&amp;lt;/tt&amp;gt; returns the multisignature address. Be a little careful, the public keys are raw hexadecimal and don&#039;t contain checksums like bitcoin addresses do. You can then send funds into that 2-of-3 transaction using the normal sendtoaddress/sendmany RPC commands, or the GUI (or anything that&#039;s been updated to recognize multisig addresses).&amp;lt;ref&amp;gt;https://bitcointalk.org/index.php?topic=82213.msg906833#msg906833&amp;lt;/ref&amp;gt;&amp;lt;/blockquote&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Gavin Andresen has an example of using multisig with bitcoin-qt [[Raw Transactions]]: https://gist.github.com/gavinandresen/3966071&lt;br /&gt;
&lt;br /&gt;
== Notable examples in practice ==&lt;br /&gt;
&lt;br /&gt;
* The cold storage wallet of the [[Bitfinex]] exchange is a single 3-of-6 multisig address &amp;lt;code&amp;gt;3D2oetdNuZUqQHPJmcMDDHYoqkyNVsFk9r&amp;lt;/code&amp;gt; which as of December 2017 contains &#039;&#039;&#039;141 177 btc&#039;&#039;&#039; ($1.5 billion). Presumably the keys are kept very safe by Bitfinex&#039;s operators. &lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* [https://bitcoinmagazine.com/11108/multisig-future-bitcoin/ How To Create A Bitcoin Multisig Wallet]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BTC.com&amp;diff=65004</id>
		<title>BTC.com</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BTC.com&amp;diff=65004"/>
		<updated>2018-03-01T08:03:26Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: rm founders - bitmain is not the founder&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infobox company|image=[[File:Logo-white-sq.png|250px|thumb|left]]|name=BTC.com&lt;br /&gt;
|foundation= 2015&lt;br /&gt;
|industry=[[Wallet]] [[Api]] [[Block Explorer]]&lt;br /&gt;
|website=https://www.btc.com&lt;br /&gt;
}}[https://www.btc.com BTC.com] is a [https://wallet.btc.com web wallet] originally created by Blocktrail and now owned by Bitmain Technologies. It also publishes an [https://play.google.com/store/apps/details?id=com.blocktrail.mywallet&amp;amp;hl=en Android wallet], an [https://itunes.apple.com/us/app/blocktrail-bitcoin-wallet/id1019614423/ iOS Wallet], a Bitcoin API, a [http://www.btc.com block explorer], and a [[mining pool]].&amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
On July 19, 2016 [[Blocktrail]] was acquired by [[Bitmain]] and subsequently re-branded to BTC.com.&amp;lt;ref&amp;gt;http://www.coindesk.com/bitcoin-miner-bitmain-acquires-blockchain-data-startup/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Wallet==&lt;br /&gt;
&lt;br /&gt;
The wallets they offer allow you to buy bitcoin and bitcoin cash alongside basic wallet features and features like 2-factor-auth.&lt;br /&gt;
&lt;br /&gt;
The wallets are open source software hosted at http://github.com/blocktrail/blocktrail-wallet.&lt;br /&gt;
&lt;br /&gt;
== Mining Pool ==&lt;br /&gt;
On September 13, 2016, BTC.com launched a mining pool&amp;lt;ref&amp;gt;http://www.coindesk.com/bitmain-bitcoin-mining-launch-second-mining-pool/&amp;lt;/ref&amp;gt; using a settlement mode called PPS (pay-per-share).&amp;lt;ref&amp;gt;https://blog.btc.com/btc-com-launches-new-open-source-mining-pool-with-zero-mining-fee-2f6e0a53ce2c#.33zivpv2w&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Block chain browser]]&lt;br /&gt;
* [[Api]]&lt;br /&gt;
* [[Wallet]]&lt;br /&gt;
* [[Mining Pool]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;br /&gt;
[[Category:Wallets]]&lt;br /&gt;
[[Category:Mobile]]&lt;br /&gt;
[[Category:Block chain browsers]]&lt;br /&gt;
[[Category:Frontends]]&lt;br /&gt;
[[Category:Bitcoin]]&lt;br /&gt;
[[Category:Clients]]&lt;br /&gt;
[[Category:Pool Operators]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BTC.com&amp;diff=65003</id>
		<title>BTC.com</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BTC.com&amp;diff=65003"/>
		<updated>2018-02-27T01:02:13Z</updated>

		<summary type="html">&lt;p&gt;Fresheneesz: removing lots of marketing content - this page is not free advertising space&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;{{infobox company|image=[[File:Logo-white-sq.png|250px|thumb|left]]|name=BTC.com&lt;br /&gt;
|founder= [[Bitmain]]&lt;br /&gt;
|foundation= 2015&lt;br /&gt;
|industry=[[Wallet]] [[Api]] [[Block Explorer]]&lt;br /&gt;
|website=https://www.btc.com&lt;br /&gt;
}}[https://www.btc.com BTC.com] is a [https://wallet.btc.com web wallet] originally created by Blocktrail and now owned by Bitmain Technologies. It also publishes an [https://play.google.com/store/apps/details?id=com.blocktrail.mywallet&amp;amp;hl=en Android wallet], an [https://itunes.apple.com/us/app/blocktrail-bitcoin-wallet/id1019614423/ iOS Wallet], a Bitcoin API, a [http://www.btc.com block explorer], and a [[mining pool]].&amp;lt;br /&amp;gt; &lt;br /&gt;
&lt;br /&gt;
On July 19, 2016 [[Blocktrail]] was acquired by [[Bitmain]] and subsequently re-branded to BTC.com.&amp;lt;ref&amp;gt;http://www.coindesk.com/bitcoin-miner-bitmain-acquires-blockchain-data-startup/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Wallet==&lt;br /&gt;
&lt;br /&gt;
The wallets they offer allow you to buy bitcoin and bitcoin cash alongside basic wallet features and features like 2-factor-auth.&lt;br /&gt;
&lt;br /&gt;
The wallets are open source software hosted at http://github.com/blocktrail/blocktrail-wallet.&lt;br /&gt;
&lt;br /&gt;
== Mining Pool ==&lt;br /&gt;
On September 13, 2016, BTC.com launched a mining pool&amp;lt;ref&amp;gt;http://www.coindesk.com/bitmain-bitcoin-mining-launch-second-mining-pool/&amp;lt;/ref&amp;gt; using a settlement mode called PPS (pay-per-share).&amp;lt;ref&amp;gt;https://blog.btc.com/btc-com-launches-new-open-source-mining-pool-with-zero-mining-fee-2f6e0a53ce2c#.33zivpv2w&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Block chain browser]]&lt;br /&gt;
* [[Api]]&lt;br /&gt;
* [[Wallet]]&lt;br /&gt;
* [[Mining Pool]]&lt;br /&gt;
&lt;br /&gt;
==External Links==&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Services]]&lt;br /&gt;
[[Category:Wallets]]&lt;br /&gt;
[[Category:Mobile]]&lt;br /&gt;
[[Category:Block chain browsers]]&lt;br /&gt;
[[Category:Frontends]]&lt;br /&gt;
[[Category:Bitcoin]]&lt;br /&gt;
[[Category:Clients]]&lt;br /&gt;
[[Category:Pool Operators]]&lt;/div&gt;</summary>
		<author><name>Fresheneesz</name></author>
	</entry>
</feed>