<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=V</id>
	<title>Bitcoin Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=V"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/V"/>
	<updated>2026-05-17T02:28:49Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=API_reference_(JSON-RPC)&amp;diff=70362</id>
		<title>API reference (JSON-RPC)</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=API_reference_(JSON-RPC)&amp;diff=70362"/>
		<updated>2024-10-28T10:14:08Z</updated>

		<summary type="html">&lt;p&gt;V: The link is broken, and, moreover, it just redirects to Wikipedia from the site.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Controlling Bitcoin Core ==&lt;br /&gt;
&lt;br /&gt;
Run &#039;&#039;bitcoind&#039;&#039; or &#039;&#039;bitcoin-qt -server&#039;&#039;. You can control it via the command-line bitcoin-cli utility or by [http://json-rpc.org/wiki/specification HTTP JSON-RPC] commands.&lt;br /&gt;
&lt;br /&gt;
You must create a bitcoin.conf configuration file setting an rpcuser and rpcpassword; see [[Running Bitcoin]] for details.&lt;br /&gt;
&lt;br /&gt;
Now run:&lt;br /&gt;
  $ ./bitcoind -daemon&lt;br /&gt;
  bitcoin server starting&lt;br /&gt;
  $ ./bitcoin-cli -rpcwait help&lt;br /&gt;
  # shows the help text&lt;br /&gt;
&lt;br /&gt;
A [[Original Bitcoin client/API Calls list|list of RPC calls]] will be shown.&lt;br /&gt;
&lt;br /&gt;
  $ ./bitcoin-cli getbalance&lt;br /&gt;
  2000.00000&lt;br /&gt;
&lt;br /&gt;
If you are learning the API, it is a very good idea to use the test network (run bitcoind -testnet and bitcoin-cli -testnet).&lt;br /&gt;
&lt;br /&gt;
== JSON-RPC ==&lt;br /&gt;
&lt;br /&gt;
Running Bitcoin with the -server argument (or running bitcoind) tells it to function as a [http://json-rpc.org/wiki/specification HTTP JSON-RPC] server, but &lt;br /&gt;
[http://en.wikipedia.org/wiki/Basic_access_authentication Basic access authentication] must be used when communicating with it, and, for security, by default, the server only accepts connections from other processes on the same machine.  If your HTTP or JSON library requires you to specify which &#039;realm&#039; is authenticated, use &#039;jsonrpc&#039;.&lt;br /&gt;
&lt;br /&gt;
Bitcoin supports SSL (https) JSON-RPC connections beginning with version 0.3.14.  See the [[Enabling SSL on original client daemon|rpcssl wiki page]] for setup instructions and a list of all bitcoin.conf configuration options.&lt;br /&gt;
&lt;br /&gt;
Allowing arbitrary machines to access the JSON-RPC port (using the rpcallowip [[Running_Bitcoin|configuration option]]) is dangerous and &#039;&#039;&#039;strongly discouraged&#039;&#039;&#039;-- access should be strictly limited to trusted machines.&lt;br /&gt;
&lt;br /&gt;
== Proper money handling ==&lt;br /&gt;
&lt;br /&gt;
See the [[Proper Money Handling (JSON-RPC)|proper money handling page]] for notes on avoiding rounding errors when handling bitcoin values.&lt;br /&gt;
&lt;br /&gt;
== Languages ==&lt;br /&gt;
&lt;br /&gt;
=== Python ===&lt;br /&gt;
&lt;br /&gt;
[http://json-rpc.org/wiki/python-json-rpc python-jsonrpc] is the official JSON-RPC implementation for Python.&lt;br /&gt;
It automatically generates Python methods for RPC calls.&lt;br /&gt;
However, due to its design for supporting old versions of Python, it is also rather inefficient.&lt;br /&gt;
[[User:jgarzik|jgarzik]] has forked it as [https://github.com/jgarzik/python-bitcoinrpc Python-BitcoinRPC] and optimized it for current versions.&lt;br /&gt;
Generally, this version is recommended.&lt;br /&gt;
&lt;br /&gt;
While BitcoinRPC lacks a few obscure features from jsonrpc, software using only the ServiceProxy class can be written the same to work with either version the user might choose to install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from jsonrpc import ServiceProxy&lt;br /&gt;
  &lt;br /&gt;
access = ServiceProxy(&amp;quot;http://user:password@127.0.0.1:8332&amp;quot;)&lt;br /&gt;
access.getblockchaininfo()&lt;br /&gt;
access.listreceivedbyaddress(6)&lt;br /&gt;
#access.sendtoaddress(&amp;quot;11yEmxiMso2RsFVfBcCa616npBvGgxiBX&amp;quot;, 10)&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The latest version of python-bitcoinrpc has a new syntax.&lt;br /&gt;
&amp;lt;source lang=&amp;quot;python&amp;quot;&amp;gt;&lt;br /&gt;
from bitcoinrpc.authproxy import AuthServiceProxy&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ruby ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;ruby&amp;quot;&amp;gt;&lt;br /&gt;
require &#039;net/http&#039;&lt;br /&gt;
require &#039;uri&#039;&lt;br /&gt;
require &#039;json&#039;&lt;br /&gt;
&lt;br /&gt;
class BitcoinRPC&lt;br /&gt;
  def initialize(service_url)&lt;br /&gt;
    @uri = URI.parse(service_url)&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def method_missing(name, *args)&lt;br /&gt;
    post_body = { &#039;method&#039; =&amp;gt; name, &#039;params&#039; =&amp;gt; args, &#039;id&#039; =&amp;gt; &#039;jsonrpc&#039; }.to_json&lt;br /&gt;
    resp = JSON.parse( http_post_request(post_body) )&lt;br /&gt;
    raise JSONRPCError, resp[&#039;error&#039;] if resp[&#039;error&#039;]&lt;br /&gt;
    resp[&#039;result&#039;]&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  def http_post_request(post_body)&lt;br /&gt;
    http    = Net::HTTP.new(@uri.host, @uri.port)&lt;br /&gt;
    request = Net::HTTP::Post.new(@uri.request_uri)&lt;br /&gt;
    request.basic_auth @uri.user, @uri.password&lt;br /&gt;
    request.content_type = &#039;application/json&#039;&lt;br /&gt;
    request.body = post_body&lt;br /&gt;
    http.request(request).body&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  class JSONRPCError &amp;lt; RuntimeError; end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
if $0 == __FILE__&lt;br /&gt;
  h = BitcoinRPC.new(&#039;http://user:password@127.0.0.1:8332&#039;)&lt;br /&gt;
  p h.getbalance&lt;br /&gt;
  p h.getblockchaininfo&lt;br /&gt;
  p h.getnewaddress&lt;br /&gt;
  p h.dumpprivkey( h.getnewaddress )&lt;br /&gt;
  # also see: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_Calls_list&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Erlang ===&lt;br /&gt;
Get the rebar dependency from https://github.com/edescourtis/ebitcoind . By default the client will use the configuration in &amp;lt;code&amp;gt;$HOME/.bitcoin/bitcoin.conf&amp;lt;/code&amp;gt; or you can instead specify a URI like this:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;erlang&amp;quot;&amp;gt;ebitcoind:start_link(&amp;lt;&amp;lt;&amp;quot;http://user:password@localhost:8332/&amp;quot;&amp;gt;&amp;gt;).&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Here is a usage example:&lt;br /&gt;
&amp;lt;source lang=&amp;quot;erlang&amp;quot;&amp;gt;&lt;br /&gt;
1&amp;gt; {ok,Pid} = ebitcoind:start_link().&lt;br /&gt;
{ok,&amp;lt;0.177.0&amp;gt;}&lt;br /&gt;
2&amp;gt; ebitcoind:getbalance(Pid).&lt;br /&gt;
8437.02478294&lt;br /&gt;
3&amp;gt; ebitcoind:getblockchaininfo(Pid).&lt;br /&gt;
{ok, #{&amp;lt;&amp;lt;&amp;quot;balance&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 8437.02478294,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;blocks&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 260404,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;connections&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 8,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;difficulty&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 148819199.80509263,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;errors&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;gt;&amp;gt;,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;keypoololdest&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1420307921,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;keypoolsize&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 102,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;paytxfee&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 0.0,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;protocolversion&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 70002,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;proxy&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;gt;&amp;gt;,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;relayfee&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1.0e-5,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;testnet&amp;quot;&amp;gt;&amp;gt; =&amp;gt; false,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;timeoffset&amp;quot;&amp;gt;&amp;gt; =&amp;gt; -3,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;version&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 90300,&lt;br /&gt;
  &amp;lt;&amp;lt;&amp;quot;walletversion&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 60000}}&lt;br /&gt;
4&amp;gt; ebitcoind:setgenerate(Pid,true).&lt;br /&gt;
{ok, null}&lt;br /&gt;
5&amp;gt; ebitcoind:getblocktemplate(Pid, #{}).                     &lt;br /&gt;
{ok,#{&amp;lt;&amp;lt;&amp;quot;bits&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;181b0dca&amp;quot;&amp;gt;&amp;gt;,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;coinbaseaux&amp;quot;&amp;gt;&amp;gt; =&amp;gt; #{&amp;lt;&amp;lt;&amp;quot;flags&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;062f503253482f&amp;quot;&amp;gt;&amp;gt;},&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;coinbasevalue&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 2518690558,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;curtime&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1420421249,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;height&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 337533,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;mintime&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1420416332,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;mutable&amp;quot;&amp;gt;&amp;gt; =&amp;gt; [&amp;lt;&amp;lt;&amp;quot;time&amp;quot;&amp;gt;&amp;gt;,&amp;lt;&amp;lt;&amp;quot;transactions&amp;quot;&amp;gt;&amp;gt;,&amp;lt;&amp;lt;&amp;quot;prevblock&amp;quot;&amp;gt;&amp;gt;],&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;noncerange&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;00000000ffffffff&amp;quot;&amp;gt;&amp;gt;,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;previousblockhash&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;000000000000000017ce0a0d328bf84cc597785844393e899e9a971a81679a5f&amp;quot;&amp;gt;&amp;gt;,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;sigoplimit&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 20000,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;sizelimit&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1000000,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;target&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;00000000000000001b0dca00000000000000000000000000000000000000&amp;quot;...&amp;gt;&amp;gt;,&lt;br /&gt;
      &amp;lt;&amp;lt;&amp;quot;transactions&amp;quot;&amp;gt;&amp;gt; =&amp;gt; [#{&amp;lt;&amp;lt;&amp;quot;data&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;01000000049b47ce225d29bff7c18b7df7d7df4693523a52&amp;quot;...&amp;gt;&amp;gt;,&lt;br /&gt;
         &amp;lt;&amp;lt;&amp;quot;depends&amp;quot;&amp;gt;&amp;gt; =&amp;gt; [],&lt;br /&gt;
         &amp;lt;&amp;lt;&amp;quot;fee&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 0,&lt;br /&gt;
         &amp;lt;&amp;lt;&amp;quot;hash&amp;quot;&amp;gt;&amp;gt; =&amp;gt; &amp;lt;&amp;lt;&amp;quot;6d0d76e1f27b3a6f7325923710dcdb4107c9&amp;quot;...&amp;gt;&amp;gt;,&lt;br /&gt;
         &amp;lt;&amp;lt;&amp;quot;sigops&amp;quot;&amp;gt;&amp;gt; =&amp;gt; 1},&lt;br /&gt;
      ...&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== PHP ===&lt;br /&gt;
&lt;br /&gt;
The [http://jsonrpcphp.org/ JSON-RPC PHP] library also makes it very easy to connect to Bitcoin.  For example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;php&amp;quot;&amp;gt;&lt;br /&gt;
  require_once &#039;jsonRPCClient.php&#039;;&lt;br /&gt;
  &lt;br /&gt;
  $bitcoin = new jsonRPCClient(&#039;http://user:password@127.0.0.1:8332/&#039;);&lt;br /&gt;
   &lt;br /&gt;
  echo &amp;quot;&amp;lt;pre&amp;gt;\n&amp;quot;;&lt;br /&gt;
  print_r($bitcoin-&amp;gt;getblockchaininfo()); echo &amp;quot;\n&amp;quot;;&lt;br /&gt;
  echo &amp;quot;Received: &amp;quot;.$bitcoin-&amp;gt;getreceivedbylabel(&amp;quot;Your Address&amp;quot;).&amp;quot;\n&amp;quot;;&lt;br /&gt;
  echo &amp;quot;&amp;lt;/pre&amp;gt;&amp;quot;;&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The jsonRPCClient library uses fopen() and will throw an exception saying &amp;quot;Unable to connect&amp;quot; if it receives a 404 or 500 error from bitcoind. This prevents you from being able to see error messages generated by bitcoind (as they are sent with status 404 or 500). The [https://github.com/aceat64/EasyBitcoin-PHP EasyBitcoin-PHP library] is similar in function to JSON-RPC PHP but does not have this issue.&lt;br /&gt;
&lt;br /&gt;
=== Java ===&lt;br /&gt;
&lt;br /&gt;
The easiest way to tell Java to use HTTP Basic authentication is to set a default Authenticator:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
  final String rpcuser =&amp;quot;...&amp;quot;;&lt;br /&gt;
  final String rpcpassword =&amp;quot;...&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
  Authenticator.setDefault(new Authenticator() {&lt;br /&gt;
      protected PasswordAuthentication getPasswordAuthentication() {&lt;br /&gt;
          return new PasswordAuthentication (rpcuser, rpcpassword.toCharArray());&lt;br /&gt;
      }&lt;br /&gt;
  });&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once that is done, [http://json-rpc.org/wiki/implementations any JSON-RPC library for Java] (or ordinary URL POSTs) may be used to communicate with the Bitcoin server.&lt;br /&gt;
&lt;br /&gt;
Instead of writing your own implementation, consider using one of the existing wrappers like [https://github.com/johannbarbie/BitcoindClient4J BitcoindClient4J], [https://github.com/priiduneemre/btcd-cli4j btcd-cli4j] or [[Bitcoin-JSON-RPC-Client|Bitcoin-JSON-RPC-Client]] instead.&lt;br /&gt;
&lt;br /&gt;
=== Perl ===&lt;br /&gt;
&lt;br /&gt;
The JSON::RPC package from CPAN can be used to communicate with Bitcoin.  You must set the client&#039;s credentials; for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;perl&amp;quot;&amp;gt;&lt;br /&gt;
  use JSON::RPC::Client;&lt;br /&gt;
  use Data::Dumper;&lt;br /&gt;
   &lt;br /&gt;
  my $client = new JSON::RPC::Client;&lt;br /&gt;
  &lt;br /&gt;
  $client-&amp;gt;ua-&amp;gt;credentials(&lt;br /&gt;
     &#039;localhost:8332&#039;, &#039;jsonrpc&#039;, &#039;user&#039; =&amp;gt; &#039;password&#039;  # REPLACE WITH YOUR bitcoin.conf rpcuser/rpcpassword&lt;br /&gt;
      );&lt;br /&gt;
  &lt;br /&gt;
  my $uri = &#039;http://localhost:8332/&#039;;&lt;br /&gt;
  my $obj = {&lt;br /&gt;
      method  =&amp;gt; &#039;getblockchaininfo&#039;,&lt;br /&gt;
      params  =&amp;gt; [],&lt;br /&gt;
   };&lt;br /&gt;
   &lt;br /&gt;
  my $res = $client-&amp;gt;call( $uri, $obj );&lt;br /&gt;
   &lt;br /&gt;
  if ($res){&lt;br /&gt;
      if ($res-&amp;gt;is_error) { print &amp;quot;Error : &amp;quot;, $res-&amp;gt;error_message; }&lt;br /&gt;
      else { print Dumper($res-&amp;gt;result); }&lt;br /&gt;
  } else {&lt;br /&gt;
      print $client-&amp;gt;status_line;&lt;br /&gt;
  }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Go ===&lt;br /&gt;
&lt;br /&gt;
The [https://github.com/btcsuite/btcrpcclient btcrpcclient package] can be used to communicate with Bitcoin.  You must provide credentials to match the client you are communicating with.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;go&amp;quot;&amp;gt;&lt;br /&gt;
package main&lt;br /&gt;
&lt;br /&gt;
import (&lt;br /&gt;
	&amp;quot;github.com/btcsuite/btcd/chaincfg&amp;quot;&lt;br /&gt;
	&amp;quot;github.com/btcsuite/btcrpcclient&amp;quot;&lt;br /&gt;
	&amp;quot;github.com/btcsuite/btcutil&amp;quot;&lt;br /&gt;
	&amp;quot;log&amp;quot;&lt;br /&gt;
)&lt;br /&gt;
&lt;br /&gt;
func main() {&lt;br /&gt;
	// create new client instance&lt;br /&gt;
	client, err := btcrpcclient.New(&amp;amp;btcrpcclient.ConnConfig{&lt;br /&gt;
		HTTPPostMode: true,&lt;br /&gt;
		DisableTLS:   true,&lt;br /&gt;
		Host:         &amp;quot;127.0.0.1:8332&amp;quot;,&lt;br /&gt;
		User:         &amp;quot;rpcUsername&amp;quot;,&lt;br /&gt;
		Pass:         &amp;quot;rpcPassword&amp;quot;,&lt;br /&gt;
	}, nil)&lt;br /&gt;
	if err != nil {&lt;br /&gt;
		log.Fatalf(&amp;quot;error creating new btc client: %v&amp;quot;, err)&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// list accounts&lt;br /&gt;
	accounts, err := client.ListAccounts()&lt;br /&gt;
	if err != nil {&lt;br /&gt;
		log.Fatalf(&amp;quot;error listing accounts: %v&amp;quot;, err)&lt;br /&gt;
	}&lt;br /&gt;
	// iterate over accounts (map[string]btcutil.Amount) and write to stdout&lt;br /&gt;
	for label, amount := range accounts {&lt;br /&gt;
		log.Printf(&amp;quot;%s: %s&amp;quot;, label, amount)&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// prepare a sendMany transaction&lt;br /&gt;
	receiver1, err := btcutil.DecodeAddress(&amp;quot;1someAddressThatIsActuallyReal&amp;quot;, &amp;amp;chaincfg.MainNetParams)&lt;br /&gt;
	if err != nil {&lt;br /&gt;
		log.Fatalf(&amp;quot;address receiver1 seems to be invalid: %v&amp;quot;, err)&lt;br /&gt;
	}&lt;br /&gt;
	receiver2, err := btcutil.DecodeAddress(&amp;quot;1anotherAddressThatsPrettyReal&amp;quot;, &amp;amp;chaincfg.MainNetParams)&lt;br /&gt;
	if err != nil {&lt;br /&gt;
		log.Fatalf(&amp;quot;address receiver2 seems to be invalid: %v&amp;quot;, err)&lt;br /&gt;
	}&lt;br /&gt;
	receivers := map[btcutil.Address]btcutil.Amount{&lt;br /&gt;
		receiver1: 42,  // 42 satoshi&lt;br /&gt;
		receiver2: 100, // 100 satoshi&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// create and send the sendMany tx&lt;br /&gt;
	txSha, err := client.SendMany(&amp;quot;some-account-label-from-which-to-send&amp;quot;, receivers)&lt;br /&gt;
	if err != nil {&lt;br /&gt;
		log.Fatalf(&amp;quot;error sendMany: %v&amp;quot;, err)&lt;br /&gt;
	}&lt;br /&gt;
	log.Printf(&amp;quot;sendMany completed! tx sha is: %s&amp;quot;, txSha.String())&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== .NET (C#) ===&lt;br /&gt;
The communication with the RPC service can be achieved using the standard http request/response objects.&lt;br /&gt;
A library for serializing and deserializing Json will make your life a lot easier:&lt;br /&gt;
&lt;br /&gt;
Json.NET ( http://james.newtonking.com/json ) is a high performance JSON package for .NET.  It is also available via NuGet from the package manager console ( Install-Package Newtonsoft.Json ).&lt;br /&gt;
&lt;br /&gt;
The following example uses Json.NET:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
 HttpWebRequest webRequest = (HttpWebRequest)WebRequest.Create(&amp;quot;http://localhost.:8332&amp;quot;);&lt;br /&gt;
 webRequest.Credentials = new NetworkCredential(&amp;quot;user&amp;quot;, &amp;quot;pwd&amp;quot;);&lt;br /&gt;
 /// important, otherwise the service can&#039;t desirialse your request properly&lt;br /&gt;
 webRequest.ContentType = &amp;quot;application/json-rpc&amp;quot;;&lt;br /&gt;
 webRequest.Method = &amp;quot;POST&amp;quot;;&lt;br /&gt;
  &lt;br /&gt;
 JObject joe = new JObject();&lt;br /&gt;
 joe.Add(new JProperty(&amp;quot;jsonrpc&amp;quot;, &amp;quot;1.0&amp;quot;));&lt;br /&gt;
 joe.Add(new JProperty(&amp;quot;id&amp;quot;, &amp;quot;1&amp;quot;));&lt;br /&gt;
 joe.Add(new JProperty(&amp;quot;method&amp;quot;, Method));&lt;br /&gt;
 // params is a collection values which the method requires..&lt;br /&gt;
 if (Params.Keys.Count == 0)&lt;br /&gt;
 {&lt;br /&gt;
  joe.Add(new JProperty(&amp;quot;params&amp;quot;, new JArray()));&lt;br /&gt;
 }&lt;br /&gt;
 else&lt;br /&gt;
 {&lt;br /&gt;
     JArray props = new JArray();&lt;br /&gt;
     // add the props in the reverse order!&lt;br /&gt;
     for (int i = Params.Keys.Count - 1; i &amp;gt;= 0; i--)&lt;br /&gt;
     {&lt;br /&gt;
        .... // add the params&lt;br /&gt;
     }&lt;br /&gt;
     joe.Add(new JProperty(&amp;quot;params&amp;quot;, props));&lt;br /&gt;
     }&lt;br /&gt;
  &lt;br /&gt;
     // serialize json for the request&lt;br /&gt;
     string s = JsonConvert.SerializeObject(joe);&lt;br /&gt;
     byte[] byteArray = Encoding.UTF8.GetBytes(s);&lt;br /&gt;
     webRequest.ContentLength = byteArray.Length;&lt;br /&gt;
     Stream dataStream = webRequest.GetRequestStream();&lt;br /&gt;
     dataStream.Write(byteArray, 0, byteArray.Length);&lt;br /&gt;
     dataStream.Close();&lt;br /&gt;
     &lt;br /&gt;
     &lt;br /&gt;
     WebResponse webResponse = webRequest.GetResponse();&lt;br /&gt;
     &lt;br /&gt;
     ... // deserialze the response&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There is also a wrapper for Json.NET called Bitnet (https://sourceforge.net/projects/bitnet)&lt;br /&gt;
implementing Bitcoin API in more convenient way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
     BitnetClient bc = new BitnetClient(&amp;quot;http://127.0.0.1:8332&amp;quot;);&lt;br /&gt;
     bc.Credentials = new NetworkCredential(&amp;quot;user&amp;quot;, &amp;quot;pass&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
     var p = bc.GetDifficulty();&lt;br /&gt;
     Console.WriteLine(&amp;quot;Difficulty:&amp;quot; + p.ToString());&lt;br /&gt;
&lt;br /&gt;
     var inf = bc.GetBlockchainInfo();&lt;br /&gt;
     Console.WriteLine(&amp;quot;Balance:&amp;quot; + inf[&amp;quot;balance&amp;quot;]);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A more complete library and wrapper for Bitcoin is [https://github.com/GeorgeKimionis/BitcoinLib BitcoinLib] (https://github.com/GeorgeKimionis/BitcoinLib) which is also available via [https://www.nuget.org/packages/BitcoinLib/ NuGet] from the package manager console (Install-Package BitcoinLib). &lt;br /&gt;
&lt;br /&gt;
Querying the daemon with [https://github.com/GeorgeKimionis/BitcoinLib BitcoinLib] is as simple as:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
     IBitcoinService bitcoinService = new BitcoinService();&lt;br /&gt;
&lt;br /&gt;
     var networkDifficulty = bitcoinService.GetDifficulty();&lt;br /&gt;
     var myBalance = bitcoinService.GetBalance();&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Node.js ===&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/ruimarinho/bitcoin-core bitcoin-core] (npm: [https://www.npmjs.com/package/bitcoin-core bitcoin-core]) &lt;br /&gt;
&lt;br /&gt;
Example using bitcoin-core:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
const Client = require(&#039;bitcoin-core&#039;);&lt;br /&gt;
const client = new Client({ &lt;br /&gt;
  network: &#039;regtest&#039;, &lt;br /&gt;
  username: &#039;user&#039;, &lt;br /&gt;
  password: &#039;pass&#039;, &lt;br /&gt;
  port: 18443 &lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
client.getBlockchainInfo().then((help) =&amp;gt; console.log(help));&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Deno ===&lt;br /&gt;
&lt;br /&gt;
* Github: [https://github.com/timonson/gentle_rpc gentle_rpc] or deno.land: [https://deno.land/x/gentle_rpc gentle_rpc] &lt;br /&gt;
&lt;br /&gt;
gentle_rpc is a TypeScript JSON-RPC 2.0 library for Deno and the browser, it works perfectly with lowercase function names. There is also a transpiled JavaScript bundle in the repository which you can import directly into the browser. &lt;br /&gt;
&lt;br /&gt;
Example using gentle_rpc:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;typescript&amp;quot;&amp;gt;&lt;br /&gt;
import { createRemote } from &amp;quot;https://deno.land/x/gentle_rpc/mod.ts&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
const Node = new URL(&amp;quot;http://127.0.0.1&amp;quot;);&lt;br /&gt;
Node.port = &amp;quot;18332&amp;quot;;&lt;br /&gt;
Node.username = &amp;quot;BitcoinUser&amp;quot;;&lt;br /&gt;
Node.password = &amp;quot;BitcoinPassword&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
const remote = createRemote(Node);&lt;br /&gt;
const info = await remote.call(&amp;quot;getblockchaininfo&amp;quot;);&lt;br /&gt;
console.log(info);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command line (cURL) ===&lt;br /&gt;
&lt;br /&gt;
You can also send commands and see results using [http://curl.haxx.se/ cURL] or some other command-line HTTP-fetching utility; for example:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
  curl --user user --data-binary &#039;{&amp;quot;jsonrpc&amp;quot;: &amp;quot;1.0&amp;quot;, &amp;quot;id&amp;quot;:&amp;quot;curltest&amp;quot;, &amp;quot;method&amp;quot;: &amp;quot;getblockchaininfo&amp;quot;, &amp;quot;params&amp;quot;: [] }&#039; &lt;br /&gt;
    -H &#039;content-type: text/plain;&#039; http://127.0.0.1:8332/&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
You will be prompted for your rpcpassword, and then will see something like:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
  {&amp;quot;result&amp;quot;:{&amp;quot;balance&amp;quot;:0.000000000000000,&amp;quot;blocks&amp;quot;:59952,&amp;quot;connections&amp;quot;:48,&amp;quot;proxy&amp;quot;:&amp;quot;&amp;quot;,&amp;quot;generate&amp;quot;:false,&lt;br /&gt;
     &amp;quot;genproclimit&amp;quot;:-1,&amp;quot;difficulty&amp;quot;:16.61907875185736},&amp;quot;error&amp;quot;:null,&amp;quot;id&amp;quot;:&amp;quot;curltest&amp;quot;}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Command line (jsonrpc-cli) ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/dan-da/jsonrpc-cli jsonrpc-cli] provides simple json queries from the command-line with highlighted json results (colors) and the ability to view/debug raw http requests and responses.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
 jsonrpc-cli --user=rpcuser --pass=rpcpassword  http://localhost:8332/ getblockchaininfo&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: 109900,&lt;br /&gt;
    &amp;quot;protocolversion&amp;quot;: 70002,&lt;br /&gt;
    &amp;quot;walletversion&amp;quot;: 60000,&lt;br /&gt;
    &amp;quot;balance&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;blocks&amp;quot;: 588597,&lt;br /&gt;
    &amp;quot;timeoffset&amp;quot;: -1,&lt;br /&gt;
    &amp;quot;connections&amp;quot;: 9,&lt;br /&gt;
    &amp;quot;proxy&amp;quot;: &amp;quot;127.0.0.1:9050&amp;quot;,&lt;br /&gt;
    &amp;quot;difficulty&amp;quot;: 9013786945891.682,&lt;br /&gt;
    &amp;quot;testnet&amp;quot;: false,&lt;br /&gt;
    &amp;quot;keypoololdest&amp;quot;: 1463279619,&lt;br /&gt;
    &amp;quot;keypoolsize&amp;quot;: 101,&lt;br /&gt;
    &amp;quot;paytxfee&amp;quot;: 0,&lt;br /&gt;
    &amp;quot;relayfee&amp;quot;: 1.0e-5,&lt;br /&gt;
    &amp;quot;errors&amp;quot;: null&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Clojure ===&lt;br /&gt;
&lt;br /&gt;
[https://github.com/aviad/clj-btc clj-btc] is a Clojure wrapper for the bitcoin API.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;clojure&amp;quot;&amp;gt;&lt;br /&gt;
user=&amp;gt; (require &#039;[clj-btc.core :as btc])&lt;br /&gt;
nil&lt;br /&gt;
user=&amp;gt; (btc/getblockchaininfo)&lt;br /&gt;
{&amp;quot;timeoffset&amp;quot; 0, &amp;quot;protocolversion&amp;quot; 70001, &amp;quot;blocks&amp;quot; 111908, &amp;quot;errors&amp;quot; &amp;quot;&amp;quot;,&lt;br /&gt;
 &amp;quot;testnet&amp;quot; true, &amp;quot;proxy&amp;quot; &amp;quot;&amp;quot;, &amp;quot;connections&amp;quot; 4, &amp;quot;version&amp;quot; 80500,&lt;br /&gt;
 &amp;quot;keypoololdest&amp;quot; 1380388750, &amp;quot;paytxfee&amp;quot; 0E-8M,&lt;br /&gt;
 &amp;quot;difficulty&amp;quot; 4642.44443532M, &amp;quot;keypoolsize&amp;quot; 101, &amp;quot;balance&amp;quot; 0E-8M,&lt;br /&gt;
 &amp;quot;walletversion&amp;quot; 60000}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== C ===&lt;br /&gt;
The C API for processing JSON is [https://jansson.readthedocs.org/en/latest/ Jansson]. C applications like [https://github.com/bitcoin/libblkmaker libblkmaker] use [[API_reference_(JSON-RPC)#Command_line_.28cURL.29|cURL]] for making the calls and Jansson for interpreting the JSON that cURL fetches.&lt;br /&gt;
&lt;br /&gt;
For example basic usage (which can be easily modified for Bitcoin RPC), see the Jansson example [https://jansson.readthedocs.org/en/latest/_downloads/github_commits.c github_commits.c] and [https://jansson.readthedocs.org/en/latest/tutorial.html#the-github-repo-commits-api the associated tutorial].&lt;br /&gt;
&lt;br /&gt;
The following does with libcurl what the [[API_reference_(JSON-RPC)#Command_line_.28cURL.29|cURL example above]] does:&amp;lt;source lang=&amp;quot;c&amp;quot;&amp;gt;#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;curl/curl.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
    CURL *curl = curl_easy_init();&lt;br /&gt;
    struct curl_slist *headers = NULL;&lt;br /&gt;
&lt;br /&gt;
    if (curl) {&lt;br /&gt;
	const char *data =&lt;br /&gt;
	    &amp;quot;{\&amp;quot;jsonrpc\&amp;quot;: \&amp;quot;1.0\&amp;quot;, \&amp;quot;id\&amp;quot;:\&amp;quot;curltest\&amp;quot;, \&amp;quot;method\&amp;quot;: \&amp;quot;getblockchaininfo\&amp;quot;, \&amp;quot;params\&amp;quot;: [] }&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
	headers = curl_slist_append(headers, &amp;quot;content-type: text/plain;&amp;quot;);&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_HTTPHEADER, headers);&lt;br /&gt;
&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_URL, &amp;quot;http://127.0.0.1:8332/&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_POSTFIELDSIZE, (long) strlen(data));&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_POSTFIELDS, data);&lt;br /&gt;
&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_USERPWD,&lt;br /&gt;
			 &amp;quot;bitcoinrpcUSERNAME:bitcoinrpcPASSWORD&amp;quot;);&lt;br /&gt;
&lt;br /&gt;
	curl_easy_setopt(curl, CURLOPT_USE_SSL, CURLUSESSL_TRY);&lt;br /&gt;
&lt;br /&gt;
	curl_easy_perform(curl);&lt;br /&gt;
    }&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;This output can be parsed with Jansson, &#039;&#039;à la&#039;&#039; the Jansson tutorial linked to above.&lt;br /&gt;
&lt;br /&gt;
(source: [https://bitcoin.stackexchange.com/a/41158/4334 Bitcoin StackExchange])&lt;br /&gt;
&lt;br /&gt;
=== Qt/C++ ===&lt;br /&gt;
&lt;br /&gt;
[https://bitbucket.org/devonit/qjsonrpc/overview QJsonRpc] is a Qt/C++ implementation of the JSON-RPC protocol. It integrates nicely with Qt, leveraging Qt&#039;s meta object system in order to provide services over the JSON-RPC protocol. QJsonRpc is licensed under the LGPLv2.1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
 * Copyright (C) 2012-2013 Matt Broadstone&lt;br /&gt;
 * Contact: http://bitbucket.org/devonit/qjsonrpc&lt;br /&gt;
 *&lt;br /&gt;
 * This file is part of the QJsonRpc Library.&lt;br /&gt;
 *&lt;br /&gt;
 * This library is free software; you can redistribute it and/or&lt;br /&gt;
 * modify it under the terms of the GNU Lesser General Public&lt;br /&gt;
 * License as published by the Free Software Foundation; either&lt;br /&gt;
 * version 2.1 of the License, or (at your option) any later version.&lt;br /&gt;
 *&lt;br /&gt;
 * This library is distributed in the hope that it will be useful,&lt;br /&gt;
 * but WITHOUT ANY WARRANTY; without even the implied warranty of&lt;br /&gt;
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU&lt;br /&gt;
 * Lesser General Public License for more details.&lt;br /&gt;
 */&lt;br /&gt;
#include &amp;lt;QCoreApplication&amp;gt;&lt;br /&gt;
#include &amp;lt;QAuthenticator&amp;gt;&lt;br /&gt;
#include &amp;lt;QStringList&amp;gt;&lt;br /&gt;
#include &amp;lt;QDebug&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#include &amp;quot;qjsonrpchttpclient.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
class HttpClient : public QJsonRpcHttpClient&lt;br /&gt;
{&lt;br /&gt;
    Q_OBJECT&lt;br /&gt;
public:&lt;br /&gt;
    HttpClient(const QString &amp;amp;endpoint, QObject *parent = 0)&lt;br /&gt;
        : QJsonRpcHttpClient(endpoint, parent)&lt;br /&gt;
    {&lt;br /&gt;
        // defaults added for my local test server&lt;br /&gt;
        m_username = &amp;quot;bitcoinrpc&amp;quot;;&lt;br /&gt;
        m_password = &amp;quot;232fb3276bbb7437d265298ea48bdc46&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void setUsername(const QString &amp;amp;username) {&lt;br /&gt;
        m_username = username;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    void setPassword(const QString &amp;amp;password) {&lt;br /&gt;
        m_password = password;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private Q_SLOTS:&lt;br /&gt;
    virtual void handleAuthenticationRequired(QNetworkReply *reply, QAuthenticator * authenticator)&lt;br /&gt;
    {&lt;br /&gt;
        Q_UNUSED(reply)&lt;br /&gt;
        authenticator-&amp;gt;setUser(m_username);&lt;br /&gt;
        authenticator-&amp;gt;setPassword(m_password);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
private:&lt;br /&gt;
    QString m_username;&lt;br /&gt;
    QString m_password;&lt;br /&gt;
&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
int main(int argc, char **argv)&lt;br /&gt;
{&lt;br /&gt;
    QCoreApplication app(argc, argv);&lt;br /&gt;
    if (app.arguments().size() &amp;lt; 2) {&lt;br /&gt;
        qDebug() &amp;lt;&amp;lt; &amp;quot;usage: &amp;quot; &amp;lt;&amp;lt; argv[0] &amp;lt;&amp;lt; &amp;quot;[-u username] [-p password] &amp;lt;command&amp;gt; &amp;lt;arguments&amp;gt;&amp;quot;;&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    HttpClient client(&amp;quot;http://127.0.0.1:8332&amp;quot;);&lt;br /&gt;
    if (app.arguments().contains(&amp;quot;-u&amp;quot;)) {&lt;br /&gt;
        int idx = app.arguments().indexOf(&amp;quot;-u&amp;quot;);&lt;br /&gt;
        app.arguments().removeAt(idx);&lt;br /&gt;
        if(idx&amp;lt;app.arguments().count())&lt;br /&gt;
              client.setUsername(app.arguments().takeAt(idx));&lt;br /&gt;
        else qDebug()&amp;lt;&amp;lt;&amp;quot;-u value not defined&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    if (app.arguments().contains(&amp;quot;-p&amp;quot;)) {&lt;br /&gt;
        int idx = app.arguments().indexOf(&amp;quot;-p&amp;quot;);&lt;br /&gt;
        app.arguments().removeAt(idx);&lt;br /&gt;
        if(idx&amp;lt;app.arguments().count())&lt;br /&gt;
            client.setPassword(app.arguments().takeAt(idx));&lt;br /&gt;
        else qDebug()&amp;lt;&amp;lt;&amp;quot;-p value not defined&amp;quot;;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    QJsonRpcMessage message = QJsonRpcMessage::createRequest(app.arguments().at(1));&lt;br /&gt;
    QJsonRpcMessage response = client.sendMessageBlocking(message);&lt;br /&gt;
    if (response.type() == QJsonRpcMessage::Error) {&lt;br /&gt;
        qDebug() &amp;lt;&amp;lt; response.errorData();&lt;br /&gt;
        return -1;&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    qDebug() &amp;lt;&amp;lt; response.toJson();&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Multi-wallet RPC calls ==&lt;br /&gt;
&lt;br /&gt;
[[Bitcoin Knots]] 0.13.1 added support for loading multiple, separate wallets.&lt;br /&gt;
Multi-wallet can be enabled by using more than one &amp;lt;code&amp;gt;-wallet&amp;lt;/code&amp;gt; argument when starting Bitcoin, either on the command line or in the Bitcoin config file.&lt;br /&gt;
This was also included in [[Bitcoin Core]] 0.15.&lt;br /&gt;
&lt;br /&gt;
Wallet-level RPC calls (like &amp;lt;code&amp;gt;importaddress&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;listtransactions&amp;lt;/code&amp;gt;) can specify which wallet file will be accessed. This is done by setting the HTTP endpoint in the JSON-RPC request in the format &amp;lt;code&amp;gt;&amp;lt;RPC IP address&amp;gt;:&amp;lt;RPC port&amp;gt;/wallet/&amp;lt;wallet name&amp;gt;&amp;lt;/code&amp;gt;, for example &amp;lt;code&amp;gt;https://127.0.0.1:8332/wallet/wallet1.dat&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The command line utility bitcoin-cli can specify the wallet file using the &amp;lt;code&amp;gt;-rpcwallet&amp;lt;/code&amp;gt; flag, for example &amp;lt;code&amp;gt;bitcoin-cli -rpcwallet=wallet1.dat getbalance&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For more details see the [https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.15.0.md#multi-wallet-support Bitcoin Core 0.15 release notes]&lt;br /&gt;
&lt;br /&gt;
Alternatively (but not available in Bitcoin Core at this time), an additional parameter can be specified to &amp;lt;code&amp;gt;-rpcauth&amp;lt;/code&amp;gt; naming a default wallet for JSON-RPC accesses to the normal endpoint.&lt;br /&gt;
&lt;br /&gt;
== See Also==&lt;br /&gt;
&lt;br /&gt;
* The Bitcoin Core documentation: https://github.com/bitcoin/bitcoin/blob/master/doc/JSON-RPC-interface.md#json-rpc-interface&lt;br /&gt;
* The Bitcoin Core RPC help for each call: https://bitcoincore.org/en/doc/&lt;br /&gt;
* The Bitcoin Core RPC error codes: https://github.com/bitcoin/bitcoin/blob/master/src/rpc/protocol.h&lt;br /&gt;
* Bitcoin Core RPC API version changes https://masonicboom.github.io/btcrpcapi/&lt;br /&gt;
&lt;br /&gt;
* [[Original_Bitcoin_client/API_Calls_list|API calls list]]&lt;br /&gt;
* [[Running Bitcoin]]&lt;br /&gt;
* [[Lazy API]]&lt;br /&gt;
* [[PHP developer intro]]&lt;br /&gt;
* [[Raw_Transactions|Raw Transactions API]]&lt;br /&gt;
* [https://gourl.io/bitcoin-payment-gateway-api.html GoUrl Bitcoin PHP Payment API]&lt;br /&gt;
* [http://blockchain.info/api/json_rpc_api Web Based JSON RPC interface.]&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Developer]]&lt;br /&gt;
[[zh-cn:API_reference_(JSON-RPC)]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>V</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Full_node&amp;diff=70359</id>
		<title>Full node</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Full_node&amp;diff=70359"/>
		<updated>2024-10-18T20:25:56Z</updated>

		<summary type="html">&lt;p&gt;V: Fixed current block subsidy value.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Any computer that connects to the Bitcoin [[network]] is called a &#039;&#039;&#039;node&#039;&#039;&#039;. Nodes that fully verify all of the rules of Bitcoin are called &#039;&#039;&#039;full nodes&#039;&#039;&#039;. The most popular software implementation of full nodes is called [[Bitcoin Core]], its latest release can be found [https://github.com/bitcoin/bitcoin/releases on the github page].&lt;br /&gt;
&lt;br /&gt;
==What makes a full node?==&lt;br /&gt;
&lt;br /&gt;
Full nodes download every block and transaction and check them against Bitcoin&#039;s consensus rules. Here are examples of consensus rules, though there are many more:&lt;br /&gt;
* Blocks may only [[controlled supply|create]] a certain number of bitcoins. (Currently 3.125 BTC per block.)&lt;br /&gt;
* Transactions must have correct signatures for the bitcoins being spent.&lt;br /&gt;
* Transactions/blocks must be in the correct data format.&lt;br /&gt;
* Within a single [[block chain]], a transaction output cannot be double-spent.&lt;br /&gt;
&lt;br /&gt;
If a transaction or block violates the consensus rules, then it is absolutely rejected, even if every other node on the network thinks that it is valid. This is one of the most important characteristics of full nodes: they do what&#039;s right &#039;&#039;no matter what&#039;&#039;. For full nodes, miners actually have fairly limited power: they can only reorder or remove transactions, and only by spending a lot of computing power. A powerful miner is able to execute [[Weaknesses#Attacker_has_a_lot_of_computing_power|some serious attacks]], but because full nodes rely on miners only for a few things, miners could not completely change or destroy Bitcoin.&lt;br /&gt;
&lt;br /&gt;
Nodes that have different &#039;&#039;consensus&#039;&#039; rules are actually using two different networks/currencies. Changing any of the consensus rules requires a [[hard fork]], which can be thought of as creating a new currency and having everyone move to it. Consensus rules are different from &#039;&#039;policy&#039;&#039; rules, which specify how a node or miner prioritizes or discourages certain things. Policy rules can be changed freely, and different nodes can have different policy rules. Because all full nodes must use &#039;&#039;exactly&#039;&#039; the same consensus rules in order to remain compatible with each other, even duplicating bugs and oddities in the original consensus rules, creating a full node from scratch is extremely difficult and dangerous. It is therefore recommended that everyone who wishes to run a full node uses software based on the [[reference client]], which is the only client guaranteed to behave correctly.&lt;br /&gt;
&lt;br /&gt;
At minimum, a full node must download every transaction that has ever taken place, all new transactions, and all block headers. Additionally, full nodes must store information about every unspent transaction output until it is spent. By default full nodes are inefficient in that they download each new transaction at least twice, and they store the entire block chain (more than 165 GB as of 20180214) forever, even though only the unspent transaction outputs (&amp;lt;2 GB) are required. Performance can improved by enabling &amp;lt;code&amp;gt;[https://bitcointalk.org/index.php?topic=1377345.0 -blocksonly]&amp;lt;/code&amp;gt; mode and enabling [https://bitcoin.org/en/release/v0.12.0#wallet-pruning pruning].&lt;br /&gt;
&lt;br /&gt;
===Archival Nodes===&lt;br /&gt;
&lt;br /&gt;
A subset of full nodes also accept incoming connections and upload old blocks to other peers on the network. This happens if the software is run with &amp;lt;code&amp;gt;-listen=1&amp;lt;/code&amp;gt; as is default. Contrary to some popular misconceptions, being an archival node is not necessary to being a full node. If a user&#039;s bandwidth is constrained then they can use &amp;lt;code&amp;gt;-listen=0&amp;lt;/code&amp;gt;, if their disk space is constrained they can use pruning, all the while still being a fully-validating node that enforces bitcoin&#039;s consensus rules and contributing to bitcoin&#039;s overall security.&lt;br /&gt;
&lt;br /&gt;
== Why should you use a full node wallet ==&lt;br /&gt;
&lt;br /&gt;
==== Summary ====&lt;br /&gt;
Running a full node is the only way you can use Bitcoin in a trustless way. You will know for sure that all the rules of Bitcoin are being followed, for example that no bitcoins are spent not belonging to the owner, that no coins were spent twice, that no inflation happens outside of the [[Controlled_supply|schedule]] and that all the rules needed to make the system work (e.g. [[difficulty]]) are followed. Full nodes are currently the most [[Privacy|private]] way to use Bitcoin, with nobody else learning which bitcoin [[Address|addresses]] belong to you. Full nodes are the most secure way to use Bitcoin, they do not suffer from many attacks that affect lightweight wallets.&lt;br /&gt;
&lt;br /&gt;
=== Economic strength ===&lt;br /&gt;
&lt;br /&gt;
This is by far the most important reason for running a full node, though it is a little difficult to understand.&lt;br /&gt;
&lt;br /&gt;
As explained previously, full nodes enforce the consensus rules no matter what. However, lightweight nodes do not do this. Lightweight nodes do whatever the majority of mining power says. Therefore, if most of the miners got together to increase their block reward, for example, lightweight nodes would blindly go along with it. If this ever happened, the network would split such that lightweight nodes and full nodes would end up on separate networks, using separate currencies. People using lightweight nodes would be unable to transact with people using full nodes. If all businesses and many users are using full nodes, then this network split is not a &#039;&#039;critical&#039;&#039; problem because users of lightweight clients will quickly notice that they can&#039;t send or receive bitcoins to/from most of the people who they usually do business with, and so they&#039;ll stop using Bitcoin until the evil miners are overcome, which is the appropriate response. &#039;&#039;However&#039;&#039;, if almost everyone on the network is using lightweight nodes in this situation, then everyone would continue being able to transact with each other, and so Bitcoin could very well end up &amp;quot;hijacked&amp;quot; by evil miners.&lt;br /&gt;
&lt;br /&gt;
In practice, miners are unlikely to attempt anything like the above scenario as long as full nodes are prevalent because the miners would lose a lot of money. But the incentives completely change if everyone uses lightweight nodes. In that case, miners definitely &#039;&#039;do&#039;&#039; have an incentive to change Bitcoin&#039;s rules in their favor. It is only reasonably secure to use a lightweight node &#039;&#039;because&#039;&#039; most of the Bitcoin economy uses full nodes.&lt;br /&gt;
&lt;br /&gt;
Therefore, it is critical for Bitcoin&#039;s survival that the great majority of the Bitcoin economy be backed by full nodes, not lightweight nodes. This is especially important for Bitcoin businesses, which have more economic weight. To contribute to Bitcoin&#039;s economic strength, you must actually use a full node for your real transactions (or use a lightweight node connected to a full node that you personally control). Just running a full node on a server somewhere does not contribute to Bitcoin&#039;s economic strength.&lt;br /&gt;
&lt;br /&gt;
More details https://www.reddit.com/r/BitcoinBeginners/comments/3eq3y7/full_node_question/ctk4lnd&lt;br /&gt;
&lt;br /&gt;
=== Privacy ===&lt;br /&gt;
&lt;br /&gt;
Downloading the entire blockchain is the most private way to operate a wallet. All other lightweight solutions leak information about which addresses are yours because they must query third-party servers. The Electrum servers will know which addresses belong to you and can link them together. Despite bloom filtering, SPV nodes based on BitcoinJ [[BIP37 privacy problems|do not provide much privacy]] against nodes who connected directly to the wallet.&amp;lt;ref&amp;gt;[https://jonasnick.github.io/blog/2015/02/12/privacy-in-bitcoinj/ Privacy in BitcoinJ ]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
For some use cases, such privacy may not be required. But an important reason to run a full node and use it as a wallet is to get the full privacy benefits.&lt;br /&gt;
&lt;br /&gt;
=== Security ===&lt;br /&gt;
&lt;br /&gt;
Lightweight nodes are sometimes able to be temporarily tricked into accepting transactions or blocks that are not actually valid. This could cause serious financial damage, especially for websites that automatically process Bitcoin transactions. Full nodes provide the maximum security possible, and so they should be used by all businesses, and also by regular users whenever doing so is convenient.&lt;br /&gt;
&lt;br /&gt;
=== Network services ===&lt;br /&gt;
&lt;br /&gt;
Full nodes may provide various services to other network participants (if the software is run with &amp;lt;code&amp;gt;-listen=1&amp;lt;/code&amp;gt; as is default). This is especially important for lightweight nodes.&lt;br /&gt;
&lt;br /&gt;
These services include:&lt;br /&gt;
* Filtering transactions and blocks on behalf of lightweight nodes so that lightweight nodes do not need to download every transaction ever made on the network in order to find their own transactions.&lt;br /&gt;
* Serving historical full blocks to nodes that have been offline for a while.&lt;br /&gt;
* Transmitting new transactions from users to miners.&lt;br /&gt;
* Broadcasting new blocks from miners to other nodes.&lt;br /&gt;
&lt;br /&gt;
For the most part, these services are only usefully performed by full nodes that are listening on port 8333. The more full nodes that accept incoming connections there are, the more users the Bitcoin network can support. Although if there is ever a shortage, lots of archival nodes can be easily created by cheaply renting VPS or AWS space.&lt;br /&gt;
&lt;br /&gt;
=== Some are incentivizing it ===&lt;br /&gt;
Bitnodes ran a program to incentivize full node operators until the end of 2015.&amp;lt;ref&amp;gt;[https://bitcoinmagazine.com/19620/bitnodes-project-issues-first-incentives-node-operators/ Bitnodes Project Issues First Incentives For Node Operators by Joel Dalas] of [http://bitcoinmagazine.com/ &amp;lt;i&amp;gt;Bitcoin Magazine&amp;lt;/i&amp;gt;]; cf. https://blog.bitcoinfoundation.org/bitnodes-project-2015-q1-report-peer-index-and-incentivized-full-nodes/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== How to run a full node ==&lt;br /&gt;
&lt;br /&gt;
If you run the [[Bitcoin Core]]/[[bitcoind]] wallet, you are running a full node. If you open port 8333, you will contribute to the network&#039;s capacity. If you actually use the wallet feature, or if you use a lightweight client like [[MultiBit]] but configure it to connect exclusively to your full node, then you will contribute to the network&#039;s economic strength and receive protection from some possible attacks against lightweight nodes.&lt;br /&gt;
&lt;br /&gt;
There are a few alternate full node implementations, but they are not recommended for serious use because it is currently difficult to determine whether they implement the consensus rules with 100% accuracy. Even very slight inaccuracies could cause serious problems for the users of these alternate clients. Example of implementations [https://bitcore.io/guides/full-node/ Bitcore], [[libbitcoin]], [[btcd]].&lt;br /&gt;
&lt;br /&gt;
=== Tips and tricks for running a node ===&lt;br /&gt;
&lt;br /&gt;
For [[Bitcoin Core]]:&lt;br /&gt;
&lt;br /&gt;
* Bandwidth consumption can be reduced using this guide: https://btcinformation.org/en/full-node#reduce-traffic&lt;br /&gt;
&lt;br /&gt;
* Requirement for disk space can be reduced using this guide: https://btcinformation.org/en/full-node#reduce-storage See also the [https://github.com/bitcoin/bitcoin/blob/v0.11.0/doc/release-notes.md#block-file-pruning release notes which explain pruning].&lt;br /&gt;
&lt;br /&gt;
* This site has a nice predefined template for generating bitcoin config files https://jlopp.github.io/bitcoin-core-config-generator/&lt;br /&gt;
&lt;br /&gt;
* Improve sync speed by increasing the dbcache value in configuration. This value controls how many megabytes of RAM to use for the database cache, increase it to as much as your hardware allows to reduce the disk operations and increase speed.&lt;br /&gt;
&lt;br /&gt;
* To store the blockchain files on an external hard drive use &amp;lt;tt&amp;gt;-datadir&amp;lt;/tt&amp;gt;. e.g. &amp;lt;tt&amp;gt;-datadir=/path/to/your/bitcoin/directory&amp;lt;/tt&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
* Store the chainstate directory on an SSD drive to improve the speed.&amp;lt;ref&amp;gt;[https://www.reddit.com/r/Bitcoin/comments/7iaa3t/if_you_run_a_full_node_on_a_hdd_put_your/ If you run a full node on a hdd put your chainstate directory on an external ssd].&amp;lt;/ref&amp;gt;&lt;br /&gt;
** See [[Splitting the data directory]]&lt;br /&gt;
&lt;br /&gt;
See Also: [[Running Bitcoin]]&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [[Clearing Up Misconceptions About Full Nodes]]&lt;br /&gt;
&lt;br /&gt;
* [[Why Your Business Should Use a Full Node to Accept Bitcoin]]&lt;br /&gt;
&lt;br /&gt;
* [[Bitcoin is not ruled by miners]]&lt;br /&gt;
&lt;br /&gt;
==References==&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Technical]]&lt;br /&gt;
[[Category:Privacy]]&lt;br /&gt;
&lt;br /&gt;
{{Bitcoin Core documentation}}&lt;/div&gt;</summary>
		<author><name>V</name></author>
	</entry>
</feed>