当前位置:网站首页>长安链双花交易防范策略
长安链双花交易防范策略
2022-07-25 06:19:00 【帅气的梧桐述】
什么是双花交易
即一笔钱被花了两次或者两次以上,也叫“双重支付”。在数字货币系统中,由于数据的可复制性,使得系统可能存在同一笔数字资产因不当操作被重复使用的情况。
比特币如何解决“双花”问题
比特币作为一个去中心化的点对点电子现金系统,主要依靠未花费的交易输出(unspend transaction output, UTXO)和时间戳来解决“双花”问题。
系统利用数字时间戳保证每个区块按时间顺序相连成区块链,时间戳也为区块链链上每一笔数据打上时间标记。
假设小明将被存在于自己UTXO中的1个BTC同时转账给李雷和韩梅梅,两笔交易仅有一笔会成功完成。为什么呢?因为系统中的节点会选择性地记录先接收到的那笔交易。当两笔交易同时被同一节点记录,根据时间戳的数据,只有先被记录的交易才能被确认成功。
如果小明的两笔转账的时间隔得非常非常近,“小明在12点34分56秒转给李雷1个比特币”、“小明在12点34分57秒转给韩梅梅1个比特币”恰好被两个不同的节点记录,会出现“双花”吗?也不会。这两个节点会将各自挖出包含相关交易的区块同时广播到比特币网络中,此时区块链将出现分叉,剩余节点选择在他们认为的最长链上构建新的区块。最后,率先构建出新区块并成为当前最长链上的交易(通常为6个区块),才能被确认成功。之后的所有节点将在此最长链上构建新的区块。
总结一下,面对“双花问题”,比特币现金系统是这样解决的:
首先,每笔交易都要先确认对应比特币之前的情况,要检查它是否存在于小明的UTXO中。如果不在,那么该交易会被系统拒绝。
如果小明用同一笔UTXO付给李雷和韩梅梅,系统中的节点只确认先接收到的那一笔。
边栏推荐
- In depth analysis: is the hottest business model in 2022 linked by 2+1 a legal model?
- HTB-Arctic
- Multithreading programming under Win32 API
- SAP FICO 第三节 BDC和LTMC导入S4财务科目
- How programmers write bugs
- (14) [driver development] configuration environment vs2019 + wdk10 write XP driver
- 嵌入式c语言开发之宏定义求两个数的最大值的使用技巧
- Unity Animator动画与状态机
- Use of golang exec.command
- Special episode of Goddess Festival | exclusive interview with Chinese AI goddess Zhang Qingqing's transformation from a female learning tyrant to a female entrepreneur
猜你喜欢

VSCode 如何开启多个终端?如何横向显示?

HTB-Arctic

"Everyday Mathematics" serial 61: March 1

VO, dto, do, Po distinction and use

【每日一练】day(14)

It is said that screentogif is a GIF recording artifact, but I don't know that its strength is far from here

Unity Animator动画与状态机

(2022牛客多校)D-Link with Game Glitch(spfa)
![[unity3d] ugui callback function](/img/6f/312e7f2cf76fa932e66c5ba0737219.png)
[unity3d] ugui callback function

SAP FICO section III BDC and ltmc import S4 financial account
随机推荐
Qt 5界面修改无效的问题解决QtDesigner修改之后无效的解决办法
Define usage method and template
(16)[系统调用]追踪系统调用(3环)
New developments in Data Governance: what is the impact of the EU's Data Governance Research Report on China
“font/woff“ and “font/woff2“ in file “mime.types“
(2022 Niuke multi School II) k-link with bracket sequence I (dynamic planning)
Special episode of Goddess Festival | exclusive interview with Chinese AI goddess Zhang Qingqing's transformation from a female learning tyrant to a female entrepreneur
剑指 Offer 54. 二叉搜索树的第k大节点
(14) [driver development] configuration environment vs2019 + wdk10 write XP driver
Classic cases of static keywords and block blocks
Some interview questions collected
机器学习 Keras拟合正弦函数
NFT: how to improve rentable NFT (erc-4907)
UML modeling tools Visio, rational rose, powerdesign
"Everyday Mathematics" serial 61: March 1
Common API of window
Blocking Queue Analysis
Seekbar属性参考
(14)[驱动开发]配置环境 VS2019 + WDK10 写 xp驱动
node.express中req.body总是undefind解决