Negate the need for blockchain explores and full blockchain syncing for simple queries

0

Rather than download the full blockchain or a pruned version; would it be viable to peer-to-peer ask 'what is this block' or 'what is this tx'?

We download the full blockchain from several peers so why not ask peers for just on piece of info?

Is there a javascript/node.js library that does this?

Ben Muircroft

Posted 2016-12-29T20:16:50.940

Reputation: 408

What kind of queries? Bitcoind needs to download all blocks in order to be able to validate them. If you want to ask certain queries and don't care whether you're being lied to, then sure, a lot of that work is not needed.Pieter Wuille 2017-04-08T04:39:01.837

Answers

1

That's exactly what your bitcoind client does. It asks for specific blocks in network calls and if you wanted to, you can create a simple client that asks only for certain tx's and blocks like you said.

That is in fact what most SPV wallets (phone-based wallets and some others) are doing. They ask for block headers only and then ask for transactions related to those blocks to prove that certain transactions exist.

Jimmy Song

Posted 2016-12-29T20:16:50.940

Reputation: 7 067

1This is not true for bitcoind (if you're referring to the Bitcoin Core rpc server binary), but it is true for some other clients. Bitcoin Core always downloads all blocks, because it cannot do full validation when gaps are missing.Pieter Wuille 2016-12-31T02:38:31.877

I meant that bitcoind asks peers "what is thisk block" or "what is this tx"Jimmy Song 2016-12-31T07:36:07.650