区块链基本概念一览

你说的曾经没有我的故事 提交于 2020-02-27 01:57:11

本文翻译自 中本聪 (Satoshi Nakamoto) 提供的资料

区块链:点对点电子金融服务系统。(Bitcoin: A Peer-to-Peer Electronic Cash System )

允许在线从甲方向乙方支付,而无需提供格外
的证据。这样可以避免维护信息安全而支付额外的成本。

The network timestamps transactions by hashing them into an ongoing
chain of hash-based proof-of-work, forming a record that cannot be
changed without redoing the proof-of-work.
The longest chain not only serves as proof of the sequence of
events witnessed, but proof that it came from the largest pool of
CPU power. As long as a majority of CPU power is controlled by nodes
that are not cooperating to attack the network, they'll generate the
longest chain and outpace attackers. The network itself requires
minimal structure. Messages are broadcast on a best effort basis,
and nodes can leave and rejoin the network at will, accepting the
longest proof-of-work chain as proof of what happened while they
were gone.

通过对互联网时间戳交易哈希处理,进入一个持续增长的基于哈希的工作量证明,
构成一条除非重做否则不相同的记录。最长的区块链不仅提供所有事件顺序的见证
,而且这个见证来自最大的CPU处理计算池。只要大部分的CPU处理器没有被控制攻
击网络,那么区块链的长度会不断增长并超过攻击者。基于互联网络最小的结构,
区块链信息在最可靠的基础上进行广播,节点可以自由的离开和重新加入网络,接
收当前最新的最长的区块链信息。

Introduction:
虽然传统的线上金融方式足够好,但是却继承了传统的信用模型结构的缺点。那就
是线上的支付方式不是完全不可逆的,所以无法避免的会产生纠纷。这种调解成本
花费限制了最小的实际交易规模,并减少了小额临时交易的可能性。但是丧失不可
逆服务的不可逆付款能力的代价更大,商家必须警惕他们的客户,让他们提供比原
来更多的信息。而且一定比例的欺诈行为是不可避免的,除非是使用物理货币避免
这些成本和付款的不确定性,但是存在不需要信用机构的支付方式。
 

比特币如何运作
与传统的银行和支付系统不同,比特币系统是基于分散的信任。在比特币中,代替
中央信任机构的是信任,它是通过比特币系统中不同参与者的交互而形成的紧急属
性。在本章中,我们将通过跟踪通过比特币系统进行的单个交易从更高层次上检查
比特币,并观察它成为“信任”并被分布式共识的比特币机制接受,并最终记录在
区块链中,即分布式账本。

比特币系统由以下用户组成:包含密钥的用户钱包,在网络上传播的交易以及矿工
(通过竞争性计算)生成共识区块链,该共识区块链是所有交易的权威分类帐。

在跟踪通过比特币网络到区块链的交易时,我们将使用“区块链浏览器”站点来可
视化每个步骤。区块链浏览器是一个网络应用程序,可充当比特币搜索引擎,因为
它允许您搜索地址,交易和区块,并查看它们之间的关系和流程。
流行的区块链浏览器有:
BlockCypher Explorer
blockchain.info
BitPay Insight
Blockstream Explorer

这些功能均具有搜索功能,可以获取比特币地址,交易哈希,区块编号或区块哈希
,并从比特币网络中搜索相应的信息。
注意:比特币网络可以按分数值进行交易,例如,从毫比特币(比特币的1/1000)
到比特币的1/100,000,000(即所谓的聪,最小的比特币单位)


比特币交易:
简而言之,交易告诉网络某个比特币价值的所有者已授权将该价值转让给另一所有
者。现在,新所有者可以通过创建另一笔交易来授权比特币所有权中的其他交易,
从而花费比特币,依此类推。

比特币交易就像一行两次记录的薄记分类账。每次交易包含一个或多个“输入”,
每个输入就像执行减法操作,减去消费用户比特币账户的支出数据。同样,每次交
易包含一个或多个“输出”操作,每个输出就像执行加法操作,增加商家用户比特
币账户的收入数据。而且输入和输出(支出和收入)总计并不一定相等。相反,商
家收入总计小于消费者支出总计,这个差额代表隐含交易费,即把一小部分手续费
支付给发现这个挖掘出这个比特币的矿工(最初记录在区块链分类账上的交易的人
)。比特币交易就像一个记录两次薄记分类账的交易。

The transaction also contains proof of ownership for each amount of
bitcoin (inputs) whose value is being spent, in the form of a
digital signature from the owner, which can be independently
validated by anyone. In bitcoin terms, "spending" is signing a
transaction that transfers value from a previous transaction over to
a new owner identified by a bitcoin address.

比特币交易通过消费者的数字签名的形式包含了作为“输入”花费的比特币所有权
证明的信息。通过这个数字签名每一个人可以独立的验证这个交易。用比特币的术
语来说,“支出”是指将一笔交易从先前的交易转移到由比特币地址标识的新所有
者的交易。

Transaction as Double-Entry Bookkeeping

Input      Value       ****    Output      Value
Input1    0.10BTC   ****    Output1    0.10BTC
Input2    0.20BTC   ****    Output2    0.20BTC
Input3    0.10BTC   ****    Output3    0.20BTC
Input4    0.15BTC

Total Inputs:0.55BTC
Total Outputs:0.50BTC

Inputs         0.55BTC
Outputs      0.50BTC
-------      -------
Difference   0.05BTC(implied transaction fee)
Ps:交易作为两次记账


Transaction Chains(交易链)
    Inputs From        Outputs To
Joe    0.1000BTC       0.1000 BTC (spent)
                                 Transaction Fees: 0.0000 BTC    

    Inputs From        Outputs To
       密钥                   Bob's Address   0.0150 BTC (spent)
Alice   0.1000BTC      Alice's Address 0.0845 BTC (unspent)
                                 Transaction Fees: 0.0005 BTC    

    Inputs From        Outputs To
       密钥                    Gopesh's Address   0.0100 BTC (unspent)
Bob   0.0150 BTC       Alice's Address    0.0045 BTC (unspent)
                                  Transaction Fees:  0.0005 BTC    
Ps:交易链,其中一个交易的输出是下一个交易的输入。

Making Change(找零)
Many bitcoin transactions will include outputs that reference both
an address of the new owner and an address of the current owner,
called the change address. 

许多比特币交易都将包含同时引用新所有者地址和当前所有者地址的输出,称为更
改地址。
举例:如果您购买的商品成本为5比特币,但只能使用20比特币输入,则您将向商
店所有者发送一份5比特币的输出,并将其中的15比特币的输出发送给自己作为零
钱(减去一定的交易费用)。而且,更改地址不必与输入的地址相同,出于隐私原
因,更改地址通常是所有者钱包中的新地址。

Different wallets may use different strategies when aggregating
inputs to make a payment requested by the user. They might aggregate
many small inputs, or use one that is equal to or larger than the
desired payment. Unless the wallet can aggregate inputs in such a
way to exactly match the desired payment plus transaction fees, the
wallet will need to generate some change.

不同的钱包可能使用不同的策略,当汇总输入(支出)进行用户要求的付款。它们
可能汇总许多小的输入(支出),或者使用一个等于或大于所需的付款。除非钱包
可以用一种方法准确汇总输入(支出)与付款金额和手续费的合计相等,但这个功
能可能需要“比特币钱包”迭代多个版本之后实现。
相似的行为在人们使用零钱中经常出现,优先使用与付款接近的零钱比一直使用大
面额的钱币来说可以减少很多零钱。人类可以在潜意识中找到了这两种极端之间的
平衡,但比特币钱包开发人员则在努力实现这一平衡。

In summary, transactions move value from transaction inputs to
transaction outputs. An input is a reference to a previous
transaction’s output, showing where the value is coming from. A
transaction output directs a specific value to a new owner’s
bitcoin address and can include a change output back to the original
owner. Outputs from one transaction can be used as inputs in a new
transaction, thus creating a chain of ownership as the value is
moved from owner to owner 

总之,交易将价值从交易输入转移到交易输出。输入是对先前交易的输出的引用,
显示了价值的来源。交易输出将特定值定向到新所有者的比特币地址,并且可以将
更改输出包括回原始所有者。一笔交易的输出可以用作新交易的输入,从而在值从
所有者转移到所有者时创建所有权链

Common Transaction Forms(基础的交易形式)
最常见的交易形式是从一个地址到另一个地址的简单付款,其中通常包括退还给原
始所有者的一些“更改”。这种类型的事务具有一个输入和两个输出。
Common Transaction
Input0   "From Alice,signed by Alice"
Output0  "To Bob"
Output1  "To Alice"(change)

另一种常见的交易形式是将多个输入汇总为一个输出的交易(请参阅“ 交易汇总
资金”)。这表示在现实世界中相当于将一堆硬币和纸币兑换为一个较大的纸币。
此类交易有时是由钱包应用程序生成的,以清理许多较小的金额,这些金额是作为
“找零”而收到的。
Aggregation  Transaction
Input1   
Input2  
Input3     Output0     

.
InputN
Ps:交易汇总资金

最后,在比特币分类账上经常看到的另一种交易形式是一种将一个输入分配到代表
多个接收者的多个输出的交易(请参阅交易分配资金)。商业实体有时会使用这种
类型的交易来分配资金,例如在处理多名员工的工资支付时。
Distributing  Transaction
               Output1   
               Output2  

Input0     Output3
                .  
                .
               OutputN
Ps:交易分配资金

Constructing a Transaction(构建交易)
比特币的钱包应用程序包含用于选择适当的输入和输出以构建符合用户规格的交易
的所有逻辑。用户只需要指定目的地和金额,其余的发生在钱包应用程序中而无需
用户执行实现的逻辑。重要的是,即使钱包应用程序完全脱机,它也可以构造交易
。就像在家里写一张支票然后再用信封将其发送到银行一样,在连接到比特币网络
时也无需构建交易和签名。

Getting the Right Inputs(获取正确的输入)

钱包应用程序首先会去寻找可以满足输出的输入费用。大多数钱包会持续追踪属于
该钱包中地址的所有可用输出。因此,钱包应用程序将记录用户第一个注册在区块
链网络的可用的交易输出地址副本。。作为全节点客户端运行的比特币钱包应用程
序实际上包含了区块链中每笔交易未使用的输出的副本。这允许钱包构造交易输入
,并快速验证传入交易是否具有正确的输入。但是,由于全节点客户端占用大量磁
盘空间,因此大多数用户钱包运行“轻量级”客户端,这些客户端仅跟踪用户自己
未使用的输出。

如果钱包应用程序不维护未用交易输出的副本,则可以使用不同提供商提供的各种
API或通过使用应用程序编程接口(API)调用来请求全节点,来查询比特币网络以
检索此信息。
https://blockchain.info/unspent?
active=1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK
该请求被构造为针对特定URL的HTTP GET命令。该URL将返回一个地址的所有未花
费的交易输出,为任何应用程序提供构造交易输入所需的信息。我们使用简单的命
令行HTTP客户端curl来检索响应。
{

    "unspent_outputs":[

        {
            
"tx_hash":"186f9f998a5...2836dd734d2804fe65fa35779",
            "tx_index":104810202,
            "tx_output_n": 0,
            
"script":"76a9147f9b1a7fb68d60c536c2fd8aeaa53a8f3cc025a888ac",
            "value": 10000000,
            "value_hex": "00989680",
            "confirmations":0
        }

    ]
}

该响应表示在用户地址“1Cdid9KFAaatwczBwBttQcwXYCpvK8h7FK”的所有权下。
这个响应包含未使用的输出的交易的引用及其在“satoshis”的价值(1亿=1比特
币)。有了这些信息,钱包应用程序可以构造一个交易,以将该价值转移到新的所
有者地址。

如果钱包应用程序在未使用的输出中没有包含足够的比特币来支付消费费用,则钱
包应用程序可能必须通过大量未使用的较小输出来“翻找”,例如从钱包里捡硬币
,直到找到足够的钱来支付咖啡。在这两种情况下,当钱包应用程序创建交易输出
(付款)时,可能都需要找回零钱。


Creating the Outputs(创建输出)
A transaction output is created in the form of a script that creates
an encumbrance on the value and can only be redeemed by the
introduction of a solution to the script. In simpler terms, Alice’s
transaction output will contain a script that says something like,
"This output is payable to whoever can present a signature from the
key corresponding to Bob’s public address." Because only Bob has
the wallet with the keys corresponding to that address, only Bob’s
wallet can present such a signature to redeem this output. Alice
will therefore "encumber" the output value with a demand for a
signature from Bob.
Ps:Alice 代表消费用户,Bob 代表商家用户。
交易的输出是创建一种在价值上“加密”的脚本形式,而且能且仅能被“解密”的
脚本来兑现。简而言之,用户的交易输出将包含一个监听脚本的形式:“这个输出
可以支付给任何能提供商家用户的钱包地址的密钥的数字签名的人”。因为只有商
家用户有这个地址的密钥,所以只有商家用户的钱包账户能够兑现这部分的输出。

This transaction will also include a second output, because Alice’s
funds are in the form of a 0.10 BTC output, too much money for the
0.015 BTC cup of coffee. Alice will need 0.085 BTC in change. Alice
’s change payment is created by Alice’s wallet as an output in the
very same transaction as the payment to Bob. Essentially, Alice’s
wallet breaks her funds into two payments: one to Bob and one back
to herself. She can then use (spend) the change output in a
subsequent transaction.

当交易包含“找零”操作时,将包含第二个输出。在消费用户的比特币钱包会产生
一个“与支付的交易完全相同”的找零输出。事实上,比特币钱包将用户的资金分
为两笔款项:一笔给商户,另一笔还给用户自己。然后,用户可以在后续事务中使
用(花费)更改输出。

最后,为了使交易及时由网络处理,用户的比特币钱包应用程序将收取少量费用。
这在交易中并不明确;它由输入和输出之间的差异暗示。如果用户获得了0.085的
找零,而仅创建0.0845作为第二个输出,则将丢失0.0005 BTC(半毫比特币)。
输入花费的0.10 BTC没有完全用在两个比特币钱包应用程序收取的输出上,因为它
们的总和少于0.10。所产生的差额是矿工收取的交易费用,作为验证费用并将交易
记录在区块链上的区块中的费用。

Adding the Transaction to the Ledger(将交易添加到分类帐)
用户的钱包应用程序创建的交易长258字节,包含确认资金所有权和分配新所有者
所需的一切。然后,交易必须被传输到比特币网络,它将成为区块链的一部分。

Transmitting the transaction(传输交易)
Because the transaction contains all the information necessary to
process, it does not matter how or where it is transmitted to the
bitcoin network. The bitcoin network is a peer-to-peer network, with
each bitcoin client participating by connecting to several other
bitcoin clients. The purpose of the bitcoin network is to propagate
transactions and blocks to all participants.
由于交易包含处理所需的所有信息,因此如何或在何处将其传输到比特币网络都无
关紧要。比特币网络是一个点对点网络,每个比特币客户端都通过连接到其他几个
比特币客户端来参与。比特币网络的目的是将交易和区块传播给所有参与者。

How it propagates(它如何传播)
通过比特币协议来参与比特币网络的任何系统,例如服务器,桌面应用程序或钱包
,都称为比特币节点。用户的钱包应用程序可以将新交易发送到通过任何类型的连
接所连接的任何比特币节点:有线,WiFi,移动等。用户的比特币钱包不必直接连
接到商户的比特币钱包,并且用户不必使用特定的互联网连接,尽管这两种选择也
是可能的。接收到之前从未见过的有效交易的任何比特币节点都将立即将其转发到
与其连接的所有其他节点,这种传播技术称为泛洪。因此,事务在对等网络中迅速
传播出去,在几秒钟之内到达大部分节点。

商户的视角:
如果商家的钱包应用直接连到用户的钱包应用程序,则商户的钱包应用可能是接收
交易的第一个节点。但是,即使用户的钱包通过其他节点发送了交易,它也将在几
秒内到达商户的钱包应用程序。并且,商家的钱包应用程序会立即将用户的交易标
识为收款,因为它包含可通过商家的密钥赎回的输出。商家的钱包应用程序还可以
独立验证交易是否格式正确,使用先前未使用的输出以及包含足够的交易费用以包
含在下一个区块中。此时,商家可以冒着很小的风险假定该交易不久将被包含在区
块中并得到确认。


Tip
A common misconception about bitcoin transactions is that they must
be "confirmed" by waiting 10 minutes for a new block, or up to 60
minutes for a full six confirmations. Although confirmations ensure
the transaction has been accepted by the whole network, such a delay
is unnecessary for small-value items such as a cup of coffee. A
merchant may accept a valid small-value transaction with no
confirmations, with no more risk than a credit card payment made
without an ID or a signature, as merchants routinely accept today.

关于比特币交易的一个普遍误解是必须等待10分钟等待一个新区块,或者等待60分
钟等待一个完整的六次确认,以“确认”这些交易。尽管通过确认可以确保整个网
络都接受了该交易,但是对于小额商品(例如一杯咖啡)而言,这种延迟是不必要
的。就像今天的商人通常接受的那样,商人可以接受没有确认的有效小额交易,其
风险不比没有ID或签名的信用卡付款多。

Bitcoin Mining(比特币采矿)
The transaction is now propagated on the bitcoin network. It does
not become part of the blockchain until it is verified and included
in a block by a process called mining

交易现在在比特币网络上传播。直到被称为采矿的过程验证并包含在区块中,它才
成为区块链的一部分。

The bitcoin system of trust is based on computation. Transactions
are bundled into blocks, which require an enormous amount of
computation to prove, but only a small amount of computation to
verify as proven. The mining process serves two purposes in bitcoin:

比特币系统的信任是基于计算的。通过大量的计算证明,确定将交易事务绑定到多
个块中,并仅需少量的计算就可以证明是经过证明的。挖矿过程在比特币中有两个
用途:

1、Mining nodes validate all transactions by reference to bitcoin’s
consensus rules. Therefore, mining provides security for bitcoin
transactions by rejecting invalid or malformed transactions.

2、Mining creates new bitcoin in each block, almost like a central
bank printing new money. The amount of bitcoin created per block is
limited and diminishes with time, following a fixed issuance
schedule.

1、挖矿节点通过参考比特币的共识规则来验证所有交易。因此,挖矿通过拒绝无
效或格式错误的交易为比特币交易提供安全性。

2、采矿在每个区块中都会创建新的比特币,就像中央银行在印刷新钱一样。按照
固定的发行时间表,每个区块创建的比特币数量是有限的,并且会随着时间而减少

Mining achieves a fine balance between cost and reward. Mining uses
electricity to solve a mathematical problem. A successful miner will
collect a reward in the form of new bitcoin and transaction fees.
However, the reward will only be collected if the miner has
correctly validated all the transactions, to the satisfaction of the
rules of consensus. This delicate balance provides security for
bitcoin without a central authority.

采矿在成本和报酬之间达成了良好的平衡。采矿使用电力来解决数学问题。成功的
矿工将以新的比特币和交易费的形式收集奖励。但是,只有在矿工正确地验证了所
有交易并达到共识规则的情况下,才会收集奖励。这种微妙的平衡在没有中央授权
的情况下为比特币提供了安全性。


A good way to describe mining is like a giant competitive game of
sudoku that resets every time someone finds a solution and whose
difficulty automatically adjusts so that it takes approximately 10
minutes to find a solution. Imagine a giant sudoku puzzle, several
thousand rows and columns in size. If I show you a completed puzzle
you can verify it quite quickly. However, if the puzzle has a few
squares filled and the rest are empty, it takes a lot of work to
solve! The difficulty of the sudoku can be adjusted by changing its
size (more or fewer rows and columns), but it can still be verified
quite easily even if it is very large. The "puzzle" used in bitcoin
is based on a cryptographic hash and exhibits similar
characteristics: it is asymmetrically hard to solve but easy to
verify, and its difficulty can be adjusted.

描述挖矿的好方法就像一个巨大的数独游戏,每当有人找到解决方案时,数独都会
重置,难度会自动调整,因此大约需要10分钟才能找到解决方案。想象一个巨大的
数独难题,大小为数千行和数千列。如果我向您展示完整的拼图,您可以很快地对
其进行验证。但是,如果拼图上有几个正方形,而其余的都是空的,则需要大量的
工作才能解决!数独的难度可以通过更改其大小(增加或减少行和列)来进行调整
,但是即使数独很大,仍然可以很容易地对其进行验证。比特币中使用的“拼图”
基于加密哈希,并具有相似的特征:它不对称地难以解决,但易于验证,并且可以
调整其难度。
Mining Transactions in Blocks(区块交易)

New transactions are constantly flowing into the network from user
wallets and other applications. As these are seen by the bitcoin
network nodes, they get added to a temporary pool of unverified
transactions maintained by each node. As miners construct a new
block, they add unverified transactions from this pool to the new
block and then attempt to prove the validity of that new block, with
the mining algorithm (Proof-of-Work). 
新交易不断从用户钱包和其他应用程序流入网络。正如比特币网络节点所看到的那
样,它们被添加到每个节点维护的未验证交易的临时池中。当矿工构造一个新区块
时,他们将未验证的交易从该池中添加到新区块,然后尝试使用挖掘算法(工作量
证明)证明该新区块的有效性。挖掘的过程在[mining]中有详细说明。

Transactions are added to the new block, prioritized by the
highest-fee transactions first and a few other criteria. Each miner
starts the process of mining a new block of transactions as soon as
he receives the previous block from the network, knowing he has lost
that previous round of competition. He immediately creates a new
block, fills it with transactions and the fingerprint of the
previous block, and starts calculating the Proof-of-Work for the new
block. Each miner includes a special transaction in his block, one
that pays his own bitcoin address the block reward (currently 12.5
newly created bitcoin) plus the sum of transaction fees from all the
transactions included in the block. If he finds a solution that
makes that block valid, he "wins" this reward because his successful
block is added to the global blockchain and the reward transaction
he included becomes spendable. Jing, who participates in a mining
pool, has set up his software to create new blocks that assign the
reward to a pool address. From there, a share of the reward is
distributed to Jing and other miners in proportion to the amount of
work they contributed in the last round.
交易被添加到新的区块中,首先按费用最高的交易和其他一些条件确定优先级。每
个矿工都知道自己已经失去了前一轮的竞争,因此一旦从网络接收到前一个交易块
,便开始挖掘新的交易块。他立即创建一个新块,并用交易记录和上一个块的指纹
填充它,然后开始计算新块的工作量证明。每个矿工在自己的区块中包括一项特殊
交易,该交易向区块地址支付他自己的比特币地址(目前为12.5个新创建的比特币
)加上区块中包含的所有交易的交易费用总和。如果他找到使该区块有效的解决方
案,则他“获胜” 此奖励是因为他成功的区块已添加到全球区块链,并且他包含
的奖励交易变得可花费


Alice’s transaction was picked up by the network and included in
the pool of unverified transactions. Once validated by the mining
software it was included in a new block, called a candidate block,
generated by Jing’s mining pool. All the miners participating in
that mining pool immediately start computing Proof-of-Work for the
candidate block. Approximately five minutes after the transaction
was first transmitted by Alice’s wallet, one of Jing’s ASIC miners
found a solution for the candidate block and announced it to the
network. Once other miners validated the winning block they started
the race to generate the next block.

网络收集了新的交易,并将其包含在未验证的交易池中。经采矿软件验证后,它就
包含在某群矿工的采矿池生成的新区块(称为候选区块)中。参与该采矿池的所有
矿工都立即开始为候选区块计算工作量证明。在交易首次通过用户的钱包程序传输
后大约五分钟,Jing的ASIC矿工之一找到了针对该候选区块的解决方案,并将其发
布给网络。一旦其他矿工验证了获胜区块,他们便开始比赛以生成下一个区块。

Approximately 19 minutes later, a new block, #277317, is mined by
another miner. Because this new block is built on top of block
#277316 that contained Alice’s transaction, it added even more
computation to the blockchain, thereby strengthening the trust in
those transactions. Each block mined on top of the one containing
the transaction counts as an additional confirmation for Alice’s
transaction. As the blocks pile on top of each other, it becomes
exponentially harder to reverse the transaction, thereby making it
more and more trusted by the network.

大约19分钟后,另一个矿工开采了一个新的区块#277317。由于此新块是在包含爱
丽丝交易的块#277316之上构建的,因此它向区块链添加了更多计算,从而增强了
对那些交易的信任。在包含交易的区块之上挖掘的每个区块都将作为对Alice交易
的额外确认。随着这些块彼此重叠,逆转交易变得越来越困难,从而使它越来越受
到网络的信任。

In the diagram in Alice’s transaction included in block #277316, we
can see block #277316, which contains Alice’s transaction. Below it
are 277,316 blocks (including block #0), linked to each other in a
chain of blocks (blockchain) all the way back to block #0, known as
the genesis block. Over time, as the "height" in blocks increases,
so does the computation difficulty for each block and the chain as a
whole. The blocks mined after the one that contains Alice’s
transaction act as further assurance, as they pile on more
computation in a longer and longer chain. By convention, any block
with more than six confirmations is considered irrevocable, because
it would require an immense amount of computation to invalidate and
recalculate six blocks. We will examine the process of mining and
the way it builds trust in more detail in [mining].

在该图包括在块#277316爱丽丝的交易,我们可以看到块#277316,其中包含
Alice的交易。在它的下方是277,316个区块(包括区块#0),它们以区块链(区
块链)的方式相互链接,一直返回到区块#0,称为创世区块。随着时间的流逝,
随着块中“高度”的增加,每个块以及整个链的计算难度也随之增加。在包含
Alice事务的块之后挖掘的块可作为进一步的保证,因为它们在越来越长的链中堆
积了更多的计算量。按照惯例,具有超过六个确认的任何块都被认为是不可撤消的
,因为它将需要大量的计算才能使六个块无效并重新计算。我们将在[mining]中更
详细地研究挖掘的过程及其建立信任的方式。

             Block 277318 Transactions   
Block Depth  Block 277317 Transactions 
Block Height Block 277316 Alice's Transactions   
             Block 277315 Transactions   
             Block 277314 Transactions   

Spending the Transaction(交易支出)

Now that Alice’s transaction has been embedded in the blockchain as
part of a block, it is part of the distributed ledger of bitcoin and
visible to all bitcoin applications. Each bitcoin client can
independently verify the transaction as valid and spendable. Full-
node clients can track the source of the funds from the moment the
bitcoin were first generated in a block, incrementally from
transaction to transaction, until they reach Bob’s address.
Lightweight clients can do what is called a simplified payment
verification (see [spv_nodes]) by confirming that the transaction is
in the blockchain and has several blocks mined after it, thus
providing assurance that the miners accepted it as valid.

现在,爱丽丝的交易已作为一个块的一部分嵌入到区块链中,它是比特币分布式分
类帐的一部分,并且对所有比特币应用程序都是可见的。每个比特币客户都可以独
立验证交易的有效性和可支配性。从节点首次生成比特币之时起,全节点客户就可
以跟踪资金的来源,从交易到交易逐个递增,直到到达Bob的地址为止。轻量级客
户可以通过确认交易位于区块链中并在其后开采了几个区块来进行所谓的简化支付
验证(请参阅[spv_nodes]),从而确保矿工将其视为有效。

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!