According to incomplete statistics, more than 2 billion US dollars have been lost in digital currency exchanges, thus revealing the biggest bottleneck in the current development of the exchange field – the issue of asset security. How can we solve the pain point of exchange asset security? When it comes to blockchain exchange wallet development, some investors may choose to build their own team to develop independently or use a wallet system specially developed by a third-party developer.
First of all, it should be clear what is a blockchain wallet?
Blockchain wallet refers to a management tool for virtual digital currency products developed using blockchain technology. It includes the characteristics of digital currency that can be traded, in short, payment and collection.
Payment refers to the ability to transfer digital assets in anto other addresses. The premise is that you must have the private key of the payment address. Holding the private key of the address can control the digital assets of the address;
Receipt means that it can generate a valid address that conforms to the rules of the chain, and other addresses can transfer funds to this address.
Introduces the development process of Bitcoin wallet and Ethereum wallet, including the main functions of the wallet:
Create wallet, wallet balance, export wallet, wallet transfer, etc.
Demo address definition
You can think of a blockchain wallet as a bank account system. It manages your assets on the blockchain and can check balances, transfer funds, collect accounts, and view transaction records. The wallet application is equivalent to a bank. client to implement the specific functions of the wallet. Your private key is equivalent to the password of your bank account, and your address is equivalent to the bank’s bank card number.
The ways to manage private keys are roughly divided into cold wallets, hot wallets, soft wallets, and hardware wallets.
Send digital currency to a wallet address, and the transaction is broadcast across the entire network, confirmed, and packaged into blocks. This happens on-chain and is called an on-chain transaction. On-chain wallets need to keep their own private keys.
Relative to on-chain transactions are off-chain transactions. Usually, transactions conducted through exchanges are off-chain, and I do not have a private key. The private key is on the exchange and is hosted by the exchange. Therefore, the wallet of the exchange is also a centralized wallet.
In a cold wallet, you write your private key on paper, or print it as a QR code on paper, or write it down in your head. This type of wallet is generally for the safe storage of private keys. It does not have the functionality of a wallet. any other function
A hot wallet does not keep its own private key, but the wallet developer saves the private key on the server. All your wallet operations must go through server operations. This kind of wallet is equivalent to completely handing over your assets to Because it is the most unsafe wallet, few people will use this kind of wallet
Soft wallets store private keys locally on the client instead of on the server. Users can manage their own private keys, which is much safer than hot wallets. Soft wallets are divided into “full node wallets” and “light wallets”.
All points money
The package is generally the wallet software officially provided by the wallet. It will synchronize all the node data to the local, so it will take a long time to synchronize the data, and it will occupy a lot of hard disk storage space, so it is relatively easy to use for individual users. Cumbersome, that is to say not suitable for individual users
It refers to unsynchronized nodes. The transfer uses offline signatures and is then broadcast through the server node. Its private key is also saved locally on the client. Users can manage it themselves and can use it on mobile devices such as mobile phones, so now it is the most This kind of “soft wallet” is popular, and the following series of articles are basically about the development of “light wallet”
A hardware wallet refers to a hardware device with a simple embedded system. It is connected to a computer through USB and can create private keys and addresses on the hardware device. Offline signatures are also hardware-operated, and the hardware manages your private key. This is currently the most secure wallet, but the price is relatively expensive. The more popular hardware wallets on the market are probably: TREZOR, Ledger, Keepkey, Kushen, etc. If you are interested, you can search online.
The role of the private key in the wallet:
1. Generate a public key, and then generate an address from the public key (similar to WeChat’s payment QR code)
2. Sign to ensure the correctness of the transaction (similar to payment password)
The information of the blockchain network is stored on the nodes, and each node has the transfer information of the entire network. Therefore, if the information is to be tampered with, the information of more than half of the nodes in the entire network must be tampered with in a short period of time. In theory, it is very safe. of
Generate private key
So how is the private key generated? In fact, it is a 256-bit binary random number. The purpose of randomness is to ensure that it is not repeated. There are of course many random methods. For example, you can toss a coin 256 times. Heads will be recorded as 1, tails as 1. Remember 0.
How does the computer implement it? It uses cryptography to safely and randomly generate a string, and then performs the SHA256 hash algorithm to generate the private key.
Of course, this is just the original private key. Different blockchain networks need to be formatted differently to generate the private key corresponding to the blockchain network.