简体   繁体   English

在区块链中完成每笔交易是否需要超过几分钟的时间?

[英]Does each transaction take more than a few minutes to finish in blockchain?

I am new to blockchain and have a question about the performance.我是区块链新手,对性能有疑问。

Miners in blockchain needs to solve a mathematic puzzle in order to create a block and the process may take a few minutes to finish.区块链中的矿工需要解决一个数学难题才能创建一个区块,这个过程可能需要几分钟才能完成。

Does this mean it takes a few minutes to complete a transaction?这是否意味着完成交易需要几分钟?

For example, if I buy a pizza with bitcoin, do I need to wait for a few minutes before I can get the pizza?例如,如果我用比特币购买披萨,是否需要等待几分钟才能拿到披萨?

Firstly, "injecting" a transaction into the blockchain network does not mean that it will be immediately accepted for execution (included in the block) - it depends on the queue size determined by the current load, as well as on the transaction prioritization capabilities determined by the protocol used.首先,将交易“注入”到区块链网络并不意味着它会立即被接受执行(包含在区块中)——它取决于当前负载确定的队列大小,以及确定的交易优先级能力通过使用的协议。

Secondly, the most popular blockchain networks based on the Bitcoin and Ethereum protocols use conditional finalization of the transaction - the block in which the transaction was included can be excluded from the main chain due to a fork and, thus, the transaction becomes unexecuted again and returns to the pending queue.其次,最流行的基于比特币和以太坊协议的区块链网络使用有条件的交易完成——包含交易的区块可以由于分叉而被排除在主链之外,因此交易再次变得未执行,并且返回待处理队列。 In order to make sure that the transaction is finally included in the main chain (more precisely, with a sufficiently high probability), it is recommended to wait until another 4-6 blocks are added "on top" of the block with the transaction.为了确保交易最终被包含在主链中(更准确地说,具有足够高的概率),建议等到另外 4-6 个块被添加到带有交易的块的“顶部”。 For Bitcoin, this time will be 40-60 minutes, and for Ethereum - 60-90 seconds.对于比特币,这个时间将是 40-60 分钟,而对于以太坊 - 60-90 秒。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM