What is a blockchain wallet? What are hot wallets and cold wallets?
1: Simply speaking, blockchain decentralizes previously centralized data, making it open, transparent and unable to be tampered with. Anyone can see the generation and flow of data. Similarly, once any transaction is uploaded to the chain, it cannot be returned. roll.
2: A centralized wallet is essentially a tool that helps you interact with the blockchain, and the "key" that can truly control the data on your chain is in your own device (private key)
3: Therefore, your journey and marks in decentralization are only recorded on the blockchain, and all your asset data is only stored on the blockchain, not on the wallet service provider.
4: The only way to control the assets on the chain is through the private key and mnemonic phrase: If others obtain your private key and mnemonic phrase, they can also operate your assets! Therefore, to protect your private key and mnemonic phrase, it is best to copy the steel plate and put it in a safe!
5: Due to the openness of the blockchain, it is easy for asset tokens with the same name to appear. At this time, it is necessary to distinguish the real and fake Sun Wukong! The only criterion for differentiation is: the contract address, which is just like a person’s ID card and will not be repeated!
6: A smart contract is composed of an address and the code corresponding to the address. Because the address does not have a private key, do not transfer money to the contract address. The money cannot be retrieved after the transfer!
7: DAPP is a decentralized application built on the blockchain, and the wallet is a tool for interacting with it. DAPP is not necessarily a service provided by the wallet itself, so do not participate in DAPP of unknown origin (be sure to check The URL to download the dapp. There are many fake DAPPs on the market currently)
What is a decentralized wallet?
Compared with centralized wallets (exchanges) where the private keys are in the hands of third-party service providers, the private keys of decentralized wallets are kept by the users themselves, the assets are stored on the blockchain, and the users are the real holders of digital currencies. However, the wallet is just a tool to help users manage on-chain assets and read blockchain data, so it cannot control, steal, or transfer your assets.
Therefore, decentralized wallets are difficult to be attacked by hackers, and users do not have to worry about the wallet service provider’s self-stealing or running away, because as long as you keep the private key when creating the wallet, your assets will still be on the chain. Change wallets The same can be displayed.
Note: Once the decentralized wallet is lost or stolen, it cannot be retrieved without backing up the private key or mnemonic phrase, so be sure to back up your private key safely and correctly.
private key
The private key is a 64-bit hexadecimal string consisting of letters and numbers. After creating the wallet, enter the password to export the private key. There is only one private key for an account and cannot be modified. Usually the private key and the public key in a wallet appear in pairs. With the private key, the public key can be generated through a certain algorithm, and then the address can be generated through the public key through a certain algorithm. This process is irreversible.
On any wallet, you can import the assets of the previous A wallet into B wallet by importing the private key and setting a new password. For example, if your mobile phone is lost, you only need to import the private key to recover the assets.
Mnemonic phrase
The emergence of mnemonic words is because the private key consists of a 64-bit string, which is inconvenient to record and easy to copy wrongly. In order to facilitate users to remember and record, it is simplified into a mnemonic phrase consisting of 12 words, with a space between each word. The mnemonic phrase and the private key have the same function, that is, just enter the mnemonic phrase and set a new password. , you can import the wallet. Like private keys, a wallet has only one set of mnemonic words and cannot be modified.
Wallet password
When creating a wallet, you need to set a password, which must be no less than 8 characters. The wallet password is mainly used to manage the wallet. For example, you need to enter the password when transferring money; when importing the wallet with a private key/mnemonic phrase, you must enter the wallet password. Passwords can be modified or reset. If you forget the original password, you can use the private key or mnemonic phrase to import the wallet and set a new password at the same time.
An analogy can be made with a bank account to differentiate:
Private key = bank card number + bank card password
Mnemonic phrase = bank card number + bank card password
Password = bank card password
So, what is the relationship between public key, private key and address?
Among the three, Bitcoin wallet addresses are the most common. They are a combination of numbers and letters that look a bit like gibberish. The wallet address is like a bank card number and represents your Bitcoin account. Wallet addresses are also available through exchanges, Bitcoin clients, and online wallets.
To summarize in one sentence, in addition to the fact that the wallet is software, the public key, private key, and address are all strings of different lengths. For example, the private key is a 52-bit string and the address is a 34-bit string.
The private key is randomly generated by the wallet software, and then a cryptographic algorithm is used to generate the public key and address. If expressed by an equation, it can be written in the following form:
Public key = algorithm 1 (private key)
Public Key Hash = Algorithm 2 (Public Key)
Address = Algorithm 3 (Public Key Hash)
So, address = algorithm 3 (algorithm 2 (algorithm 1 (private key)))
Among them, Algorithm 1, Algorithm 2, and Algorithm 3 are all public algorithms.
Which of these strings must be kept secret and which can be made public?
The private key must not be made public, because with it you essentially gain ownership of the corresponding Bitcoin.
The address can be made public because it is used to accept Bitcoins, and the public key and public key hash can also be made public, although you generally cannot see it.
What is the nature of a private key?
The essence of a private key is the solution to a complex mathematical problem. When someone sends Bitcoin to a public address, he is actually sending a mathematical problem to all Bitcoin clients on the entire network, and the correct solution to this problem is yours. private key. Because that question was generated with your private key, only you can answer the answer at the first time, and the Bitcoin belongs to you. Therefore, the private key must not be shared with others.
So what is a public key?
Let me give you an example: Suppose Amin wants to transfer a BTC to his girlfriend Xiaoxiao. Amin needs to use his private key to sign the transaction, but how can others know that Amin has the right to use this BTC? And what about ownership? How to determine that this transaction was sent by A Ming? When A Ming uses his private key to sign the transaction, he will also send his public key. So when everyone sees Xiao Ming's public key, they know that Xiao Ming does own the BTC and the transaction is valid.
The wallet address is a string derived from the public key after a series of operations. This process is also irreversible, and the public key cannot be calculated even if the address is known.
How to find the private key and keep it safe?
If you have ever forgotten your password when you first started using your wallet, and then couldn’t open the wallet, you had to delete the wallet.dat file and let the system generate another one. At this time, the feeling is about the same as burying a sum of money in the wallet. I went to a planet at a certain moment in the universe, and then lost the coordinate map, because the Bit world only recognizes the private key and not the ID card. If you lose it, it is lost and you can never get it back. The best way to protect it is to find the private key and write it down on paper, and then lock the paper in a safe.