Bitcoin Forum
May 06, 2024, 04:14:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Transaction verification time?  (Read 1605 times)
fevirfevir (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 6


View Profile
May 20, 2016, 02:47:09 PM
Merited by ABCbits (3)
 #1

Hi,

As from what I understand, Bitcoin nodes transmit transactions twice. First the actual transaction is transmitted; second, the transaction is included in a block and the block is transmitted, effectively transmitting the transaction twice.

The first time a transaction is transmitted, each node verifues the validity of a transaction, before further transmitting it. Again, from what I understand, if the transaction is included in a block, the (all) transaction(s) is (in the block are) verified, before the block is transmitted to the next node.

(Note: these questions are about transaction validity, not the transaction ultimately being accepted in the blockchain)

My questions:
1.a How long does it take to verify the validity of a single transaction (not included in a block)? I guess some assumptions must be made (CPU, memory, number of inouts/outputs in a transaction)
1.b Is there a tool available with which I can test and observe the verification time (of a single and/or multiple transactions)?
2. Is transaction validation of a single transaction (not included in a block) similar to transaction validation of a transaction in a block body?

Thanks.
1715012052
Hero Member
*
Offline Offline

Posts: 1715012052

View Profile Personal Message (Offline)

Ignore
1715012052
Reply with quote  #2

1715012052
Report to moderator
"If you don't want people to know you're a scumbag then don't be a scumbag." -- margaritahuyan
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715012052
Hero Member
*
Offline Offline

Posts: 1715012052

View Profile Personal Message (Offline)

Ignore
1715012052
Reply with quote  #2

1715012052
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
May 20, 2016, 02:56:35 PM
Merited by ABCbits (2)
 #2

My questions:
1.a How long does it take to verify the validity of a single transaction (not included in a block)? I guess some assumptions must be made (CPU, memory, number of inouts/outputs in a transaction)
It depends on the number of inputs and signature operations. A transaction could theoretically take several minutes to verify.

1.b Is there a tool available with which I can test and observe the verification time (of a single and/or multiple transactions)?
I'm not sure, but you can probably write one.

2. Is transaction validation of a single transaction (not included in a block) similar to transaction validation of a transaction in a block body?

Thanks.

Yes.

cr1776
Legendary
*
Offline Offline

Activity: 4032
Merit: 1299


View Profile
May 20, 2016, 03:04:37 PM
 #3

You might also take a look at this:

https://m.reddit.com/r/Bitcoin/comments/3yulwv/any_examples_of_the_10_minute_script_thats_a/

fevirfevir (OP)
Newbie
*
Offline Offline

Activity: 17
Merit: 6


View Profile
May 23, 2016, 07:56:07 PM
 #4

The transaction verification time is mostly depended on the amonut of the transaction fee. The larger the transaction fee is, the higher the priority of the confirmation will be.

Ah, well, I meant the time it takes for a single node to verify the vallidity of a transaction. Not the time it takes for the entire network to accept the transaction as valid and incorporate it into the blockchain. In other words, checking the signature, checking the structure of the transaction, checking the content of the transaction fields, all that, how long does that take for a node (assumptions can be made on processor power, etc)? This should be independent of the tx fee.
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
May 25, 2016, 07:40:19 AM
 #5

Ah, well, I meant the time it takes for a single node to verify the vallidity of a transaction. Not the time it takes for the entire network to accept the transaction as valid and incorporate it into the blockchain. In other words, checking the signature, checking the structure of the transaction, checking the content of the transaction fields, all that, how long does that take for a node (assumptions can be made on processor power, etc)? This should be independent of the tx fee.
Depending on the speed of the host computer, it should not be more than a couple milliseconds.

I think in bitcoin core, the most time consuming part these days would be fetching tx's input(s) from UTXO database. Unless they'd happen to be in a cache.
Then verifying ECDSA signature(s) also needs some time. But this has been hugely improved by switching to sipa's secp265k1 lib.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
May 25, 2016, 09:35:08 PM
 #6

Depending on the speed of the host computer, it should not be more than a couple milliseconds.
Wrong. This is expensive process. Some transactions have very many inputs and SIGOPs.
Verifying them takes much more time even with secp265k1 lib
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
May 26, 2016, 07:19:35 AM
Last edit: May 26, 2016, 07:58:43 AM by piotr_n
Merited by ABCbits (2)
 #7

Depending on the speed of the host computer, it should not be more than a couple milliseconds.
Wrong. This is expensive process. Some transactions have very many inputs and SIGOPs.
Verifying them takes much more time even with secp265k1 lib

OK, mr smart ass, let me rephrase.

If the transaction has less than 30 single-signature inputs, verifying it should not* take more than a couple milliseconds, on a $100+ CPU with secp265k1 lib.

Feeling better now?


* - by should not I mean that you haven't fucked up your code and it's aspiring to be optimal (e.g. by using parallel threads or not fetching the inputs from some slow database).

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
May 26, 2016, 08:01:37 AM
 #8

Feeling better now?
Aaaaah! Much better! (c) Duke Nukem
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!