JSON-RPC – Difference Between JSON-RPC, JavaScript API, and web3.js

go-ethereumjson-rpcweb3js

As I am getting into blockchain-development (Ethereum), I'm often left confused with what the exact difference between web3.js [link here] and specification of JSON-RPC for ethereum on this page. And what is this documentation about?

Are they same? If not, then how are they related?

Is the geth conosole same as JSON-RPC?

I tried looking up for different answers, and it seems a lot of answers tend to mix up between JSON-RPC and web3.js.

Best Answer

The Javascript API wiki is the document for the 0.2x.x version of Web3js. Most of the tutorials online use this version since the 1.0.0 just released recently. The Web3js on web3js.readthedocs.io is another Web3js document for the 1.0.0 version which greatly different from the 0.2x.x thus explains why there are two different documents for this library.

The JSON-RPC is the remote procedure call protocol version. If you Google "RPC", you will know that it can be easily used/implemented in many different languages, not just only Javascript.

In term of functionality, they are basically the same, but there are many versions and there are many tutorials using different version so it's a bit confusing.

Related Topic