0%

What is double spending and how to avoid it 

2022년 10월 14일 5 분 읽기
뉴스 기사 배너 이미지

What is double spending?

It is crucial that a digital currency system contains mechanisms to safeguard against double spending.  Entire systems could collapse should such protocols not be in place.

Bitcoin is well-designed to prevent double-spending attacks, if its protocol is used as intended. Because the transactions on Bitcoin are recorded in blocks and the network  uses Proof of Work as its consensus mechanism, recorders (known as miners) have to complete  a hash computing process in order to obtain the right to record the transaction. Once the transactions are recorded, it will be distributed to different nodes.

How does double spending affect Bitcoin?

With such a  mechanism in place, miners must have access to stronger  computing power than others should they  wish to be granted recording rights. Once a transaction is successfully recorded and confirmed in a block, it would be extremely challenging for other miners to change this record as massive amounts of computing power would be needed.

This mechanism, however, does not constitute a fail-safe prevention against double spending. As the transaction recording process of Bitcoin is one that takes time, double spending could still occur before transactions are successfully recorded, especially when transactions involve relatively small amounts of Bitcoin.

For example, Bob orders one hamburger and pays for his purchase with Bitcoin. However, as the restaurant is too busy to wait for every transaction to be fully recorded, they give the burger to Bob directly without waiting for the transaction to be complete.

If Bob immediately sends the same amount of Bitcoin to another address with a higher transaction amount attached, the later transaction will likely be recorded and closed by miners – resulting in the invalidity of the previous transaction.

Different types of double spending

  • 51% attacks: When a single entity or organization manages to control more than 50% of the hash computing power on a chain, this allows them to change the transaction sequence or even delete the transaction. The occurrence of such a scenario is  nearly impossible on the Bitcoin network, but has happened on other blockchain networks.

  • Race attacks: Customer A’s double spending case mentioned above is a typical race attack – a user broadcasts two conflicting transactions with the same amount at the same time, and tries to get one confirmed in order to invalidate the other. Race attacks take advantage of the time difference and require the receiver to confirm the transaction before the transaction is  recorded on blocks.

  • Finney attacks: An attacker pre-mines one transaction into a block without broadcasting it to the network immediately. Instead, he spends the same amount in another transaction and only then broadcasts his previously mined block, which may invalidate the former payment. Finney attacks require a specific sequence of events to occur and are also contingent on the recipient’s acceptance of unconfirmed transactions.

How to prevent double spending?

1: Wait for the block confirmation

The best solution to solve the double spending issue is to finish the deal after the transaction is confirmed by blocks. Once the transaction is confirmed, the coins can’t be double-spent, as ownership is assigned to a new user – and the entire network can verify this.  This is a solution adopted by transactions involving large amounts.

2: Increase 51% attacker’s costs

As mentioned above, when attackers control more than 50% of a blockchain network’s hash computing power, it is theoretically possible for them to delete a transaction that has been confirmed by blocks. However in reality, such a scenario would be near impossible as 51% attacks and their required computing power would come at a high monetary cost.

There could sometimes be transactions deemed to be of sufficient value for attackers to invest in the required computing power. In such a case, users should wait for more blocks to confirm the transaction’s validity, in order to increase the cost to attackers.

For example, hacker B spends a large amount of resources to acquire 51% of a blockchain network’s computing power and hence gets a 51% chance to invalidate a transaction. However, should he need to invalidate two blocks, his change would halve to 26% and he would then need to invest in more resources to obtain the required computing power for his purposes.

Of course, the scenarios mentioned above are theoretical. In reality, dealers will have to determine how many blocks a transaction requires in order to be validated. If a transaction involves a small amount, perhaps block confirmations need not be attended to immediately. But if a large amount is involved, it would be prudent to wait for more block confirmations before proceeding with the deal.

The post appeared first on Huobi Blog.

인기 뉴스

How to Set Up and Use Trust Wallet for Binance Smart Chain
#Bitcoin#Bitcoins#Config+2 더 많은 태그

How to Set Up and Use Trust Wallet for Binance Smart Chain

Your Essential Guide To Binance Leveraged Tokens

Your Essential Guide To Binance Leveraged Tokens

How to Sell Your Bitcoin Into Cash on Binance (2021 Update)
#Subscriptions

How to Sell Your Bitcoin Into Cash on Binance (2021 Update)

What is Grid Trading? (A Crypto-Futures Guide)

What is Grid Trading? (A Crypto-Futures Guide)

Cryptohopper에서 무료로 거래를 시작하세요!

무료 사용 - 신용카드 필요 없음

시작하기
Cryptohopper appCryptohopper app

면책 조항: Cryptohopper는 규제 기관이 아닙니다. 암호화폐 봇 거래에는 상당한 위험이 수반되며 과거 실적이 미래 결과를 보장하지 않습니다. 제품 스크린샷에 표시된 수익은 설명용이며 과장된 것일 수 있습니다. 봇 거래는 충분한 지식이 있거나 자격을 갖춘 재무 고문의 조언을 구한 경우에만 참여하세요. Cryptohopper는 어떠한 경우에도 (a) 당사 소프트웨어와 관련된 거래로 인해, 그로 인해 또는 이와 관련하여 발생하는 손실 또는 손해의 전부 또는 일부 또는 (b) 직접, 간접, 특별, 결과적 또는 부수적 손해에 대해 개인 또는 단체에 대한 어떠한 책임도 지지 않습니다. Cryptohopper 소셜 트레이딩 플랫폼에서 제공되는 콘텐츠는 Cryptohopper 커뮤니티 회원이 생성한 것이며 Cryptohopper 또는 그것을 대신한 조언이나 추천으로 구성되지 않는다는 점에 유의하시기 바랍니다. 마켓플레이스에 표시된 수익은 향후 결과를 나타내지 않습니다. Cryptohopper의 서비스를 사용함으로써 귀하는 암호화폐 거래와 관련된 내재적 위험을 인정하고 수락하며 발생하는 모든 책임이나 손실로부터 Cryptohopper를 면책하는 데 동의합니다. 당사의 소프트웨어를 사용하거나 거래 활동에 참여하기 전에 당사의 서비스 약관 및 위험 공개 정책을 검토하고 이해하는 것이 필수적입니다. 특정 상황에 따른 맞춤형 조언은 법률 및 재무 전문가와 상담하시기 바랍니다.

©2017 - 2025 저작권: Cryptohopper™ - 판권 소유.