Author

Topic: How to judge illegal transactions? (Read 1115 times)

legendary
Activity: 3878
Merit: 1193
September 08, 2017, 02:40:15 PM
#14
I wonder how the bitcoin protocol judge illegal transactions. As they say, the miner will look throughout the public ledger to make sure the transaction is alright. There are thousands of transactions in each block, if the miner has to check throughout the public ledger for each transaction, this would be very inefficient.

What would you rather have, inefficiency or inaccuracy for a monetary system?
full member
Activity: 138
Merit: 100
September 08, 2017, 11:29:28 AM
#13
you should learn about blockchain and how transactions are saved there
AGD
legendary
Activity: 2070
Merit: 1164
Keeper of the Private Key
September 08, 2017, 06:13:21 AM
#12
I wonder how the bitcoin protocol judge illegal transactions. As they say, the miner will look throughout the public ledger to make sure the transaction is alright. There are thousands of transactions in each block, if the miner has to check throughout the public ledger for each transaction, this would be very inefficient.

There are valid inputs and valid (because authorized by a signature of a private key) outputs. There is no need to check the whole public ledger (blockchain). If an address had no valid (like illegal) input, there will be a balance of 0. If the address had a valid input, which already was confirmed by the network, it can be spent by signing with the private key.
hero member
Activity: 793
Merit: 1026
August 28, 2017, 06:04:46 PM
#11
I wonder how the bitcoin protocol judge illegal transactions. As they say, the miner will look throughout the public ledger to make sure the transaction is alright. There are thousands of transactions in each block, if the miner has to check throughout the public ledger for each transaction, this would be very inefficient.

Every full node does this.  That's why syncing takes forever.  Yes, it's inefficient.  But it's also the only way we know how to have such a system operate.
legendary
Activity: 858
Merit: 1000
August 26, 2017, 12:26:50 PM
#10
I think there is a bitcoin daemon configuration flag that enables to "trust" pre-existing blocks... Not sure though...

Not sure why you'd need to use it, syncing is much faster now and verifying transactions doesn't take that much CPU power.
staff
Activity: 3458
Merit: 6793
Just writing some code
August 26, 2017, 12:24:14 PM
#9
What if I download the Bitcoin Blockchain via torrent?
Do all the pre-existing transactions get checked as well?
Yes. It will check all transactions and blocks it knows of. If a transaction is in a block that has a specific descendant block (the assumevalid block), then signatures are not checked. Everything else is still checked. Note that using the bootstrap.dat torrent will be slower than syncing from p2p.
newbie
Activity: 18
Merit: 0
August 26, 2017, 12:16:25 PM
#8
I think there is a bitcoin daemon configuration flag that enables to "trust" pre-existing blocks... Not sure though...
sr. member
Activity: 490
Merit: 389
Do not trust the government
August 26, 2017, 12:04:12 PM
#7
I think only the last couple of them. Maybe if you don't download the chainstate files then it will have to in order to generate them. otherwise with downloading a whole data directory, I think only a couple of last ones.

There isn't really a benefit of downloading from a torrent, just a risk. Bitcoin is already peer to peer so downloading a blockchain is already like a torrent, it is just slower because it checks them. Maybe there is even an option for Bitcoin Core not to check them while downloading so you get the same effect, but maybe still safer, since you get it from the network and not just some guy.
newbie
Activity: 18
Merit: 0
August 26, 2017, 11:55:53 AM
#6
I wonder if Bitcoin Core, when first installed, rechecks **all** the transactions from the genesis block...
Does anyone know?

Yes. It does it while it is downloading them.

What if I download the Bitcoin Blockchain via torrent?
Do all the pre-existing transactions get checked as well?
sr. member
Activity: 490
Merit: 389
Do not trust the government
August 26, 2017, 11:46:54 AM
#5
I wonder if Bitcoin Core, when first installed, rechecks **all** the transactions from the genesis block...
Does anyone know?

Yes. It does it while it is downloading them.
newbie
Activity: 18
Merit: 0
August 26, 2017, 11:40:05 AM
#4
I wonder if Bitcoin Core, when first installed, rechecks **all** the transactions from the genesis block...
Does anyone know?
staff
Activity: 3458
Merit: 6793
Just writing some code
August 26, 2017, 11:32:24 AM
#3
Every single full node (not just miners) fully verifies every single transaction it receives. It does the same for every block. Since blocks and transactions can be mostly validated in parallel, it really isn't all that slow. Furthermore, the entire blockchain is not rechecked for every block, nor does it need to be rescanned for every block. Node software has more efficient ways of checking up transaction by storing various data separately, e.g. maintaining a separate database for the UTXO set which is used for checking transaction validity. Furthermore transactions in new blocks don't need to be revalidated if you have already seen them in your mempool. So that saves validation time as well.
sr. member
Activity: 490
Merit: 389
Do not trust the government
August 26, 2017, 11:29:06 AM
#2
You really just need to look for transactions that you would include in blocks, the highest fee ones. Miners already look through all the transactions, that is how they know which are the highest fee onces. They even check if their parent transaction is not confirmed and if they both average out at a high enough fee and so on for their parent's parent transaction, hence the Child-pay-for-parent method of getting your transactions confirmed.

There would also be no real way of forcing miners to check for legality of transactions, since miners can be anonymous, just like other Bitcoin users.
newbie
Activity: 7
Merit: 0
August 26, 2017, 09:15:08 AM
#1
I wonder how the bitcoin protocol judge illegal transactions. As they say, the miner will look throughout the public ledger to make sure the transaction is alright. There are thousands of transactions in each block, if the miner has to check throughout the public ledger for each transaction, this would be very inefficient.
Jump to: