一文搞懂比特币的原理

资讯 2024-06-25 阅读:115 评论:0
(1)物物交换 xff08; 1...
美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

APP下载   官网地址

(1)物物交换

xff08; 1xff09; material exchange

世界上有一个与世隔绝小村庄叫做比特村,村庄共有几百户人家,村民们自给自足,一直过着物物交换的生活,比如,老张拿一袋面粉换老李的一只羊。

There is a small isolated village in the world called the village of Bit xff0c; there are hundreds of households in the village xff0c; the villagers are self-sufficient xff0c; they have been living in an exchange of goods xff0c; e.g. xff0c; Old Zhang is exchanging a bag of flour for a sheep of Lee.

在这里插入图片描述
(2)一般等价物

 Insert here the picture description
&#ff08; 2) general equivalents

随着比特村的物品越来越丰富,这时不管是种苹果的还是养羊的,每天都得搞清楚几十种商品的相对价格。为了解决物物交换的问题,村民决定将黄金作为一般等价物,用黄金来表示商品价格,从而产生了货币的概念,比特村进入了货币商品交换阶段。

As the goods of the village of Bit get richer and richer xff0c; when they grow apples and goats xff0c; when they have to figure out the relative prices of dozens of commodities every day xff0c; when they decide to use gold as a generic equivalent xff0c; when they use gold to represent commodity prices xff0c; when they produce the concept of currency xff0c; and when the village of Bit is entering the currency exchange phase.

在这里插入图片描述
(3)符号货币

 insert here the picture description
strang>( 3xff09; sign currency

随着物品交易数量和金额增加,对货币的需求越来越大,而黄金的开采费时费力。村民们决找张纸,写上“一克黄金”,就代表一克黄金。但这张纸只有德高望重的老村长签名的纸才有效,这样老村长就按照各家黄金的存量发给大家等量的纸币。比特村进入了符号货币(纸币)时代,而老村长就承担了政府和银行的角色。

As the volume and amount of goods are traded up xff0c; the demand for money is growing xff0c; and gold mining is time-consuming and time-consuming. Villagers decide to find a piece of paper xff0c; write “one gram of gold” xff0c; that represents one gram of gold. But this piece of paper is valid only if it is signed by an old village chief of high moral value xff0c; so that the old village chief issues the same amount of paper to everyone as the stock of gold. The village of Bit has entered the sign currency xff08; the bank notes #xff09; the era #xff0c; and the old village chief has assumed the role of government and bank.

在这里插入图片描述
(4)中央虚拟货币

insert picture description

随着交易的发展,村民们发现纸币也完全没有存在的必要。因为既然大家都信任老村长,也信任老村长发行的纸币,可以由村长维护一个记录每户的纸币数量账本,当老张用一克黄金换老李一只羊时,只需要在村长的账本上将老张的黄金减一克,将老李黄金加一克,就完成了交易。比特村进入了中央虚拟货币时代,正如凯恩斯在《货币论》中指出:“记账货币是表示债务、物价与一般购买力的货币。”
在这里插入图片描述

xff0c; villagers find that there is no need for paper coins to exist. Because everyone trusts the old village chief xff0c; also trusts the old village chief xff0c; it is possible for the village chief to maintain a bank account book that records the number of banknotes per household xff0c; xff0c when the old banknote is exchanged for an old Lee sheep xff0c; only need to reduce the old gold by xff0c on the village chief's books xff0c; complete the transaction.

(5)分布式数字货币

xff08; 5xff09; distributed digital currency

随着老村长年事已高,村民们选出了新一任村长。新一任村长拿着账本,心想这全村各户谁有多少钱岂不是我说了算,同时村民们也发现,这个体系完全依赖于账本持有人的个人信用,如果这个人随意篡改账本,整个货币系统将会崩溃。

As the old village chief's old age is high xff0c; the villagers have elected a new village chief. The new village chief has a book xff0c; I can't say how much money each household has in this village xff0c; and the villagers find xff0c; the system is entirely dependent on the personal credit of the account holder xff0c; if this person randomly alters the account book xff0c; the entire monetary system will collapse.

当村民们不知所措之时,一个叫中本聪的村民走上台,告诉大家他设计了一套不依赖任何中央机构或个人的分布式数字货币系统。

When the villagers were out of control #xff0c; a villager called Nakamoto took to the stage #xff0c; he told everyone that he had designed a distributed digital monetary system that did not depend on any central agency or individual.

  • 账簿上不再记载每户村民的余额,而是记录从账簿创建开始到当前所有的交易记录。只要账簿的初始状态确定,每一笔交易记录可靠并有序,可以推算出当前每个人持有多少钱。
  • 账簿公开,任何村民都可以获得当前完整的账簿。

这套系统中虽然账簿公开,任何人在交易时都不使用真实身份,而是使用一个唯一的代号,通过密码学技术确保在不暴露真实身份的情况下交易。

This system, although the books are publicly available xff0c; no one uses a real identity xff0c at the time of the transaction; instead, it uses a unique code xff0c; and by cryptography ensures that the transaction is conducted without revealing the true identity.

(1)对称密码体制

& #xff08; 1xff09; symmetric cryptographic system

对称密码体制(Symmetric Key Cryptosystem)又称单钥密码体制(One Key Cryptosystem)、秘密密钥密码体制(Secret Key Cryptosystem)。对称密码体制中,密钥必须完全保密,且加密密钥和解密密钥相同,或其中的一个可以很容易地推出另一个。

Symmetric cryptography & #xff08; SymmetsyKey Cryptosystem) also known as the single key cryptography & #xff08; OneKey Cryptosystem) Secret Key System & #xff08; Secret Key Cryptosystem). In the symmetric cryptography xff0c; keys must be completely confidential xff0c; and encryption keys are identical #xff0c; or one of them can easily launch another.

M = D k 2 ( E k 1 ( M ) ) M= D_{k_2}(E_{k_1}(M)) M=Dk2??(Ek1??(M))

其中, k 1 = k 2 k_1 = k_2 k1?=k2? k 1 k_1 k1?容易推出 k 2 k_2 k2?
在这里插入图片描述
典型算法有DES、3DES、AES、IDEA、RC4等。对称密码体制的密钥相对较短,密文的长度往往与明文长度相同,具有较快的加解密速度,易于硬件实现。但发送方如何安全、高效地把密钥送到接收方是对称密码体制的软肋,往往需要“安全通道”,此外称密码体制密钥量大,难于管理。

xff0c;

(2)非对称加密

( 2) asymmetric encryption

1976年,Whitefield Diffie和MartinHellman在《密码学的新方向》(New Directions in Cryptography)中开创性的提出了非对称密码体制(Asymmetric Key Cryptosystem),又称公钥密码体制(Public Key Cryptosystem)、双钥密码体制(Double Key Cryptosystem)。

1976 & #xff0c; Whitefield Diffie and Martin Hellman, in New Directions in Cryptography, pioneered the creation of an asymmetric cryptography (Asymmetric Key Cryptosystem) & #xff0c; also known as Public Key Password System (Public Key Cryptosystem), and Double Key Password System (Double Key Cryptosystem).

该体制中,用户 A A A有一对密钥:加密密钥(公钥 k p k_p kp?和解密密钥(私钥 k s k_s ks?,两者是不同的,且从加密密钥(公钥)无法推出解密密钥(私钥)。

xff0c; user

B B B要给 A A A发送信息 M M M,需要用 A A A的加密密钥(公钥) k p k_p kp?(可在公开目录中查找)加密消息: E k p ( M ) E_{k_p}(M) Ekp??(M)

If

A A A收到密文后,用自己的解密密钥(私钥) k s k_s ks?解密密文: M = D k s ( E k p ( M ) ) M= D_{k_s}(E_{k_p}(M)) M=Dks??(Ekp??(M))
在这里插入图片描述
公钥密码体制的设计最终归结为一个陷门单向的数,常见公钥密码体制包括基于大整数因子分解问题的RSA公钥密码体制,基于有限域乘法群上的离散对数问题的ElGamal公钥密码体制,基于椭圆曲线上离散对数问题的椭圆曲线公钥密码体制等。非对称密码体制主要是为了解决对称密码体制中的密钥分发和管理问题,与对称密码体制相比,非对称密码体制加解密速度较慢,密钥较长,密文长度往往大于明文长度。

(3)哈希函数

xff08; 3xff09; Hashi function

Hash函数也称哈希函数/散列函数、杂凑函数,是一个从消息空间到像空间的不可逆映射,可将“任意”长度的输入经过变换以后得到固定长度的输出。它是一种单向密码体制,即只有加密过程,不存在解密过程。常用Hash函数包括:MD5、SHA1、SHA256、SHA384和SHA512等。
在这里插入图片描述
Hash函数的单向性输出长度固定的特征使其可生成消息的“数字指纹”(Digital Fingerprint),也称消息摘要(MD,Message Digest)哈希值/散列值(Hash Value),主要应用于消息认证数字签名口令的安全传输与存储文件完整性校验等方面。

The Hash function is also called the Hash function / hash function & hash function xff0c; is an irreversible map xff0c from message space to space like xff0c; is an output of fixed length after changing the input of an arbitrary length . It is a one-way cryptographic system xff0c; only the encryption process xff0c; there is no declassified process. The Hash function consists of xff1a; xff1a; HD5, SHA256, SHA384 and SHA512 >.

Digital signature & #xff0c; also referred to as electronic signature & #xff0c; refers to a specific set of symbols or codes attached to an electronic document. It uses password technology to extract and authenticate key information from an electronic document to form xff0c; uses the identity of the issuer and the author's approval of the electronic document xff0c; and is able to be used by the recipient to verify whether the electronic document has been tampered with or falsified during transmission.
int=500

  • 发送方A将消息用Hash算法产生一个消息摘要(Message Digest)
  • 发送方A用自己的私钥对消息摘要进行加密,这个加密后的息摘要就是数字签名
  • 发送方A将消息与签名发给接收方B
  • 接收方B接收到消息及其名后,用发送方A的公钥解密这个签名,获得由发送方A生成的消息摘要
  • 接收方B用发送方A所用Hash算法重新生成所获得消息的摘要,对比这两个摘要。若相同说明签名是发送方A针对这个消息的有效签名,否则签名无效

2008年,SatoshiNakamoto(中本聪)论文《Bitcoin:APeer-to-Peer Electronic Cash System》(《比特币:一种点对点的电子现金系统》成为了比特币(BitCoin)诞生的标志性作品

2008 xff0c; SatoshNakamoto (medium-brain) paper, Bitcoin:Apeer-to-Peer Electronic Cash System (bitcoin: an electronic cash system for point-to-point) became the landmark by which BitCoin was born .

比特币是一种去中心化、无需第三方信任的电子货币,基于点对点网络和密码学工具实现。

Bitcoin is a decentralised electronic currency that does not require third-party trust xff0c; it is based on point-to-point networks and cryptography tools.

  • 比特币按照特定算法(比特的核心代码是开源的)通过计算产生。
  • 在交易过程中使用数字签名来验证交易信息的真实性,同时采用了哈希算法来对区块链上的数据进行验证。
  • 使用整个P2P网络中众多节点构成的分布式数据库来确认并记录所有的交易行为;网络中的每一个节点都会保存整个区块链的副本,这保证了区块链的完整性和一致性。

比特市与Q币、游戏币等其他虚拟货币的区别

the difference between the city of Bit and other virtual currencies, such as Q-coin, game currency

  • Q币是中心化的虚拟货币,人们购买Q币都是基于对腾讯公司(QQ的拥有者)的信任;而比特币是去中心化的数字货币,并没有一个企业或者机构真正对比特币负责。
  • Q币的所有信息都保存在腾讯公司的服务器和数据库上,腾讯公司通过安全手段来和防止其他人篡改数据库信息,但腾讯公司具备修改信息的可能。比特币的所有交易信息,保存在比特币交易者的电脑上,没有一个中心数据库,它依靠严密的算法,保证只对一台电脑的数据进行修改,无法影响整个比特币的正常运行。
  • Q币的发行数量是可以不断增加的,比特币的发行数量是固定的,它依靠严密的算法保证了没人可以修改比特币的发行数量。

比特币的交易是由比特币网络中的参与者来共同完成的,这些参与者之间互相发送比特币,以此来完成资产的转移。

The Bitcoin transaction was performed jointly by participants in the Bitcoin network xff0c; the participants sent Bitcoin xff0c to each other as a means of completing the transfer of assets.

用户在交易前需要选择自己合适的比特币钱包,以存储和管理自己的比特币。比特币钱包是一种特殊文件,存放私钥,通过钱包可以访问多个比特币地址

Users need to select their own appropriate bitcoin wallets xff0c; to store and manage their own bitcoins prior to the transaction. bitcoins are special files xff0c; store private keys xff0c; access several bitcoins through wallets.

一个比特币地址是一个字符串,由数字和字符组成,每个比特币地址都有着自己的比特币数量余额

A bitcoin address is a string xff0c; xff0c consisting of numbers and characters; each bitcoin address has its own bitcoin quantity balance .

比特币用户可以创新任意多个地址,当创建一个比特币地址,实际上是生成了一个公钥/私钥对,一个比特币地址代表一个公钥(公钥允许任何人可以验证使用对应私钥签名的消息),而私钥则保存在钱包里

bitcoin users can invent any number of addresses xff0c; when creating a bitcoin address xff0c; actually generating a public key/private key pair xff0c; a bitcoin address representing a public key xff08; a public key allowing anyone to verify a message using a corresponding private key signature xff09; xff0c; and a private key stored in a wallet .

在这里插入图片描述

insert picture description

比特币交易的过程分为以下四个步骤:

The process of Bitcoin transactions is divided into the following four steps xff1a;

(1)新建地址:Bob创建一个比特币地址

xff08; 1xff09; new address: Bob creates a bitcoin address

(2)交易发起:Alice使用比特币钱包里的一个私钥对她的交易申请(包含交易金额与Bob的比特币地址)进行签名。此时,网络上的任何人都可以使用对应公钥对这个交易申请进行验证。

(2) transaction initiation: Alice uses a private key in the Bitcoin wallet to sign her transaction application (including the amount of the transaction and Bob's Bitcoin address). At this point xff0c; anyone on the network can authenticate the transaction application using the corresponding public key.

(3)交易广播:Alice将该交易在网络中进行广播。

( 3) trade broadcast : Alice broadcast the transaction on the Internet.

(4)交易确认:矿工收集过去十分钟内的交易数据,并将将验证通过的交易信息打包形成一个新的“交易块”,矿工会基于前一个哈希值、新交易块以及随机数计算新的哈希值。哈希值为特定的格式:以一串特定数量的0开始。每个区块都包含一个名为coinbase的初始交易,这个交易为挖矿的胜出矿工所得。将新的“交易块”添加到区块链,这笔交易就被认为是完成了,并且不能被修改或者撤销。

( 4) transaction confirmation : miners collect transaction data for the past 10 minutes xff0c; and will package validated transaction information into a new “trade block” xff0c; the union calculates the new Hashi value based on the previous Hashi value, new trade block and random numbers. Hashi value is a particular format: starting with a specific number of zeros. Each block contains an initial transaction named coinbase xff0c; this transaction is the proceeds of the mine-digging success. Add the new “trade block” to the block chain xff0c; the transaction is considered to have been completed #xff0c; and cannot be modified or revoked.

在这里插入图片描述

insert picture description

(1)双花

xff08; 1xff09;

双花对于中心化的电子货币,每一笔交易都会经过权威中心的确认。比如,对于同时发起的两比转账行为,权威中心会按照时间顺序来处理,不会存在重复支付的问题。

double flowers for centralised electronic currencyxff0c; each transaction is confirmed by a central authority. For example xff0c; for simultaneous two-to-one transfers xff0c; for authority centres to deal with xff0c in chronological order; there is no problem of duplicate payments.

对于去中心化的比特币,为了确保不存在双重支付,有如下要求:

For decentralised bitcoinxff0c; to ensure that there is no double paymentxff0c; the following requirements:

  • 所有交易全网公开
    • 历史交易全网公开,确保每个账号里面有多少比特币,并不是由一个数据来表示,而是根据历史交易得出来的。
  • 需要有时间戳,所有交易有先后顺序
    • 所有交易按照先后顺序,给其加上时间戳,下一笔交易是基于上一笔交易来生成的,整个交易就是一个交易链,这样才能保证不被双重支付,并且这个是经过全网公认的,才能保证不被造假。
  • 需要对额外的资源对交易进行确认:
    • 每笔交易的有效性通过工作量证明由全网50%以上的算力来证明。全网算力(50%以上)类似一个权威中心,由这些算力对交易进行确认,只不过它不是一个中心,而是由很多机器,通过竞争对交易进行确认。

(2)工作量证明

xff08; 2xff09; workload certification

比特币网络中通过投票表决来确认交易,一个CPU一票(one-cpu-one-vote),得票最多的交易被认定为一个合法的交易。所以,比特币又被称为是“民主货币”。

The Bitcoin network confirms the transaction by voting xff0c; a CPU (one-cpu-one-vote) xff0c; the transactions with the largest number of votes are recognized as legal transactions. xff0c; and Bitcoin is also referred to as the “democratic currency”.

比特币算法引入了工作量证明 (ProofofWork)机制,称做哈希现金。它的原理是根据交易的数据块,寻找一个包含了多个0的特征随机数,一旦找到了这个随机数,也就确认了一笔交易。计算机只能用穷举的办法来寻找这个随机数,因此证明一个交易需要耗费一定的运算资源和时间,而对随机数中0的数目要求增多,计算工作量呈现指数级增长。对于普通客户端,只需要简单运算,就可检证交易是真实的。这种机制类似现实生活中,政府花费大量精力对钞票进行防伪处理,普通民众可简单识别钞票真伪。

The Bitcoin method introduces the workload certificate (ProofWork) mechanism xff0c; xff0c. The rationale is based on the transaction data block xff0c; searching for a random number of characteristics containing more than zero xff0c; once this random number is found xff0c; confirming a transaction. The computer can only look for this random number xff0c in a poor way; thus proving that a transaction requires a certain amount of computing resources and time xff0c; demanding an increase in the number of zeros in random numbers xff0c; calculating an exponential increase in the workload. For ordinary customers xff0c; simply counting xff0c; just xff0c; and it can be verified that the transaction is real.

(3)矿工奖励机制

xff08; 3xff09; incentives for miners

比特币之间的交易,由“矿工”通过“挖矿”进行验证,“挖矿”的过程就是寻找特定随机数的过程,通过找到满足特征的随机数来确认交易。

The transaction between bitcoin & #xff0c; validation by “miners” through “mining”; the process of “mining” is the process of searching for specific random numbers & #xff0c; confirming the transaction by finding random numbers to satisfy characteristics.

矿工通过“挖矿”来获取酬劳的,这个酬劳就是比特币。比特币最开始5年,每个数据块包含50个比特币用于支付“矿工”酬劳;之后每隔4年,得到的酬劳就会减半。此外,每一笔交易会产生少量交易费,这个交易费也是比特币。因此,“挖矿”的酬劳,包含两部分:数据块包含的奖励及交易产生的交易费。到2040年,比特币的总量2100万个被全部挖出后,“矿工”确认交易将不会再产生额外的比特币,而纯粹靠这个数据块里面包含的交易费来获得酬劳。

xff0c; this is Bitcoin. Bitcoin starts five years xff0c; each data block contains 50 bitcoins to pay “miners” xff1b; every four years xff0c; the next half xff0c; and xff0c; each transaction generates a small transaction fee xff0c; this transaction is also Bitcoin. So xff0c; xff0c); xff0c; xff1a; xff1a; xy; xff0c; 2040; xff0c; xfff0c; 21 million of the total amount of bitcoins have been fully recovered; xffoc; miners have confirmed that the transaction will not generate any additional bitcoin xffoc; and the transaction fees contained in this data block will be paid solely on the basis of the transaction fee.

比特币的挖矿过程可以分为以下几个步骤:

The mining process in Bitcoin can be divided into the following steps xff1a;

  • 交易验证:矿工会先收集比特币网络中的交易信息,并进行有效性验证。

    Trade validation & #xff1a; mining unions first collect information on transactions in the Bitcoin network & #xff0c; and verify validity.

  • 区块打包:矿工会将验证通过的交易信息打包成一个区块,并添加到区块链中。

    Block wrapping & #xff1a; the union packs certified transaction information into a block & #xff0c; and adds it to the block chain.

  • 解决谜题:在打包区块的过程中,矿工需要不停的尝试各种可能的数学谜题,直到找到一个合法的区块头。

    Resolving puzzles & #xff1a; during packing blocks & #xff0c; miners need to constantly try possible mathematical puzzles & #xff0c; until a legal block is found.

  • 区块验证:一旦矿工找到一个合法的区块头,其他矿工将会对其进行验证,并且选择继续新增区块或者抛弃该区块。

    Block validation xff1a; once the miners have found a legal block head xff0c; other miners will verify it xff0c; and choose to continue adding a block or discard it.

  • 奖励获得:一旦矿工成功地新增了一个区块,他们将会获得新的比特币奖励,并且可以从交易费中获得一定的手续费。

    Incentives xff1a; once miners succeed in adding a block xff0c; they will receive a new bitcoin reward xff0c; and they will receive a certain transaction fee.

美化布局示例

欧易(OKX)最新版本

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

APP下载   全球官网 大陆官网

币安(Binance)最新版本

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

APP下载   官网地址

火币HTX最新版本

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

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

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

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

分享:

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

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

欧易(OKX)

  全球官网 大陆官网

币安(Binance)

  官网

火币(HTX)

  官网

Gate.io

  官网

Bitget

  官网

deepcoin

  官网
热门文章
  • 区块链社区有哪些?区块链社区是什么?

    区块链社区有哪些?区块链社区是什么?
    展开全文...
  • 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.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...
  • 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...
  • 带你进入一次元宇宙,让你亲身体会如何在元宇宙中抓住自己的机会

    带你进入一次元宇宙,让你亲身体会如何在元宇宙中抓住自己的机会
    元宇宙是个怎样的世界?鑫哥今天带你进入一次元宇宙。今天用最简单明了的语言来解释一下元宇宙,还有如何利用元宇宙实现财富自由。What kind of world is Yuan cosmos? Brother Jin took you into the Yuan cosmos today. Today, explain the Yuan cosmos in the simplest language, and how to use the Yuan cosmos for the...
标签列表