1

I'm trying to understand bitcoin RPC Peer to Peer protocol to implement SPV on a web-application that should receive crypto payments.

The problem is that on the examples I found, examples are about RPC requests to a full node I'm supposed to own, but I want to query other nodes (nodes I have no user:password for).

As far as I understand, bitcoinj and full wallets connects to the network make requests to them without user:pass, but I could not found how that requests are built, and how can I test and try them using curl to learn how it works.

Is there a api documentation I can check and a list of nodes I can query?

Also, I understand that to establish a connection I should send the version request, but from curl I don't have a "version".

I've found this documentation about the protocol, but I've found no way to test that out in simple terms (like curl), to know what is being sent-received.

I want to understand what queries I can make using this protocol without running a full node.

update

It seems that what I wanted to know if it is possible to learn about the bitcoin protocol making test calls with curl to full-nodes (not RPC). It seems that it is not possible.

1 Answer 1

1

Nodes communicate to each other using the peer-to-peer protocol, typically using TCP port 8333. They rumor blocks and transactions to each other, request data, tell each other about other IP addresses in the network, ...

Each node implements the level of validation they desire; some download all blocks and validate everything (full nodes), some do that but don't keep the blocks on disk after validation (pruned full nodes), and some download only the transactions they're interested in along with proofs they wee including in the chain without verifying validity.

Independently, some node software also exposes an interface to communicate with users or other software using an RPC protocol. This interface however is not public for good reasons:

  • It's usually not designed to work in adverserial settings (for example: the RPC interface may expose a command to shut down a node, or dump its private keys, ...).
  • It's not hardened against denial-of-service (DoS) attacks.
  • It's not others than the node's operator should be using anyway, as the information provided by RPC is an interpretation of what is going on in the network; it's not verifiable. So if exposed to untrusted party, node software could just lie, possibly defrauding the party using it.
2
  • Ok, but can I try the peer-to-peer protocol, what can I do with that, and what cannot be done? (I will change the question to make that idea clear)
    – eloyesp
    Apr 28, 2019 at 19:22
  • Obviously everything can be done with the P2P protocol (it's literally how all nodes get all their information). Apr 28, 2019 at 20:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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