Digital wallets
A digital wallet is a system that allows users to store, track, transfer, and receive money digitally. Its currency can be digital assets such as Bitcoin, Doug, etc., or digital fiat currencies such as US dollars and euros.
This wallet is not a physical wallet as traditionally referred, it is a software application. It is connected to the blockchain network, providing users with a way to track their currencies, make transactions, and conduct blockchain operations.
A typical digital wallet contains two types of "keys" – a public key, which is the wallet's address to which others can send currency. There is also a private key, which is the password to decrypt the transaction information, known only to the wallet holder. Strictly speaking, when we say "hold" a digital currency, we actually have the private keys that control it.
Mastering the private key is equivalent to mastering the digital currency inside, so it is particularly important to protect the security of the private key. Once the private key is lost or stolen, the relevant digital currency will be permanently unusable. This is very different from using a traditional financial account, which can be restored or replaced by a bank.
HD Wallet
HD wallet, the full name is hierarchical deterministic wallet (Hierarchical Deterministic Wallet), is a wallet used to generate a large number of public-private key pairs.
HD wallets work based on a single, initially generated seed. One or more master private keys can be generated through seeds, and each master private key can generate multiple unique child private keys. These sub-private keys can be further used to generate grandchildren's private keys, and so on, forming a hierarchical structure of keys. All this can be reproduced by the original seeds. Therefore, as long as this seed is safeguarded, all generated addresses and private keys in the wallet can be recovered.
To increase the privacy of the wallet, HD Wallet can generate a new address for each transaction, because all addresses are exported from the same seed, avoiding privacy issues caused by using the same address multiple times.
Among them, HD wallets have been standardized and applied in Bitcoin BIP32, BIP44, BIP39 and other proposals. BIP39 specifies a method for generating seeds that can be represented using 12, 18, or 24-word seed phrases selected from a fixed vocabulary. This allows users to only remember or back up these seed phrases when backing up their wallets instead of complex private keys, greatly reducing the difficulty of use.
HD wallets are a more advanced type of digital wallet that introduces a new way to generate an infinite number of private keys and corresponding wallet addresses from a single seed (simply a string of data).
The key advantage of HD Wallet is that it makes it much simpler to back up your wallet. Users only need to remember or save this seed (usually a specific string of words, known as a seed phrase) to recover all their wallet addresses and private keys. This means that even if a user's device is lost, as long as the seed is not lost, then their assets can still be recovered by importing the seed.
In addition, HD wallets come with greater privacy. Because a new address is generated with each transaction, it is difficult to track all of a person's transactions and asset status on-chain based on wallet address alone.
Therefore, the HD wallet can be considered as a type of digital wallet, which is still a tool for managing and controlling digital currencies, only with some additional features.
BIP32、BIP44、BIP39
BIP is an abbreviation for Bitcoin Improvement Proposal, which is a standard generated by Bitcoin developers to propose new features or improvements to Bitcoin's protocol, client, or environment. Each BIP will have a number, such as BIP-32, BIP-44, etc., which are all wallet design standards for Bitcoin.
There are three main types of BIP:
Standardized BIP: This type of BIP is responsible for adding new features to a network, blockchain, or protocol. Informative BIPs: These BIPs do not involve changes to the Bitcoin protocol, but are primarily designed to design questions, guidelines, or provide general information to the Bitcoin community. Process BIP: This BIP describes a change in a process or environment, but it is not added to the technical specification of the BIP. All BIPs start as a proposal that, after thorough discussion and modification by the community, may be imported into the Bitcoin protocol standard if it receives sufficient support.
Standard Address:The hyperlink login is visible.
BIP32
BIP32, the full name of Bitcoin Improvement Proposal 32, Chinese is a standard in the Bitcoin Improvement Proposal.
In the past, Bitcoin wallets were implemented by generating a new public key and corresponding Bitcoin address each time a new private key was generated, which was stored in the wallet file. The problem with this approach is that each time a new private key and Bitcoin address is generated, a new wallet backup needs to be generated. The birth of BIP32 solves this problem, creating a new way of generating private and public keys, with just one seed, to generate unlimited private and public keys in a tree structure.
The main features of BIP32 are:
Single private key supports the generation of unlimited key pairs: Generate public and private key pairs from a seed, and create an entire key tree with only the seed known. This solves the backup problem, as the entire wallet can be restored just by backing up this seed. Hierarchical Wallet Management: BIP32 specifies a wallet structure that allows users to manage wallets in layers according to purpose, business, account, etc. Public Key Derivation: BIP32 allows the derivation of a sub-public key with the public key and chaincode of a node known. This feature allows the derivation of public keys to be completed without knowing the private key, enhancing security. Privacy Enhancement: While traditional wallets use randomly generated unique addresses, BIP32 wallets generate a batch of keys based on the same seed, allowing new addresses to be used for each transaction, improving privacy. In short, BIP32 mainly improves the traditional wallet backup method, making it simple, efficient, and more private.
BIP39
BIP39 is the name of the specification used to generate BIP32 seeds.
BIP39, the full name of Bitcoin Improvement Proposal 39, is a Chinese name for seed phrase generation method, which is an improvement proposal for Bitcoin.
BIP39 is commonly used to generate BIP32 seeds. It specifies how to convert random numbers into a set of memorable words, which is the set of 12-24 word backup seed phrases we often see. When a user generates a wallet or opens the wallet app for the first time, such a set of words is created. BIP39 is widely used in most modern cryptocurrency wallets.
Generate a mnemonic phrase as shown below:
The seed is derived from the mnemonic phrase, as shown in the figure below:
Main use of BIP39 Seed: BIP39 Seed is a fixed-length (512-bit, 64-byte) binary data generated from a mnemonic and an optional passphrase. Its primary role is to serve as the wallet's core secret data, which is used to derive all subsequent private keys, public keys, and addresses.
Here's a more detailed introduction to BIP39:
Generation method: A seed phrase is made up of a set of English words that come from a fixed word list (A total of 2,048) in. First, a random number is generated based on the user's random actions (e.g., mouse movements, keyboard typing speed, etc.), and this random number is then converted into a set of words. This process is reversible, and the original random number can be restored as long as the set of words is memorized. Key recovery: In the BIP39 seed phrase generation method, users can recover their entire wallet by simply remembering 12-24 simple words. This greatly simplifies the backup and recovery of wallet private keys, improving wallet availability. Password function: The password function specified in BIP39 can increase the difficulty of recovering the private key, making it more difficult for others to recover your private key through the seed phrase. Once the BIP39 password is set, the wallet must be restored through the seed phrase + password. Cross-wallet compatibility: Since BIP39 is an open standard, there is a high level of compatibility between wallet vendors, which means you can import seed phrases from one wallet into another, which is greatly convenient for users. BIP39 is a very important standard in Bitcoin wallets, which simplifies complex private key management issues through seed phrases, making it easier for users to use Bitcoin.
Glossary References:The hyperlink login is visible. About .NET implementation code for BIP-39:The hyperlink login is visible.
BIP44
BIP44, the full name is Bitcoin Improvement Proposal 44, the Chinese name is multi-currency and multi-account specification, which is a proposal for Bitcoin.
Based on seeds (generated by BIP39) and BIP32 paths, BIP44 defines a logical hierarchy for deterministic wallets, and on top of that, defines a five-layer tree path. BIP44 allows the creation and management of multiple currencies and multiple accounts, each with its own receiving and changing addresses.
Following this specification, HD Wallet can generate a diversified wallet system based on a seed, that is, you can use a private key seed to generate and manage accounts and addresses in different currencies.
The path structure defined by BIP44 is:m / purpose’ / coin_type’ / account’ / change / address_index:
Purpose: In BIP44, the purpose is always set to 44'. Coin Type: This layer is used to distinguish between different digital currencies, such as 0 for Bitcoin, 1 for Testnet Bitcoin, 60 for Ethereum, etc. The full list of coins is here. Account: Separate account addresses for better management of funds. This layer allows users to generate and manage multiple separate accounts under the same software, making the ledger transparent rather than all mixed together. Change: Used to distinguish between the change address and the receiving address. Typically, 0 represents an external address and 1 represents a change address Address Index: Identify the nth address generated. The advantage of using BIP44 is that you can generate and recover the coins and addresses you need to manage on any BIP44-compliant wallet by keeping in mind this path definition for seeds and BIP44.
C# generates HD wallets
First, the project introduces the Nethereum.HdWallet library, with the following code:
As shown below:
Online mnemonic code converter:The hyperlink login is visible. Source:The hyperlink login is visible.
Review:
Reference:
The hyperlink login is visible.
The hyperlink login is visible.
The hyperlink login is visible.
(End) |