Bitcoin Forum
December 15, 2024, 06:44:59 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Do payment verification grow increasingly more complex?  (Read 1637 times)
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 06, 2016, 04:39:14 PM
Merited by ABCbits (1)
 #1

As I have understood, payment verification by full nodes tracks every satoshi in the transaction back to the block where it first was created. I would expect that the different satoshis in the transaction will branch back to many different creation blocks. And that this branching will grow with time, hence making payment verification increasingly complex (costly). However, since I never seen this raised as an issue, I expect my understanding of PV is incorrect. Anybody to enlighten me on this?  Shocked
belcher
Sr. Member
****
Offline Offline

Activity: 261
Merit: 523


View Profile
May 06, 2016, 05:12:08 PM
 #2

Quote
As I have understood, payment verification by full nodes tracks every satoshi in the transaction back to the block where it first was created.

This doesn't happen, full nodes only need to know if the transaction input in question exists and is unspent.

Full nodes maintain a database of all unspent outputs. So they don't need to look up transactions on the actual blockchain, they just query a database.

1HZBd22eQLgbwxjwbCtSjhoPFWxQg8rBd9
JoinMarket - CoinJoin that people will actually use.
PGP fingerprint: 0A8B 038F 5E10 CC27 89BF CFFF EF73 4EA6 77F3 1129
piotr_n
Legendary
*
Offline Offline

Activity: 2058
Merit: 1416


aka tonikt


View Profile WWW
May 07, 2016, 01:29:09 PM
Merited by ABCbits (3)
 #3

in general it does not become more complex to process a single transaction, but...

the problem is in (so called) unspent-outputs database (or UTXO-db).
number of records inside this db has been increasing and we can expect it to still increase in a future.
currently it contains almost 40 million unspent outputs, from over 10 million transactions.

as the database grows bigger, you might consider that it becomes more complex to query its records.
and querying records of UTXO database is part of the process of verifying new transactions.

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
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 08, 2016, 06:11:51 PM
 #4

So utxo db can be assembled from, or verified by the blockchain then? I would like to see how the number of utxo grows with the accumulated no of transactions. If it is linear or different. Where can I find those numbers?
2c0de
Full Member
***
Offline Offline

Activity: 138
Merit: 102


View Profile
May 12, 2016, 01:54:17 PM
Merited by ABCbits (1)
 #5

Yes, Blockchain grows every day, and thus checking the whole Blockchain takes increasingly more and more time.

But, participants are not expected to check the whole Blockchain. Instead, participants only "catch up", in other words,

they simply verify the block mined since the last validation. If participant connects to the network from time to time, the

complexity does not grow but stays manageable.



The number you are looking for is the number of transactions. The more transactions in a given period, the more time it takes to verify them.

https://blockchain.info/charts/n-transactions

DHjxvnHB9RirtPbvkovSotn1fY2poNffoi
LWeT4wwDVdJ9x49UcXPyS6CznRpbQFM6nx
0x96273C2FD825f0A2745d917bbbfabD6032dC1aDD
piotr_n
Legendary
*
Offline Offline

Activity: 2058
Merit: 1416


aka tonikt


View Profile WWW
May 12, 2016, 03:13:09 PM
Merited by ABCbits (4)
 #6

So utxo db can be assembled from, or verified by the blockchain then?
Yes.
UTXO db is in fact the state of the blockchain, at a specific block in time.

In theory the number of UTXOs doesn't need to grow.
I'm sure there were periods of time when it was actually decreasing.

It has mostly been growing during some kind of attacks on the network, like the recent ones when someone was trying to inflate the mining fees, to prove whatever crazy point he had.

Unfortunately (transaction fee wise) creating new utxo records is very cheap and I haven't heard yet of any ideas to make it more expensive, so the odds are that the UTXO db will be growing.


I would like to see how the number of utxo grows with the accumulated no of transactions. If it is linear or different. Where can I find those numbers?

You can get the numbers yourself.
There is an RPC command in the recent bitcoin core that shows you number of unspent outputs*. Don't remember it's name, but you should be able to easily find it.
Run the command while downloading the block chain (preferably from scratch) to observe the number of records around a specific block height.

At block #411453 you have:
Code:
15536189.79530316 BTC in 38514940 outs from 11016826 txs



EDIT:
* - the command is gettxoutsetinfo. It gives output like this:
Code:
{
  "height": 743838,
  "bestblock": "000000000000fbba412ba83c0c9d4f14872c05764322a318193e23681765cab6",
  "transactions": 2917520,
  "txouts": 10699376,
  "bytes_serialized": 370667910,
  "hash_serialized": "3c470a4a203d236a9ea85a9282a2400265577d5169263eb9b077adf5a77b482f",
  "total_amount": 19085882.74182811
}

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
mookid
Sr. Member
****
Offline Offline

Activity: 446
Merit: 251



View Profile WWW
May 13, 2016, 07:23:45 AM
Merited by ABCbits (1)
 #7

So the UTXO grows if more Bitcoins are spread out in more addresses? Imagining that all Bitcoin holders were asked to consolidate their Bitcoins in one address will the UTXO db size decrease? (of course, this is merely an hypothetical question, using only one address reduces anonymity)
piotr_n
Legendary
*
Offline Offline

Activity: 2058
Merit: 1416


aka tonikt


View Profile WWW
May 13, 2016, 07:28:50 AM
 #8

So the UTXO grows if more Bitcoins are spread out in more addresses? Imagining that all Bitcoin holders were asked to consolidate their Bitcoins in one address will the UTXO db size decrease? (of course, this is merely an hypothetical question, using only one address reduces anonymity)
Correct

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
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1132


View Profile
May 14, 2016, 03:41:42 AM
Merited by ABCbits (4)
 #9

Not quite correct but close.

A txOut is not an address.  "Normal" transactions create one txOut per address, but if the same address gets a lot of different payments from different transactions, then there can be 30 BTC at that address all split up among hundreds of different txOuts.  This is discouraged, by the way; it's bad for everyone's privacy and considered rude.

But it used to be very common.  Change from a transaction would often go back to the same address/key that an input for the transaction came from, and certain online casinos would take a single address for a player and send all winnings there.  Modern clients don't do this by default, but they can still be commanded to send coins to an old address.  And for a long time some asshat was going up and down the block chain sending one-satoshi outputs to random old addresses, for reasons I'd rather not go into right now.

So let's say someone did a lot of *successful* online gambling way back in the way back when all the bitcoin casinos were paying all winnings to the same account for a particular winner.  She's got that 30 BTC split up among hundreds of different txOuts.

Then when she spends 10 BTC (getting a new gaming computer maybe) her client is going to look at all the available unspent txOuts and assemble a transaction using, maybe, 50 to 90 of them.   She'll go slightly over the target amount and get change returned to her in another txOut and for any current software, the change will be at a different key/address.  But the unspent txOuts will still be sitting there at the original address. 
wingding (OP)
Hero Member
*****
Offline Offline

Activity: 770
Merit: 504



View Profile
May 16, 2016, 08:12:15 PM
 #10

Not quite correct but close.

A txOut is not an address.  "Normal" transactions create one txOut per address, but if the same address gets a lot of different payments from different transactions, then there can be 30 BTC at that address all split up among hundreds of different txOuts.  This is discouraged, by the way; it's bad for everyone's privacy and considered rude.

But isn't that what should be expected, at least in a functional market? If you are trading goods or services you do normally operate with one bank account for all payments. I suppose for the case of bitcoin it would be natural to have one one address for many payments.
Cryddit
Legendary
*
Offline Offline

Activity: 924
Merit: 1132


View Profile
May 16, 2016, 09:28:40 PM
Merited by ABCbits (3)
 #11

Yes, that was how it worked in the initial versions of Bitcoin, and a lot of people still use "key" and "address" interchangeably - it's a habit that's hard to break.  

But a key is not an address, either.  

Starting with (I think) version 0.09 Bitcoin's standard client has been making all new txOuts have different keys.  Even when they get paid to the same address.  This is one of the reasons why Bitcoin now recognizes two different address formats; the new ones interact with some new algorithms to derive unique keys.  So payments sent to one of the new addresses, wind up having different keys.  No one looking at the block chain can tell they were paid to the same address, unless they know the private key for that address.  

This helps, but it doesn't give perfect privacy.  Snoops looking at the block chain  can usually identify txOuts that were held in the same wallet, as soon as they are spent.  This happens because when you make a payment from a wallet, it selects one, or some combination, of txOuts from all the addresses and keys it knows about, and snoops can identify wallets from watching which payments get combined.  

And even with this change to help preserve some privacy, someone can still send coins directly to one of the keys generated from the new-style addresses, resulting again in the possibility of multiple txOuts on the same key in the block chain.  

DannyHamilton
Legendary
*
Offline Offline

Activity: 3514
Merit: 4895



View Profile
May 16, 2016, 10:09:14 PM
Merited by ABCbits (2)
 #12

If you are trading goods or services you do normally operate with one bank account for all payments. I suppose for the case of bitcoin it would be natural to have one one address for many payments.

No.  A bitcoin address is not a model for a bank account.  A bitcoin address is a model for an invoice number.  It allows you to know who paid you, when they paid you, how much they paid you, and what they were paying you for.  As such, just like you would have a unique invoice number for every payment that you receive, you would want a unique address for every payment that you receive.

If you are running your own wallet, then your "account" is your wallet (unless you set up separate accounts in the wallet).  You can receive many payments for many addresses all into the same wallet.  The people paying you don't need to know anything about your other wallet addresses, they just need to know which address they should pay.
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!