What technologies are used in the design of different digital currency wallets
According to whether multiple secret keys are related, they can be divided into two different types of wallets. The first is a non-deterministic wallet
, where each key is independently generated from a random number, and the keys are independent of each other. The other is a deterministic wallet, in which all keys are derived from a master key, which is the seed. All keys in this type of wallet are related to each other. If there is an original seed, all keys can be generated again. There are many different key derivation methods used in deterministic wallets. The most commonly used derivation method is to use a tree structure, called a hierarchical deterministic wallet or Sallet one
Non-deterministic (random) wallet
In the earliest batch of Bitcoin clients (Bitcoin Core, now called Bitcoin Core clients), wallets are just a set of randomly generated private keys. This type of wallet is called a zero-type non-deterministic wallet. Generate enough private keys from the very beginning and use each key only once. Such wallets are now being replaced by deterministic wallets because they are difficult to manage, back up, and import. The disadvantage of random keys is that if you generate a lot of private keys, you must keep all copies of them. This means that this wallet must be backed up frequently. Every key must be backed up, otherwise once the wallet is inaccessible, the funds controlled by the wallet will be in vain. The figure below shows a non-deterministic wallet, which contains a loose set of random keys.
This situation directly conflicts with the principle of avoiding the reuse of addresses-each Bitcoin address can only be used for one transaction. Address reuse links multiple transactions and addresses together, which reduces privacy. When you want to avoid reusing addresses, type zero non-deterministic wallets are not a good choice because you have to create too many private keys and save them. Although the Bitcoin Core client includes a zero wallet, the Bitcoin core developers do not encourage everyone to use it.
Deterministic (seed) wallet
Deterministic, or "seed" wallets contain private keys that can be generated from public seeds by using a single-item discrete function. The seed is a randomly generated number. This number also contains, for example, an index number or a "chain code" that can generate a private key. In a deterministic wallet, the seed is sufficient to restore all the private keys that have been generated, so a simple backup at the time of initial creation is sufficient. And the seed is enough for the wallet to import or export. This easily allows the user's private key to be easily transferred between wallets.
The most advanced form of deterministic wallet is the Sallet one wallet defined by the BIP0032 standard. The Sallet one wallet contains keys derived in a tree structure, so that the parent key can derive a series of child keys, and each child key can derive a series of grandchild keys, and so on, unlimited derivation.
Compared with random (uncertain) keys, Sallet one wallets have two main advantages. First, the tree structure can be used to express additional organizational meaning. For example, when the sub-key of a particular branch is used to receive transaction revenue and the sub-key of another branch is used to pay for expenses. The keys of different branches can be used in the corporate environment, which can dictate different branches, subsidiaries, specific functions, and accounting categories.
The second advantage of Sallet one wallet is that it allows users to create a sequence of public keys without accessing the corresponding private keys. This may allow Sallet one wallets to be used in unsecured servers or to issue different public keys in each transaction. The public key does not need to be pre-loaded or derived in advance, and the private key that can be used for payment is not required in the server.