【链圈知识】区块链钱包(Block Chain Wallet)

资讯 2024-06-25 阅读:37 评论:0
美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

文|李伟志

Wen Weizhi Li

钱包是存储和使用数字货币的工具,在区块链领域有举足轻重的地位。密钥的管理工具,它只包含密钥而不是确切的某一个代通证;钱包中包含成对的私钥和公钥,用户用私钥来签名交易,从而证明该用户拥有交易的输出权;而输出的交易信息则存储在区块链中;用户在使用钱包时, 你的 Keystore, 助记词, 明文私钥, 都是钱包;Keystore 是你加了”锁”的钱包,而助记词和明文私钥是完全暴露在外的钱包,没有任何安全性可言,所以在使用助记词和明文私钥时,一定要注意保密。

Wallet is a tool for storing and using digital money and has a significant place in the area of the block chain. Key management tool, which contains only a key rather than an exact transient; wallets contain pairs of private and public keys, and the user signs the transaction with a private key to prove that the user has the right to export the transaction; while the exported transaction information is stored in the block chain; users use wallets, your Keystore, helpwords, explicit private keys, are wallets; Keystore is your wallet with a lock, and the notes and explicit private keys are completely exposed wallets, with no security to say, so keep confidentiality when using notes and explicit private keys.

几个概念

Several concepts

钱包地址

Wallet Address

它类似于银行卡号,一个人可以拥有多张银行卡,所以他也可以拥有多个钱包地址。一个钱包地址只能对应一个私钥。在一个钱包中,可以拥有多个钱包地址。

It's similar to a bank card number, so a person can have more than one card, so he can have more than one wallet address. A wallet address corresponds to only one private key. In a wallet, he can have more than one wallet address.

公钥

Public Key

它是密码学上的概念,它由私钥推算出来。公开密钥的算法属于不对称加密算法,该算法拥有两个密钥:公钥和私钥。使用私钥加密的数据可以用公钥解密,反之亦可。通过公钥可以算出钱包地址。哈希加密技术目前的技术水平是不可逆的,也就是说通过公钥几乎不可以倒推出来私钥,所以可以认为这种方法比较安全。一般情况,我们转账都用一个收币地址,这是通过公钥转化过来的,是公钥的缩减版本,公钥和收币地址之间是可以相互转换的。

It is a cryptographic concept that is derived from private keys. The algorithm for public keys is an asymmetrical encryption algorithm, which has two keys: public and private keys. Data that are encrypted with private keys can be decrypted by public keys, and vice versa. The wallet address can be calculated by public keys. The current level of technology in Hashi encryption is irreversible, that is to say, private keys that can hardly be rolled out backwards through public keys, so this method can be considered safe. In general, we transfer money using a currency address, which is converted through public keys, a reduced version of public keys, which can be converted between public keys and currency addresses.


私钥

Private Key

私钥=keystore+密码,私钥是由五六十位包含数字和区分大小写的字母所组成。私钥可以计算出公钥,公钥可以经过一系列数字签名生成钱包地址。所以, 私钥的持有者才是数字货币的持有者。为了方便数字资产交易,用简单的密码加上keystore我们就能便捷的转移数字资产。助记词是加密了的私钥,基本也就是私钥,它是为了便于导出keystore而发明的。

The private key = keystore+ password, which consists of 50-digit and case-specific letters. The private key calculates the public key, and the public key generates the wallet address through a series of digital signatures. So, the private key holder is the holder of the digital currency. To facilitate digital asset transactions, we can easily transfer digital assets with simple passwords and keystore.


助记词

Helpword

这么多个字节可怎么记呢?所以有的钱包就就出现了助记词,一般情况下,助记词由一些单词组成,只要你记住这些单词,按照顺序在钱包中输入,也能打开钱包,对吧,单词可比一串代码好记多了。

How can so many bytes be written? So there are wallets that have assistive notes, which typically consist of words that you can open if you remember them, type them sequentially in the wallet. Right? Words are much better than a string of codes.

keystore

有的钱包会采取把私钥制作成keystore让用户导出保存,这个Keystore就是私钥经过加密过后的一个文件,需要你自己设置的密码才能打开文件。这样的好处是就算keystore文件被盗,只要你额外设置的密码够长够随机,那么短时间内私钥也不会泄露,有充足的时间转移地址里面的加密货币到其他地址。

Some wallets take the form of keystore, which is a file that has been encrypted. The advantage is that even if the keystore file is stolen, the private key will not be leaked for a short period of time, and there will be enough time to transfer the encrypted currency in the address to another address.

  钱包背后的密码学原理

The cryptography behind the wallet

随机数

Random

随机数是专门的随机试验的结果。在钱包中随机数用于生成私钥,因其相关安全性的重要性,所以必须保证随机数具备以下三种特性:

Random numbers are the result of ad hoc random tests. Random numbers in wallets are used to generate private keys, and because of the importance of their related security, the following three characteristics must be guaranteed:

  随机性:不存在统计学偏差,完全杂乱的数列;

Randomity: there are no statistical deviations and completely disorganized columns;

  不可预测性:不能从过去数列推测下一个出现的数;

(a) Predictability: it is not possible to extrapolate the next number from the previous list;

  不可重现性:除非将数列保存下来,否则不能重现相同的数列。

Non-recurrence: The same columns cannot be repeated unless the columns are saved.

  也就是真随机数。当然,实际上只要给定边界条件,真随机数并不存在。但目前大多数的看法是密钥存在一定的循环周期,只要该周期足够长,也会有足够好的安全性和保密性。

Of course, a random number does not exist as long as the border conditions are given. But at present, most views are that the key has a certain cycle, which, as long as it is long enough, also has a good level of security and confidentiality.

非对称加密

Asymmetric encryption

  非对称加密算法于1976年提出,用于在不安全的媒体上解决信息公开传送和密钥管理的问题。它将一般的密钥分为加密密钥和解密密钥,也就是我们常说的公钥和私钥。公钥私钥一一对应,由公钥加密的密文,必须使用与公钥配对的私钥才可以解密。如下图所示,甲乙之间使用非对称加密的方式完成了重要信息的安全传输。

Asymmetric encryption algorithms were introduced in 1976 to address the issue of public transmission of information and key management in unsafe media. They divide general keys into encryption keys and de-keys, which are what we usually call public and private keys. The public key private key corresponds to a private key that must be paired with a public key in order to declassify it. As shown in the figure below, A.B. performs the secure transfer of important information using asymmetric encryption.

  乙方生成一对密钥(公钥和私钥)并将公钥向其它方公开。

B generates a pair of keys (public and private) and makes the public key available to the other party.

  得到该公钥的甲方使用该密钥对机密信息进行加密后再发送给乙方。

The first party to which the public key is obtained uses the key to encrypt the classified information and then sends it to the second party.

  乙方再用自己保存的另一把专用密钥(私钥)对加密后的信息进行解密。乙方只能用其专用密钥(私钥)解密由对应的公钥加密后的信息。

B then decrypts the encrypted information with another special key (private key) saved by itself. B only decrypts the information encrypted by the corresponding public key with its exclusive key (private key).

  在传输过程中,即使攻击者截获了传输的密文,并得到了乙的公钥,也无法破解密文,因为只有乙的私钥才能解密密文;同样,如果乙要回复加密信息给甲,那么需要甲先公布甲的公钥给乙用于加密,甲自己保存甲的私钥用于解密。

During the transmission, it was not possible to decipher the message, even if the transmission was intercepted by the assailant and the public key of B was obtained, since only the private key of B could decipher it; similarly, if B was to reply to encrypted information to A, the public key of A was required for encryption and the private key of A was used for decrypting.

单向散列函数

Single hash function


单向散列函数又称为单向Hash函数、杂凑函数。它有一个输入和一个输出,输入称为消息,输出称为散列值(也称为消息摘要)。单向散列函数可以把任意长度的输入串变化成固定长的输出串,也就是可以根据消息的内容计算出散列值,而散列值就可以用来检查消息的完整性。由于它的单向性,其输出不依赖于输入。已知一个散列值,要找到预映射的值,使它的散列值等于已知的散列值在计算上是不可行的。单向散列函数的安全性使它主要用于完整性效验和提高数字签字的有效性。

A one-way hash function is also called a one-way Hash function. It has an input and an output that is called a message, an output called a hash value (also known as a message summary). A single hash function can change the input string of any length into a fixed long output string, that is, it can calculate the hash value based on the content of the message, while a hash value can be used to check the integrity of the message. Because of its one-way nature, its output is not dependent on input. A hash value is known to find a premap value, making its hash value equal to the known hash value is not feasible for calculation. The security of the one-way hash function makes it primarily for completeness purposes and enhances the validity of the digital signature.

比特币的地址生成过程

The process of generating the address of bitcoin

  流程是:私钥--》公钥--》地址。

The process is the private key -- the public key -- address.


私钥是一个256位随机数,所谓256位就是256个0和1组成的数字,256除以8等于32,即32个字节,用16进制表示这个数的范围大小是介于0x0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0000 0001 ~ 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4141之间的一个数。

The private key is a 256-digit random number. The 256-digit figure is a 256-digit number of 0 and 1 and 256 is divided by 8 equals 32 bytes, or 32 bytes, and the 16-digit size of this number is between 0x0000000000000000000000000000000000000000000000000000000000000000000000000010x0x5x5x2000000000000000001 ~ 0x5x2 #2 #FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D03641

我们随机生成一个合法的私钥如下:8F72F6B29E6E225A36B68DFE333C7CE5E55D83249D3D2CD6332671FA445C4DD3

We randomly generate a valid private key as follows: 8F72F6B29E6E225A36B68FE333C7CE5E55D3D3D2CD632671FA445C4DD3

? ? ? 椭圆曲线算公钥

♪ Ellipse is the public key

生成了私钥之后,我们使用椭圆曲线加密算法(ECDSA-secp256k1)计算0406CCAE7536386DA2C5ADD428B099C7658814CA837F94FADE365D0EC6B1519385FF83EC5F2C0C8F016A32134589F7B9E97ACBFEFD2EF12A91FA622B38A1449EEB

After generating the private key, we calculated 0406CCAE 7536386DA2C5AD428B099C768814CA837F94AFADE365D0EC6B159385EC5F2C0C8F016A32134589F7B9E97AFEFD2AF191AFA6222B38A1449EEB

  对公钥哈希技术

To Public Key Hash Technology

对上面的公钥进行SHA-256哈希计算,得到结果:2572e5f4a8e77ddf5bb35b9e61c61f66455a4a24bcfd6cb190a8e8ff48fc097d

Ha-256 HS calculation of the public key above. Results obtained: 2572e5f4a8e77df5bb35b9e61c61f66455a4a24bfd6cb190a8e8ff48fc097d

  计算 RIPEMD-160哈希值

Calculate RIPEMD-160 HS

  取上一步结果,进行RIPEMD-160计算,得到结果:

Taking the previous step, the RIPEMD-160 calculation was carried out, and the results were:

0b14f003d63ab31aef5fedde2b504699547dd1f6

  加入地址版本号

Add Address Version Number

比特币主网版本号“0x00”,取上一步结果,在前面加上16进制的00,即:000b14f003d63ab31aef5fedde2b504699547dd1f6

Bitcoin's main network version number "0x00", with the following step: 000b14f003d63ab31aef5fedde2b504699547d1f6

  计算 SHA-256 哈希值

Calculate SHA-256 Hashi value

  取上一步结果,进行SHA-256计算,可得:

Based on the results of the preceding step, which was calculated by SHA-256, it was possible to:

 ddc2270f93cc84cc6869dd373f3c340bbf5cb9a8f5559297cc9e5d947aab2536

  然后,对以上结果再次计算 SHA-256 哈希值,得到:

Then again, the SHA-256 Hashi value was calculated for the above results, and obtained:

869ac57b83ccf75ca9da8895823562fffb611e3c297d9c2d4612aeeb32850078

  取上一步结果的前4个字节(8位十六进制)869ac57b

Top 4 bytes (8-hexadecimal) for last step result 869ac57b

把这4个字节加在第五步的结果后面作为校验位,将这4个字节加载第五步的结果后面,这就是比特币地址的16进制形态了:869ac57b000b14f003d63ab31aef5fedde2b504699547dd1f6

Add these four bytes to the results of step five as a verification, and then add the four bytes to the results of step five, which is the 16-form format of the Bitcoin address: 869,ac57b000b14f003d63ab31aef5fedde2b5046994547dd1f6.

  用Base58编码变换地址

Change address with Base58 code

  对上一步的结果进行Base58编码,得到:

Base58 encoded the results of the previous step and obtained:

1QCXRuoxWo5Bya9NxHaVBArBQYhatHJrU7


on-chain

  给一个钱包地址发送数字货币, 这笔交易在全网广播、被确认、被打包进区块。这是发生在链上的,被称为on-chain交易。on-chain钱包需要自己保管私钥。

Sends a digital currency to a wallet address, the transaction is broadcast on the Internet, confirmed, and packed into blocks. This happens on the chain and is referred to as an-chain transaction. On-chain wallets need to keep their own private keys.

off-chain

  相对于on-chain交易是off-chain交易。通常,通过交易所进行的交易是off-chain的,本人并没有私钥。私钥在交易所,由交易所托管。所以交易所的钱包也是中心化的钱包。

The transaction is off-chain. Usually, the transaction is carried out by off-chain and does not have a private key. The private key is on the exchange and is held by the exchange. So the wallet of the exchange is also a central wallet.

冷钱包

Cold Wallet

  冷即离线、断网,也就是说私钥存储的位置不能被网络所访问。例如纸钱包、脑钱包、硬件钱包等等。

Cold is offline, offline, or offline, i.e. the location where the private key is stored cannot be accessed by the network. For example, paper wallets, brain wallets, hardware wallets, etc.

热钱包

Hot wallet

  热即联网,也就是私钥存储在能被网络访问的位置。 例如存放在交易所的、在线钱包网站、手机App钱包都属于热钱包。热钱包往往是在线钱包的形式。使用热钱包时,最好在不同平台设置不同密码,且开启二次认证,以确保自己的资产安全通常而言,冷钱包更加安全,热钱包使用更加方便。

The hot wallets are often in the form of online wallets. When using the hot wallets, it is better to set different passwords on different platforms and to open a second authentication to ensure the safety of their assets, which is usually safer and easier to use.

全节点钱包

Full Node Wallet

  除了保存私钥外,全节点钱包还有保存了所有区块的数据,最为著名的是bitcoin-core。

In addition to keeping private keys, the full node wallet contains data on all blocks, most well known as bitcoin-core.

轻钱包

Light Wallet

  它不必保存所有区块的数据,只保存跟自己相关的数据。基本可以实现去中心化。

It does not have to store data on all blocks, but only data about itself.

中心化钱包

Centralized Wallet

  在交易所中的钱包,以及类似 OKLink 提供的保险柜服务。

Wallet in exchange and safe service similar to that provided by OKLink.

作者:李伟志,区块链行业作者

Author: Li Wei Zhi, Art. of the Block Chain Industry

美化布局示例

欧易(OKX)最新版本

【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   全球官网 大陆官网

币安(Binance)最新版本

币安交易所app【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址

火币HTX最新版本

火币老牌交易所【遇到注册下载问题请加文章最下面的客服微信】永久享受返佣20%手续费!

APP下载   官网地址
文字格式和图片示例

注册有任何问题请添加 微信:MVIP619 拉你进入群

弹窗与图片大小一致 文章转载注明

分享:

扫一扫在手机阅读、分享本文

发表评论
平台列表
美化布局示例

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 0.00003374个比特币等于多少人民币/美金

    0.00003374个比特币等于多少人民币/美金
    0.00003374比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00003374比特币等于2.2826 1222美元/16.5261124728人民币。比特币(BTC)美元(USDT)人民币(CNY)0.00003374克洛克-0/22216.5261124728比特币对人民币的最新汇率为:489807.72 CNY(1比特币=489807.72人民币)(1美元=7.24人民币)(0.00003374USDT=0.0002442776 CNY)。汇率更新于2024...
  • 12年怎么购买比特币?比特币投资,轻松掌控

    12年怎么购买比特币?比特币投资,轻松掌控
    12年怎么购买比特币?买卖比特币可以通过以下交易所进行购买,分别是:欧易官网平台、ZG交易所、艾戴克斯交易所、C2CX交易软件、BaseFEX交易APP、波网交易平台、安银交易所、BitMart交易软件、紫牛币交所交易APP和澳网(AOMEX)交易平台等等十大平台下载,高效安全的数字货币交易平台。How do you buy bitcoins in 12 years? Bitcoins can be purchased through ten major platforms...
  • 134 USD toBTC Calculator -

    134                            USD                        toBTC                        Calculator -
    For the week (7 days) Date Day 134 USD to BTC Changes Changes % June...
  • 0.00006694个比特币等于多少人民币/美金

    0.00006694个比特币等于多少人民币/美金
    0.00006694比特币等于多少人民币?根据比特币对人民币的最新汇率,0.00006694比特币等于4.53424784美元/32.5436 16人民币。比特币(BTC)美元(USDT)人民币(CNY)0.000066944.53424784【比特币密码】32.82795436 16比特币对人民币的最新汇率为:490408.64 CNY(1比特币=490408.64人民币)(1美元=7.24人民币)(0.00006694USDT=0.0004846456 CNY)汇率更新时...
  • 0.00015693个比特币等于多少人民币/美金

    0.00015693个比特币等于多少人民币/美金
    0.000 15693比特币等于多少人民币?根据比特币对人民币的最新汇率,0.000 15693比特币等于10.6 1678529美元/76.86554996人民币。比特币(BTC)【比特币价格翻倍】美元(USDT)人民币(CNY)0.000/克洛克-0/5693【数字货币矿机】10.6 167852976.8655254996比特币对人民币的最新汇率为:489,807.72 CNY(1比特币= 489,807.72人民币)(1美元=7.24人民币)(0.00015693 U...
标签列表