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?

  • 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 Apr 8 '17 at 4:39

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.

  • 1
    This 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 Dec 31 '16 at 2:38
  • I meant that bitcoind asks peers "what is thisk block" or "what is this tx" – Jimmy Song Dec 31 '16 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.