zerodot618
@39696134
03-BTC-共识协议
编程
2022-12-05 01:00
Words count: 4178
北京大学公开课《区块链技术于应用》笔记,由肖臻老师讲授,主要讲解区块链的基本概念和实现原理。

双花攻击

数字货币和纸质货币区别是,数字货币可以复制,会产生双花攻击(double spending attack)。

去中心化货币要解决两个问题:

  1. 数字货币的发行
  2. 怎么验证交易的有效性,防止双花攻击(double spending attack)。

它的解决办法是:

  1. 比特币的发行是由挖矿决定的,
  2. 依靠区块链的数据结构。

10421047-4289d915db4305cf.png如上图,比特币的发行者 A 拥有铸币权(createcoin),假如发行 10 个比特币,A(10) 分别给 B 和 C 各五个 → B(5)C(5), 该交易需要有 A 的签名,证明经 A 同意(signed by A)。同时还要说明花掉的 10 个比特币从哪来的。我们可以看到第二个方框中 A 的钱是从第一个框内铸币交易中来的。

比特币系统中每个交易都包含输入和输出两部分。输入部分要说明币的来源,输出部分要给出收款人公钥的哈希。

有的交易部分比较复杂,如 C 的货币来源是第二、第三个方框的交易,要标识清楚。

Arweave TX
pNlh2yG8yAXKeBglu0vZPY0WVWB3hk_95LgRcdlXNoA
Content Digest
d782fef6ae46d9a57c875ad71f69953713ce1b846a0ad682d685cac7b1455d9f
- 90.0 % More to go -
Pay 0.0000060 BTC (≈$0.3798) to continue reading
and receive early reader revenue (Rules)
This post is a virtural product selling on Quill, IT WILL NOT REFUND once paid. Please pay with caution.
Pay to Read
Already paid? Try to Login
0 : 0
1 times bought, 0 times reward
Comments
zerodot618
@39696134
Subscribing: 0 Subscribers: 2
Subscribe
Related Posts
Defi乐高之借贷协议(2)--MarginFi 隐身3个月通关编程实战项目,升级进取型思维分享。 macOS系统多开Google Chrome浏览器 从小白到科学家(二)之脱胎换骨 Invoke the closed source contract tutorial with MetaMask
Rules Stats Help Github Twitter Discord
zerodot618
@39696134
Subscribing: 0 Subscribers: 2
Subscribe
Related Posts
Defi乐高之借贷协议(2)--MarginFi 隐身3个月通关编程实战项目,升级进取型思维分享。 macOS系统多开Google Chrome浏览器 从小白到科学家(二)之脱胎换骨 Invoke the closed source contract tutorial with MetaMask
Rules Stats Help Github Twitter Discord