{"id":2554,"date":"2022-04-20T10:48:00","date_gmt":"2022-04-20T10:48:00","guid":{"rendered":"https:\/\/odwstage.com\/omniatech\/?p=2554"},"modified":"2023-05-21T21:48:41","modified_gmt":"2023-05-21T21:48:41","slug":"wtf-is-json-rpc","status":"publish","type":"post","link":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/","title":{"rendered":"WTF is JSON-RPC ?"},"content":{"rendered":"<span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\">3<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span>\n<p id=\"6e7c\">Developers can often use a lot of different complex concepts to get to a final, easy-to-use product. JSON-RPC may be something that throws off most people when they see it mentioned, although it\u2019s a data exchange protocol that allows a client to communicate with a server.<\/p>\n\n\n\n<p id=\"3ee7\">The client (i.e. a blockchain explorer or a wallet) communicates with a server (e.g. a blockchain node providing the application data) by issuing commands and listening to responses.<\/p>\n\n\n\n<p id=\"0237\">JSON-RPC is actually a combination of two separate concepts. These two concepts create the widely used JSON-RPC concept, which has been deployed across a number of blockchain applications. Let\u2019s dive deeper into each concept.<\/p>\n\n\n\n<p id=\"f6c7\"><strong>TL;DR \u2014 JSON is a data format and RPC is a way of invoking a function on a server.<\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"fb9c\">JavasScript Object Notation (JSON)<\/h3>\n\n\n\n<p id=\"8250\">The first concept within JSON-RPC is JSON, which stands for JavaScript Object Notation. JSON is effectively an efficient way of representing data in a way readable to humans.<\/p>\n\n\n\n<p id=\"129f\">It was popularized in the early 2000s as an alternative to the then defacto web standard, which was Extensible Markup Language (XML). JSON has since largely replaced XML as it can represent numbers, strings, values, and collections effectively. Any programming language can interpret JSON data as long as it\u2019s properly formed.<\/p>\n\n\n\n<p id=\"053f\">Developers often use JSON because of its flexibility and readability. Its data does not include pre-defined schemas or data definitions that need to be understood before work can be started, and data is exchanged in a readable format.<\/p>\n\n\n\n<p id=\"8a82\">These two features mean developers\u2019 productivity surges when they\u2019re working with JSON. However, the format is not the most efficient to parse and transmit data, and competing formats often provide better optimizations.<\/p>\n\n\n\n<p id=\"7e6e\">It\u2019s widely believed that the productivity gained by using JSON outweighs the performance of using other formats. When it comes to blockchain applications, simplicity leading to fewer errors may also mean added security.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"8538\">Remote Procedure Call (RPC)<\/h3>\n\n\n\n<p id=\"4c2f\">Remote Procedure Call (RPC) is the second component of JSON-RPC and, as its name implies, enables one machine to call a procedure off another. RPC\u2019s origins date back to 1970, when researchers were figuring out how distributed applications could communicate remotely.<\/p>\n\n\n\n<p id=\"faa2\">Since then, the internet has evolved to the point modern web architecture now heavily relies on Representational State Transfer (REST). Services using REST have been boosted by frameworks such as Ruby on Rails and NodeJS.<\/p>\n\n\n\n<p id=\"b023\">REST is ideal for applications where functions involve Creating, Reading, Updating, and Deleting records. These applications can, for example, be social media platforms where content is always being changed.<\/p>\n\n\n\n<p id=\"2186\">Blockchains are immutable so a REST architecture does not make the most sense. Instead, using RPC has allowed for a more direct connection to the blockchain. An RPC message is initiated by the client and sends a message to a server, such as a blockchain node for example.<\/p>\n\n\n\n<p id=\"eddc\">The message is passed with all the required parameters to invoke a procedure. When a server receives that message, it unpacks the parameters and invokes the procedure before returning the result back to the client.<\/p>\n\n\n\n<p id=\"7aae\"><strong>In web3, JSON-RPC is used as a protocol to read and write data to blockchains.<\/strong><\/p>\n\n\n\n<p id=\"787a\">Example:<br>Sending the JSON from below to a Ethereum RPC endpoint would invoke the node\u2019s function to return the latest block number.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p id=\"4d5e\">{<br>\u201cjsonrpc\u201d : \u201d2.0&#8243;,<br>\u201dmethod\u201d : \u201deth_blockNumber\u201d,<br>\u201dparams\u201d :[] ,<br>\u201did\u201d:1<br>}<\/p>\n<\/blockquote>\n\n\n\n<p id=\"4e93\">The node would respond with a JSON containing the latest block number:<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p id=\"ac05\">{<br>\u201cid\u201d:1,<br>\u201cjsonrpc\u201d : \u201c2.0\u201d,<br>\u201cresult\u201d : \u201c0xDF1657\u201d \/\/ 14620247<br>}<\/p>\n<\/blockquote>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"3168\">Conclusion<\/h3>\n\n\n\n<p id=\"86b2\">All of this means that JSON-RPC is a protocol that uses JSON to encode requests and responses between clients and servers. JSON-RPC v2.0 was released in 2010 and provides a simple RPC mechanism for developers.<\/p>\n\n\n\n<p id=\"6bb4\"><strong>About OMNIA Protocol<br><\/strong>By foreseeing the state of the current blockchain application network, we have committed to preparing, researching, and applying our technical expertise to our latest project, Omnia.<\/p>\n\n\n\n<p id=\"9966\">Omnia Protocol is a decentralized infrastructure protocol for securely accessing the blockchain so that no single point of failure will ever disrupt blockchain applications or wallets integrating with it.<\/p>\n\n\n\n<p id=\"37fb\">Omnia\u2019s solution is truly decentralized and requires zero technical knowledge. Therefore, all users can set up their nodes in little time and effort. Learn more about the technological marvel behind Omnia by following our&nbsp;<a href=\"https:\/\/medium.com\/omniaprotocol\">Medium<\/a>&nbsp;or reading our&nbsp;<a href=\"https:\/\/whitepaper.omniatech.io\/\" rel=\"noreferrer noopener\" target=\"_blank\">whitepaper<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p><span class=\"rt-reading-time\" style=\"display: block;\"><span class=\"rt-label rt-prefix\"><\/span> <span class=\"rt-time\">3<\/span> <span class=\"rt-label rt-postfix\">min read<\/span><\/span> Developers can often use a lot of different complex concepts to get to a final, easy-to-use product. JSON-RPC may be something that throws off most people when they see it mentioned, although it\u2019s a data exchange protocol that allows a client to communicate with a server. The client (i.e. a blockchain explorer or a wallet) [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":2555,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[797],"tags":[108,494,493,498,495,492,496,499,497],"class_list":["post-2554","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-rpc-nodes-infrastructure","tag-blockchain-applications","tag-client-server-communication","tag-data-exchange-protocol","tag-efficiency-and-readability","tag-javascript-object-notation","tag-json-rpc","tag-remote-procedure-call","tag-rpc-in-web-development","tag-simplifying-data-representation"],"acf":[],"wbAuthor":{"name":"Alex Lupascu","link":"https:\/\/omniatech.io\/pages\/author\/alexlupascu\/"},"wbDate":"Apr 20, 2022","wbCategories":{"space":"<a href=\"https:\/\/omniatech.io\/pages\/category\/rpc-nodes-infrastructure\/\" rel=\"category tag\">RPC Nodes &amp; Infrastructure<\/a>","coma":"<a href=\"https:\/\/omniatech.io\/pages\/category\/rpc-nodes-infrastructure\/\" rel=\"category tag\">RPC Nodes &amp; Infrastructure<\/a>"},"wbComment":0,"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.7 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>WTF is JSON-RPC ? - OMNIA<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WTF is JSON-RPC ? - OMNIA\" \/>\n<meta property=\"og:description\" content=\"3 min read Developers can often use a lot of different complex concepts to get to a final, easy-to-use product. JSON-RPC may be something that throws off most people when they see it mentioned, although it\u2019s a data exchange protocol that allows a client to communicate with a server. The client (i.e. a blockchain explorer or a wallet) [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/\" \/>\n<meta property=\"og:site_name\" content=\"OMNIA\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-20T10:48:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-21T21:48:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"720\" \/>\n\t<meta property=\"og:image:height\" content=\"403\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Alex Lupascu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Alex Lupascu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/\",\"url\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/\",\"name\":\"WTF is JSON-RPC ? - OMNIA\",\"isPartOf\":{\"@id\":\"https:\/\/omniatech.io\/pages\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp\",\"datePublished\":\"2022-04-20T10:48:00+00:00\",\"dateModified\":\"2023-05-21T21:48:41+00:00\",\"author\":{\"@id\":\"https:\/\/omniatech.io\/pages\/#\/schema\/person\/902af0aeb9024ae8230d12052adcb822\"},\"breadcrumb\":{\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage\",\"url\":\"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp\",\"contentUrl\":\"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp\",\"width\":720,\"height\":403},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/omniatech.io\/pages\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"WTF is JSON-RPC ?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/omniatech.io\/pages\/#website\",\"url\":\"https:\/\/omniatech.io\/pages\/\",\"name\":\"OMNIA\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/omniatech.io\/pages\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/omniatech.io\/pages\/#\/schema\/person\/902af0aeb9024ae8230d12052adcb822\",\"name\":\"Alex Lupascu\",\"url\":\"https:\/\/omniatech.io\/pages\/author\/alexlupascu\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WTF is JSON-RPC ? - OMNIA","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/","og_locale":"en_US","og_type":"article","og_title":"WTF is JSON-RPC ? - OMNIA","og_description":"3 min read Developers can often use a lot of different complex concepts to get to a final, easy-to-use product. JSON-RPC may be something that throws off most people when they see it mentioned, although it\u2019s a data exchange protocol that allows a client to communicate with a server. The client (i.e. a blockchain explorer or a wallet) [&hellip;]","og_url":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/","og_site_name":"OMNIA","article_published_time":"2022-04-20T10:48:00+00:00","article_modified_time":"2023-05-21T21:48:41+00:00","og_image":[{"width":720,"height":403,"url":"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp","type":"image\/webp"}],"author":"Alex Lupascu","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Alex Lupascu","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/","url":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/","name":"WTF is JSON-RPC ? - OMNIA","isPartOf":{"@id":"https:\/\/omniatech.io\/pages\/#website"},"primaryImageOfPage":{"@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage"},"image":{"@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage"},"thumbnailUrl":"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp","datePublished":"2022-04-20T10:48:00+00:00","dateModified":"2023-05-21T21:48:41+00:00","author":{"@id":"https:\/\/omniatech.io\/pages\/#\/schema\/person\/902af0aeb9024ae8230d12052adcb822"},"breadcrumb":{"@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#primaryimage","url":"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp","contentUrl":"https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp","width":720,"height":403},{"@type":"BreadcrumbList","@id":"https:\/\/omniatech.io\/pages\/wtf-is-json-rpc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/omniatech.io\/pages\/"},{"@type":"ListItem","position":2,"name":"WTF is JSON-RPC ?"}]},{"@type":"WebSite","@id":"https:\/\/omniatech.io\/pages\/#website","url":"https:\/\/omniatech.io\/pages\/","name":"OMNIA","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/omniatech.io\/pages\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/omniatech.io\/pages\/#\/schema\/person\/902af0aeb9024ae8230d12052adcb822","name":"Alex Lupascu","url":"https:\/\/omniatech.io\/pages\/author\/alexlupascu\/"}]}},"uagb_featured_image_src":{"full":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp",720,403,false],"thumbnail":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ-150x150.webp",150,150,true],"medium":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ-300x168.webp",300,168,true],"medium_large":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp",720,403,false],"large":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp",720,403,false],"1536x1536":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp",720,403,false],"2048x2048":["https:\/\/omniatech.io\/pages\/wp-content\/uploads\/2023\/05\/1_eUYBk9fk77DvdJSN-b1YUQ.webp",720,403,false]},"uagb_author_info":{"display_name":"Alex Lupascu","author_link":"https:\/\/omniatech.io\/pages\/author\/alexlupascu\/"},"uagb_comment_info":0,"uagb_excerpt":"3 min read Developers can often use a lot of different complex concepts to get to a final, easy-to-use product. JSON-RPC may be something that throws off most people when they see it mentioned, although it\u2019s a data exchange protocol that allows a client to communicate with a server. The client (i.e. a blockchain explorer&hellip;","mfb_rest_fields":["wbAuthor","wbDate","wbCategories","wbComment","yoast_head","yoast_head_json","uagb_featured_image_src","uagb_author_info","uagb_comment_info","uagb_excerpt"],"_links":{"self":[{"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/posts\/2554"}],"collection":[{"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/comments?post=2554"}],"version-history":[{"count":1,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/posts\/2554\/revisions"}],"predecessor-version":[{"id":2556,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/posts\/2554\/revisions\/2556"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/media\/2555"}],"wp:attachment":[{"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/media?parent=2554"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/categories?post=2554"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/omniatech.io\/pages\/wp-json\/wp\/v2\/tags?post=2554"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}