Deterministic wallet: Difference between revisions

From Bitcoin Wiki
Jump to navigation Jump to search
Slush (talk | contribs)
Pancyrus (talk | contribs)
mNo edit summary
 
(13 intermediate revisions by 7 users not shown)
Line 1: Line 1:
A deterministic wallet is a system of deriving keys from a single starting point known as a seed. The seed allows a user to easily back up and restore a wallet without needing any other information and can in some cases allow the creation of public addresses without the knowledge of the private key.  
A deterministic wallet is a system of deriving keys from a single starting point known as a seed. The seed allows a user to easily back up and restore a wallet without needing any other information and can in some cases allow the creation of public addresses without the knowledge of the private key. Seeds are typically serialized into human-readable words in a [[seed phrase]]. The [[BIP 0032]] standard for hierarchical deterministic wallets is used by all good wallets as of 2019.


== Benefits ==
== Benefits ==


Early clients such as the [[Satoshi client]] generate a buffer of fresh random private keys to be used as receiving and [[change|change addresses]] in the future. This has the effect of invalidating backups after a short period when the keypool buffer (typically 100 addresses) is exhausted, deterministic wallets can generate an unlimited number of addresses on the fly and as such don't suffer from this issue. As the addresses are generated in a known fashion rather than randomly some clients can be used on multiple devices without the risk of losing funds. Users can conveniently create a single backup of the seed in a human readable format that will last the life of the wallet, without the worry of this backup becoming stale.  
Early clients such as the [[Satoshi client]] generate a buffer of fresh random private keys to be used as receiving and [[change|change addresses]] in the future. This has the effect of invalidating backups after a short period when the keypool buffer (typically 100 addresses) is exhausted. Deterministic wallets can generate an unlimited number of addresses on the fly and as such don't suffer from this issue. As the addresses are generated in a known fashion rather than randomly some clients can be used on multiple devices without the risk of losing funds. Users can conveniently create a single backup of the seed in a human readable format that will last the life of the wallet, without the worry of this backup becoming stale.  


Certain types of deterministic wallet (BIP0032, Armory and [[Coinkite]] ) additionally allow for the complete separation of private and public key creation for greater security and convenience. In this model a server can be set up to only know the Master Public Key of a particular deterministic wallet. This allows the server to create as many public keys as is necessary for receiving funds, but a compromise of the MPK will not allow an attacker to spend from the wallet. They can alternatively be used in [[Electrum]] and [[Armory]] to enable completely offline storage and spending, where an offline computer knows the private key and an online one knows only the MPK. Transactions spending coins are ferried between the two computers via USB storage which avoids exposing the offline computer to a network-based attack.
=== Master public key ===
 
Certain types of deterministic wallet (BIP0032, Armory, [[Coinkite]] and [https://coinb.in/#newHDaddress Coinb.in] ) additionally allow for the complete separation of private and public key creation for greater security and convenience. In this model a server can be set up to only know the Master Public Key (MPK) of a particular deterministic wallet. This allows the server to create as many public keys as is necessary for receiving funds, but a compromise of the MPK will not allow an attacker to spend from the wallet. They can alternatively be used in [[Electrum]] and [[Armory]] to enable completely offline storage and spending, where an offline computer knows the private key and an online one knows only the MPK. Transactions spending coins are ferried between the two computers via USB storage which avoids exposing the offline computer to a network-based attack.
 
Deterministic wallets implemented by hardware wallets ([[TREZOR]]) keep the generated private keys offline and do not expose them to the computer even when spending coins.


==Types==
==Types==


===Type 1 deterministic wallet===
===Type 1: Deterministic wallet===
A type 1 deterministic wallet is a simple method of generating addresses from a known starting string, as such it does not allow advanced features such as a Master Public Key. To generate a private key take SHA256(string + n), where n is an ASCII-coded number that starts from 1 and increments as additional keys are needed.  
A type 1 deterministic wallet is a simple method of generating addresses from a known starting string, as such it does not allow advanced features such as a Master Public Key. To generate a private key take SHA256(string + ''n''), where ''n'' is an ASCII-coded number that starts from 1 and increments as additional keys are needed.  


This  type of wallet can be created by Casascius Bitcoin Address Utility.
This  type of wallet can be created by Casascius Bitcoin Address Utility.


===Type 2 hierarchical deterministic wallet===
===Type 2: Hierarchical deterministic wallet===
This wallet type is described in [[BIP 0032]] and is fully implemented in [[TREZOR]], [[Electrum]] and [[CarbonWallet]]. The seed is a random 128 bit value presented to the user as a 12 word mnemonic using common English words. The seed is used after 100,000 rounds of SHA256 to slow down attacks against weak user-chosen strings. [https://bitcointalk.org/index.php?topic=330672.msg3547258#msg3547258].
This wallet type is described in [[BIP 0032]] and is fully implemented in [[TREZOR]], [[Electrum]] and [[CarbonWallet]]. The seed is a random 128-bit value presented to the user as a 12-word seed phrase using common English words. The seed is used after 100,000 rounds of SHA256 to slow down attacks against weak user-chosen strings.<ref>https://bitcointalk.org/index.php?topic=330672.msg3547258#msg3547258</ref>


The initial description and workings of this wallet type is credited to Gregory Maxwell. [https://bitcointalk.org/index.php?topic=19137.msg239768#msg239768]
The initial description and workings of this wallet type is credited to Gregory Maxwell.<ref>https://bitcointalk.org/index.php?topic=19137.msg239768#msg239768</ref>


===Armory deterministic wallet===
===Armory deterministic wallet===
[[Armory]] has its own Type-2 deterministic wallet format based on a "root key" and a "chain code." Earlier versions of Armory required backing up both the "root key" and "chaincode," while newer versions start deriving the chaincode from the private key in a non-reversible way.  These newer Armory wallets (0.89+) only require the single, 256-bit root key. This older format is intended to be phased out in favor of the standard BIP0032 format. [https://bitcointalk.org/index.php?topic=351099.msg3770818#msg3770818]
[[Armory]] has its own Type-2 deterministic wallet format based on a "root key" and a "chain code". Earlier versions of Armory required backing up both the "root key" and "chaincode", while newer versions start deriving the chaincode from the private key in a non-reversible way.  These newer Armory wallets (0.89+) only require the single, 256-bit root key. This older format is intended to be phased out in favour of the standard BIP0032 format.<ref>https://bitcointalk.org/index.php?topic=351099.msg3770818#msg3770818</ref>
 
== References ==
<references />
 
== See also ==
 
* [[Seed phrase]]
* [[BIP 0032]]
* [[Deterministic wallet tools]]
 
[[Category:Technical]]
[[Category:Wallets| ]]

Latest revision as of 17:04, 27 July 2023

A deterministic wallet is a system of deriving keys from a single starting point known as a seed. The seed allows a user to easily back up and restore a wallet without needing any other information and can in some cases allow the creation of public addresses without the knowledge of the private key. Seeds are typically serialized into human-readable words in a seed phrase. The BIP 0032 standard for hierarchical deterministic wallets is used by all good wallets as of 2019.

Benefits

Early clients such as the Satoshi client generate a buffer of fresh random private keys to be used as receiving and change addresses in the future. This has the effect of invalidating backups after a short period when the keypool buffer (typically 100 addresses) is exhausted. Deterministic wallets can generate an unlimited number of addresses on the fly and as such don't suffer from this issue. As the addresses are generated in a known fashion rather than randomly some clients can be used on multiple devices without the risk of losing funds. Users can conveniently create a single backup of the seed in a human readable format that will last the life of the wallet, without the worry of this backup becoming stale.

Master public key

Certain types of deterministic wallet (BIP0032, Armory, Coinkite and Coinb.in ) additionally allow for the complete separation of private and public key creation for greater security and convenience. In this model a server can be set up to only know the Master Public Key (MPK) of a particular deterministic wallet. This allows the server to create as many public keys as is necessary for receiving funds, but a compromise of the MPK will not allow an attacker to spend from the wallet. They can alternatively be used in Electrum and Armory to enable completely offline storage and spending, where an offline computer knows the private key and an online one knows only the MPK. Transactions spending coins are ferried between the two computers via USB storage which avoids exposing the offline computer to a network-based attack.

Deterministic wallets implemented by hardware wallets (TREZOR) keep the generated private keys offline and do not expose them to the computer even when spending coins.

Types

Type 1: Deterministic wallet

A type 1 deterministic wallet is a simple method of generating addresses from a known starting string, as such it does not allow advanced features such as a Master Public Key. To generate a private key take SHA256(string + n), where n is an ASCII-coded number that starts from 1 and increments as additional keys are needed.

This type of wallet can be created by Casascius Bitcoin Address Utility.

Type 2: Hierarchical deterministic wallet

This wallet type is described in BIP 0032 and is fully implemented in TREZOR, Electrum and CarbonWallet. The seed is a random 128-bit value presented to the user as a 12-word seed phrase using common English words. The seed is used after 100,000 rounds of SHA256 to slow down attacks against weak user-chosen strings.[1]

The initial description and workings of this wallet type is credited to Gregory Maxwell.[2]

Armory deterministic wallet

Armory has its own Type-2 deterministic wallet format based on a "root key" and a "chain code". Earlier versions of Armory required backing up both the "root key" and "chaincode", while newer versions start deriving the chaincode from the private key in a non-reversible way. These newer Armory wallets (0.89+) only require the single, 256-bit root key. This older format is intended to be phased out in favour of the standard BIP0032 format.[3]

References

See also