简体   繁体   English

比特币 - 双花交易

[英]Bitcoin - double spending transaction

Alice issues 2 transactions: Alice 发出 2 笔交易:

  1. Alice -> Bob, 5 Bitcoins (uses Input 1, Input 2) Alice -> Bob,5 个比特币(使用输入 1,输入 2)
  2. Alice -> Alice, 5 Bitcoins (uses Input 1, Input 2) Alice -> Alice,5 个比特币(使用输入 1,输入 2)

Initially, both of the transactions are in the state "Unordered" until one of them gets committed into the block which is generally accepted by the ecosystem.最初,两笔交易都处于“无序”状态,直到其中一笔交易被提交到生态系统普遍接受的区块中。 If single block would include both of them, we still have the double spending issue.如果单个区块包含它们两者,我们仍然存在双重支出问题。 Is the block making sure, each transaction it includes is valid?区块是否确保它包含的每笔交易都是有效的? Ie it consumes the particular input just once and does not allow for double spending?即它只消耗一次特定的输入并且不允许双重花费? Is each node accepting the block verifying the block's correctness?每个接受区块的节点是否都在验证区块的正确性?

Miner won't accept the second transaction because the first transaction is in the mempool.矿工不会接受第二笔交易,因为第一笔交易在内存池中。

When you broadcast Tx1, miners receive it and check if it is already in mempool, and they accept Tx1 and it goes to mempool.当你广播 Tx1 时,矿工收到它并检查它是否已经在内存池中,他们接受 Tx1 并将它转到内存池。 Next, when you try to broadcast Tx2, miners won't accept it because it is going to be double spend transaction even if Tx1 is not included into a block.接下来,当您尝试广播 Tx2 时,矿工不会接受它,因为即使 Tx1 不包含在区块中,这也将是双花交易。

Double Spending: It is process of using crypto concurrency more than one at the same time.双花:同时使用多个加密并发的过程。 For example, Alice has one crypto-coin on his account.例如,Alice 在他的账户上有一个加密货币。 He sends one coin to Bob and one coin to Jerry at same time.他同时向 Bob 发送一枚硬币,向 Jerry 发送一枚硬币。 This is known as double spending problem through which crypto account holder tries to cheat or deceive blockchain network.这被称为双重支出问题,加密账户持有人试图通过该问题欺骗或欺骗区块链网络。 So blockchain developers and researchers have developed some advanced algorithm like proof of work (It is utilized by Ethereum ), etc., to handle this issue.因此,区块链开发人员和研究人员开发了一些先进的算法,例如工作量证明(以太坊使用它)等来处理这个问题。

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

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