search
Homeweb3.0Bitcoin full node synchronization too slow? SPV mechanism that can verify payments without using a full node

Since its birth, Bitcoin has been criticized for wasting power resources, but its powerful computing power is a necessary process, and it is difficult to find a better way to replace it.

As it has been around for longer and longer, more and more people are participating in transactions on its underlying technology blockchain, and the content of the distributed ledger has expanded rapidly, SAToshi NakamotoThe storage amount of 1 MB set for a block limits the transaction process and transaction speed.

Therefore, downloading the entire ledger has become a headache. Can you not download the entire ledger, but only find the parts that are relevant to you? In other words, find a filter and keep the useless stuff out.

So the SPV mechanism appeared.

01. SPV mechanism

##The full name of SPV is "Simplified Payment Verification", common translation For simple payment verification. Its purpose is to verify whether a certain transaction exists, but it cannot verify the legality of the transaction. This requires a two-step operation. The first step is to confirm whether the transaction payment has been verified. The second step is to calculate how many confirmations have been obtained.

Satoshi Nakamoto mentioned this concept in his paper:

It is still possible to verify transactions when not running a full node. Users only need to keep the longest chain All block header data on.

To put it simply:

If Xiao Hei transfers a Bitcoin to Da Bai, how can Da Bai know that the transaction of the coin has been completed? It is impossible to find witnesses in a decentralized system.

According to the traditional method: Dabai needs to download all the blockchain ledgers, and then find Xiaohei’s account. First, check whether it has such a Bitcoin before, and whether it has been transferred to Dabai. Record. Just the first step caused Dabai's storage capacity to explode.

The block capacity of each Bitcoin is 1 MB, and the block header is only 80 KB, so you only need to download the block header to save a lot of space.

What exactly are block headers and block bodies?

Compare the block header to a person's head, which stores the block's header information, such as hash value, timestamp, etc.; while the block body is similar to a person's entire body, storing Detailed data of this block, such as specific transaction information. The block header is included in the block body.

That is to say, although a block header has a hash value, after downloading the block header, Dabai still cannot know which block the transaction is recorded in.

At this time, you need to find the full transaction ID with the transaction ID. The node checks to see if it exists and in which block it is.

02. SPV payment verification process

Hey, what if the miners and Xiaohei join forces to deceive Dabai?

This is where the SPV mechanism comes in handy.

If the miners say that Xiao Hei has turned around, he has not.

Then in order to lie, he must forge more transactions so that these transactions can get the same hash value as in his own block header. However, due to the technical characteristics of hashing, it is difficult to achieve the same hash value of the changed data as the original data.

In short, the entire transaction process of SPV is as follows:

The first step is to confirm whether the transaction payment has been verified

. First calculate the transaction hash value of the payment to be verified, save the block header from the blockchain network to the local, and then obtain the Merkel tree hash authentication path corresponding to the payment to be verified from the blockchain.

Compare whether the obtained hash value is consistent with your own. If they are consistent, it proves that the payment is genuine and valid.

The second step,

verify how many confirmations

have been obtained. Based on the position of the block header, the number of confirmations that the payment has received is determined. After completing these two steps, the transaction payment verification is completed.

03. Summary

The SPV mechanism not only

saves storage space

, but also reduces the waste of P2P network bandwidth, allowing ordinary users to complete the download without It can also be operated without data, and it also brings great convenience to auditing accounts. However, since SPV does not have complete block data, it cannot verify that the transaction does not exist. This situation can easily lead to double spending, and random link nodes may also be maliciously attacked by the network.

Do you think there are any other advantages and disadvantages of SPV?

Welcome to share your views in the message area.

The above is the detailed content of Bitcoin full node synchronization too slow? SPV mechanism that can verify payments without using a full node. For more information, please follow other related articles on the PHP Chinese website!

Statement
This article is reproduced at:知乎. If there is any infringement, please contact admin@php.cn delete
想深入了解BRC-20,先学习UTXO想深入了解BRC-20,先学习UTXOMar 06, 2024 pm 01:34 PM

最近大热的BRC-20 Token是基于比特币,但比特币区块链无法对其进行规则约束。制造BRC-20 Token的成本在于将文件添加到区块链中,以及未来与Token关联的UTXO的移动。 既然UTXO这么重要,今天我们就来简单介绍一下U…

你的比特币真的完全属于你吗?你的比特币真的完全属于你吗?Mar 06, 2024 pm 01:30 PM

目前,一枚比特币价值近 22 万人民币。对于刚入圈的新人来说,肯定很关心比特币的安全问题。 那么,比特币安全吗?换句话说, 钱包里的比特币,容易被黑客盗走吗? 01. 私钥、公钥、地址就像银行取款、网银转账需…

加密货币开发服务领域有哪些新兴机会加密货币开发服务领域有哪些新兴机会Mar 12, 2024 am 09:30 AM

在快速发展的加密货币领域,加密货币开发服务领域充满了新的机会。随着加密货币的采用不断增长,对创新和强大的货币开发解决方案的需求也在不断增长。从创造新币到增强现有币,开发商、企业家和企业都面临着广泛的…

比特币地址有哪些?比特币地址有哪些?Mar 06, 2024 pm 01:21 PM

在加密世界里,钱包地址就像 “银行卡账号”、“收件地址”一样重要,任何操作都离不开它,随着Ordinals 协议的诞生,推动了比特币基于隔离见证、Taproot升级的采用,这让很多人第一次使用“bc1p”等特殊抬头的地…

2024 年 Web3 上排名前 10 的加密货币列表2024 年 Web3 上排名前 10 的加密货币列表Mar 08, 2024 am 10:09 AM

去中心化网络或 Web 3.0 加密货币是推动互联网下一次迭代的数字资产。它们基于区块链技术。与 Web 2.0 的集中式平台和服务相比,Web 3.0 旨在构建一个不太集中、更加透明且以用户为中心的互联网。Web 3.0 加密货币…

MEME币种加密货币分析MEME币种加密货币分析Mar 12, 2024 am 09:32 AM

随着主要Meme币的飙升,以下是一些可能是现在购买的最佳加密货币Meme币的较小替代品。 随着比特币(BTC)突破7万美元,并瞄准重新测试上周创下的纪录高点,主要Meme币继续暴涨,但随着它们的估值变得越来越庞大,…

以太坊layer2龙头Arbitrum入门以太坊layer2龙头Arbitrum入门Mar 06, 2024 pm 02:22 PM

去年下半年,整个加密市场处在深熊困境当中,但Arbitrum生态代表项目GMX和Treasure DAO依然逆势增长, 进入2023年以来,随着市场整体回暖,Arbitrum生态更是全面开花。 尤其是在Arbitrum 宣布发放治理Token ARB,…

这5种加密货币持续飙升!这5种加密货币持续飙升!Mar 08, 2024 am 10:12 AM

持续的加密货币上涨主要是由比特币减半带来的兴奋推动的,比特币已经飙升至 65,000 美元以上并达到历史新高,加密货币市场的传统通配符——模因币——也几乎没有被排除在外。 事实上,过去 7 天内,多个著名的 mem…

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

MinGW - Minimalist GNU for Windows

MinGW - Minimalist GNU for Windows

This project is in the process of being migrated to osdn.net/projects/mingw, you can continue to follow us there. MinGW: A native Windows port of the GNU Compiler Collection (GCC), freely distributable import libraries and header files for building native Windows applications; includes extensions to the MSVC runtime to support C99 functionality. All MinGW software can run on 64-bit Windows platforms.

WebStorm Mac version

WebStorm Mac version

Useful JavaScript development tools

Safe Exam Browser

Safe Exam Browser

Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.