Bitcoin Forum
May 05, 2024, 08:05:25 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Simple Payment Verfication (SPV)  (Read 149 times)
Tym (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 14


View Profile
March 17, 2020, 08:57:18 AM
Last edit: March 18, 2020, 03:32:07 PM by Tym
Merited by pooya87 (1)
 #1

Hello there,

according to the documentation an Electrum wallet is able to verify transactions by its own using the SPV technique. https://electrum.readthedocs.io/en/latest/spv.html#spv

SPV makes it pretty easy for my wallet to make sure that my transaction is included in the Bitcoin blockchain. That's because my wallet knows all block headers of the entire chain (right?).

My Question: Is there a way for my wallet to verify that a block (header) is part of the Bitcoin blockchain. If so, how does it work?

My thoughts: If I want to verify a block I need to check if the hash fulfillfs the conditions of the target. To check that I need to know the correct target. Is there any way to proof (or to be very sure) that a target is correct (e.g. taking a look at blocks in the past, ...)

My aim: I want to proof that a target is correct at any time for one of my projects (kind of a SPV-Client). I was trying to find some approaches in the documentation of electrum (how they do it). But I didn't.


I'd love to read your answers. :-) Many thanks to everyone reading my question.
Tym




Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714939525
Hero Member
*
Offline Offline

Posts: 1714939525

View Profile Personal Message (Offline)

Ignore
1714939525
Reply with quote  #2

1714939525
Report to moderator
1714939525
Hero Member
*
Offline Offline

Posts: 1714939525

View Profile Personal Message (Offline)

Ignore
1714939525
Reply with quote  #2

1714939525
Report to moderator
1714939525
Hero Member
*
Offline Offline

Posts: 1714939525

View Profile Personal Message (Offline)

Ignore
1714939525
Reply with quote  #2

1714939525
Report to moderator
Tym (OP)
Newbie
*
Offline Offline

Activity: 15
Merit: 14


View Profile
March 17, 2020, 10:35:23 AM
Last edit: March 17, 2020, 11:42:19 AM by Tym
 #2

What I just found is the following:

Quote
Electrum fetches blockchain information from Electrum servers, bitcoin nodes that index the blockchain by address. Electrum performs Simple Payment Verification to check the transactions returned by servers. For this, it fetches blokchain headers from about 10 random servers. In addition, Electrum servers are authenticated by SSL, in order to protect users from MITM attacks.
(Source: https://en.bitcoin.it/wiki/Thin_Client_Security)

To improve my question from above: How is the Client able to verify the correctness of these blocks?
pooya87
Legendary
*
Offline Offline

Activity: 3444
Merit: 10549



View Profile
March 17, 2020, 03:33:05 PM
 #3

well the "condition" is to take 2016 blocks then calculate the time it took to mine them using the 4 byte time variable that is already in the block header and then readjust the difficulty based on that (increase if it took less than 14 days, otherwise decrease). since a full node also does that check using the headers a light node could also perform the same check. however, i don't know whether Electum does this check or not.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!