<?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=Polve</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=Polve"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/wiki/Special:Contributions/Polve"/>
	<updated>2026-04-04T01:11:44Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.43.6</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Transaction_replacement&amp;diff=61194</id>
		<title>Transaction replacement</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Transaction_replacement&amp;diff=61194"/>
		<updated>2016-06-17T08:19:25Z</updated>

		<summary type="html">&lt;p&gt;Polve: /* Bitcoin Core 0.12.0 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Transaction replaceability&#039;&#039;&#039; occurs when a full node allows one or&lt;br /&gt;
more of the transactions in its memory pool (mempool) to be replaced&lt;br /&gt;
with a different transaction that spends some or all of the same inputs.&lt;br /&gt;
Transaction replaceability was enabled in the first version of&lt;br /&gt;
Bitcoin&amp;lt;ref&amp;gt;[https://github.com/trottier/original-bitcoin/blob/master/src/main.cpp#L434 Replacement in original Bitcoin source code], Satoshi Nakamoto, GitHub, &#039;&#039;Retrieved 2015-12-08&#039;&#039;&amp;lt;/ref&amp;gt; but was disabled in the 0.3.12 release with the comment,&lt;br /&gt;
&amp;quot;Disable replacement feature for now&amp;quot;.&amp;lt;ref&amp;gt;[https://github.com/bitcoin/bitcoin/commit/05454818dc7ed92f577a1a1ef6798049f17a52e7#diff-118fcbaaba162ba17933c7893247df3aR522 Commit disabling replacement &amp;quot;for now&amp;quot;], Satoshi Nakamoto, GitHub, &#039;&#039;Retrieved 2015-12-08&#039;&#039;&amp;lt;/ref&amp;gt;  Since then, there have been various attempts to make&lt;br /&gt;
transaction replaceability widely available again.&amp;lt;ref&amp;gt;[https://bitcointalk.org/index.php?topic=199947.0 Initial replace-by-fee implementation available for testnet], BitcoinTalk forum, posted 2013-05-09, &#039;&#039;retrieved 2015-12-09&#039;&#039;&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Beginning with Bitcoin Core 0.12.0 (eta Feb 1 2016), it is expected&lt;br /&gt;
that transaction replaceability will become widely available. This page&lt;br /&gt;
attempts to document the current state of transaction replaceability for&lt;br /&gt;
wallet authors who want to use that feature.&lt;br /&gt;
&lt;br /&gt;
== Node policies ==&lt;br /&gt;
&lt;br /&gt;
Transaction replacement is optional (it is not, and cannot be,&lt;br /&gt;
a consensus rule), but widespread adherence to the same basic policy&lt;br /&gt;
among nodes will help maintain a consistent network-wide mempool policy&lt;br /&gt;
with the following expected benefits:&lt;br /&gt;
&lt;br /&gt;
* Consistent policy makes it easy for wallet authors to write code that uses transaction replacement to provide usability-enhancing features.&lt;br /&gt;
&lt;br /&gt;
* Consistent policy helps ensure long-running mempools contain mostly the same transactions (mempool consistency), which makes it easier for wallets and nodes to make guesses about how long it will take a transaction to confirm.&lt;br /&gt;
&lt;br /&gt;
* Consistent mempools may help nodes more quickly validate newly-received blocks as well as reduce the bandwidth used to announce new blocks in the future.&lt;br /&gt;
&lt;br /&gt;
=== Bitcoin Core 0.3.12 to 0.11.x ===&lt;br /&gt;
&lt;br /&gt;
Transaction replaceability is disallowed in a running node.&lt;br /&gt;
&lt;br /&gt;
=== Bitcoin Core 0.12.0 ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Bitcoin Core 0.12.0 has been released in Feb 2016.&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
Bitcoin Core 0.12.0 uses the initial implementation of opt-in full-RBF&lt;br /&gt;
described in [https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki BIP 125].&lt;br /&gt;
&lt;br /&gt;
The initial implementation of opt-in full-RBF may be seen in &lt;br /&gt;
[https://github.com/bitcoin/bitcoin/pull/6871 Bitcoin Core PR#6871]&lt;br /&gt;
and specifically the master branch commits from&lt;br /&gt;
5891f870d68d90408aa5ce5b597fb574f2d2cbca to&lt;br /&gt;
16a2f93629f75d182871f288f0396afe6cdc8504 (inclusive).&lt;br /&gt;
&lt;br /&gt;
=== Peter Todd&#039;s full-RBF patchset ===&lt;br /&gt;
&lt;br /&gt;
Peter Todd has historically maintained patchsets against Bitcoin Core&lt;br /&gt;
0.8.x and later that implement full-RBF for all transactions in the&lt;br /&gt;
mempool. (Later versions also provide an option to enable RBF First-Seen-Safe (RBF-FSS) only.)&lt;br /&gt;
A rebased version of the most recent patch is also available for&lt;br /&gt;
contemporary [http://luke.dashjr.org/programs/bitcoin-ljr/ Bitcoin LJR] releases.&lt;br /&gt;
&lt;br /&gt;
Notably, the patchset also implements preferential peering that allows&lt;br /&gt;
nodes implementing full-RBF to connect to each other so that replacements &lt;br /&gt;
can circulate even if full-RBF nodes represent a small minority of the&lt;br /&gt;
network.&lt;br /&gt;
&lt;br /&gt;
As of 2015-12-08, there are no known large miners or mining pools that&lt;br /&gt;
implement full-RBF.&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/petertodd/bitcoin/branches/all?utf8=%E2%9C%93&amp;amp;query=replace-by-fee-v0.10 Replace by fee patches for Bitcoin Core 0.10.x]&lt;br /&gt;
* [https://github.com/petertodd/bitcoin/branches/all?utf8=%E2%9C%93&amp;amp;query=replace-by-fee-v0.11 Replace by fee patches for Bitcoin Core 0.11.x]&lt;br /&gt;
&lt;br /&gt;
Policy&amp;lt;ref&amp;gt;[https://github.com/bitcoin/bitcoin/compare/0.11...petertodd:replace-by-fee-v0.11.0 RBF patchset for 0.11.2], Peter Todd, GitHub, &#039;&#039;Retrieved 2015-12-08&#039;&#039;&amp;lt;/ref&amp;gt;: one or more transactions currently in the mempool (original&lt;br /&gt;
transactions) will be replaced by a new transaction (replacement&lt;br /&gt;
transaction) that spends one or more of the same inputs if,&lt;br /&gt;
&lt;br /&gt;
# The replacement transaction pays an absolute higher fee than the original transactions.&lt;br /&gt;
# The replacement transaction must pay for its own bandwidth in addition to the amount paid by the original transactions at least by the rate set by the node&#039;s minimum relay fee setting.  For example, if the minimum relay fee is 1 satoshi/byte and the replacement transaction is 500 bytes total, then the replacement must pay a fee at least 500 satoshis higher than the originals.&lt;br /&gt;
# No more than 100 original transactions are replaced by the replacement transaction&lt;br /&gt;
&lt;br /&gt;
== See Also ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/bitcoin/bips/blob/master/bip-0125.mediawiki BIP 125]&lt;br /&gt;
* [https://www.reddit.com/r/Bitcoin/comments/3urm8o/optin_rbf_is_misunderstood_ask_questions_about_it/ Reddit: Questions about opt-in RBF]&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Polve</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=API_reference_(JSON-RPC)&amp;diff=52972</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=52972"/>
		<updated>2014-11-09T18:15:18Z</updated>

		<summary type="html">&lt;p&gt;Polve: /* Java */ Added link to existing page with ready-to-use implementation&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Controlling Bitcoin ==&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;
To access the server you should find a [http://json-rpc.org/wiki/implementations suitable library] for your language.&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;
== 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.getinfo()&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.getinfo&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;
== 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;getinfo()); 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 to write your wrapper you can use an [[Bitcoin-JSON-RPC-Client|existing implementation]].&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;getinfo&#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/conformal/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/conformal/btcnet&amp;quot;&lt;br /&gt;
	&amp;quot;github.com/conformal/btcrpcclient&amp;quot;&lt;br /&gt;
	&amp;quot;github.com/conformal/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;btcnet.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;btcnet.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 rpc service can be achieved using the standard http request/response objects.&lt;br /&gt;
A library for serialising 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.GetInfo();&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;
== Node.js ==&lt;br /&gt;
&lt;br /&gt;
* [https://github.com/freewil/node-bitcoin node-bitcoin] (npm: bitcoin) &lt;br /&gt;
&lt;br /&gt;
Example using node-bitcoin:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;javascript&amp;quot;&amp;gt;&lt;br /&gt;
var bitcoin = require(&#039;bitcoin&#039;);&lt;br /&gt;
var client = new bitcoin.Client({&lt;br /&gt;
  host: &#039;localhost&#039;,&lt;br /&gt;
  port: 8332,&lt;br /&gt;
  user: &#039;user&#039;,&lt;br /&gt;
  pass: &#039;pass&#039;&lt;br /&gt;
});&lt;br /&gt;
&lt;br /&gt;
client.getDifficulty(function(err, difficulty) {&lt;br /&gt;
  if (err) {&lt;br /&gt;
    return console.error(err);&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
  console.log(&#039;Difficulty: &#039; + difficulty);&lt;br /&gt;
});&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example using Kapitalize:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&#039;javascript&#039;&amp;gt;&lt;br /&gt;
var client = require(&#039;kapitalize&#039;)()&lt;br /&gt;
&lt;br /&gt;
client.auth(&#039;user&#039;, &#039;password&#039;)&lt;br /&gt;
&lt;br /&gt;
client&lt;br /&gt;
.getInfo()&lt;br /&gt;
.getDifficulty(function(err, difficulty) {&lt;br /&gt;
  console.log(&#039;Dificulty: &#039;, difficulty)&lt;br /&gt;
})&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;getinfo&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;
== 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/getinfo)&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;
== See Also==&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;/div&gt;</summary>
		<author><name>Polve</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=Bitcoin-JSON-RPC-Client&amp;diff=52970</id>
		<title>Bitcoin-JSON-RPC-Client</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=Bitcoin-JSON-RPC-Client&amp;diff=52970"/>
		<updated>2014-11-09T18:10:40Z</updated>

		<summary type="html">&lt;p&gt;Polve: Link to an updated fork with maven artifacts&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&#039;&#039;&#039;Bitcoin-JSON-RPC-Client&#039;&#039;&#039; is a lightweight Java bitcoin JSON-RPC client binding. It does not require any external dependencies.&lt;br /&gt;
&lt;br /&gt;
==Code Example==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
    private static final Bitcoin bitcoin = new BitcoinJSONRPCClient();&lt;br /&gt;
&lt;br /&gt;
    public static void sendCoins() throws BitcoinException {&lt;br /&gt;
        bitcoin.sendToAddress(&amp;quot;1EzGDMdqKW5ubTDNHSqCKciPkybGSvWgrj&amp;quot;, 10);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    public static void receiveCoins() throws BitcoinException {&lt;br /&gt;
        final BitcoinAcceptor acceptor = new BitcoinAcceptor(bitcoin);&lt;br /&gt;
&lt;br /&gt;
        System.out.println(&amp;quot;Send bitcoins to &amp;quot; + bitcoin.getNewAddress(&amp;quot;NewAccount&amp;quot;));&lt;br /&gt;
&lt;br /&gt;
        acceptor.addListener(new ConfirmedPaymentListener() {&lt;br /&gt;
            HashSet processed = new HashSet();&lt;br /&gt;
&lt;br /&gt;
            @Override&lt;br /&gt;
            public void confirmed(Transaction transaction) {&lt;br /&gt;
                if (!processed.add(transaction.txId()))&lt;br /&gt;
                    return; // already processed&lt;br /&gt;
&lt;br /&gt;
                System.out.println(&amp;quot;Payment received, amount: &amp;quot; + transaction.amount() + &amp;quot;; account: &amp;quot; + transaction.account());&lt;br /&gt;
                try {&lt;br /&gt;
                    if (bitcoin.getBalance(&amp;quot;NewAccount&amp;quot;) &amp;gt;= 10)&lt;br /&gt;
                        acceptor.stopAccepting();&lt;br /&gt;
                } catch (BitcoinException ex) {&lt;br /&gt;
                    ex.printStackTrace();&lt;br /&gt;
                }&lt;br /&gt;
            }&lt;br /&gt;
&lt;br /&gt;
        });&lt;br /&gt;
        acceptor.run();&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==See Also==&lt;br /&gt;
&lt;br /&gt;
* [[Java Bitcoin Client]]&lt;br /&gt;
* [[BitCoinJ]]&lt;br /&gt;
* [[API reference (JSON-RPC)]]&lt;br /&gt;
&lt;br /&gt;
==External links==&lt;br /&gt;
*[http://search.maven.org/#search|ga|1|a%3A%22JavaBitcoindRpcClient%22 Maven artifact]&lt;br /&gt;
*[https://github.com/Polve/JavaBitcoindRpcClient Source] (Updated release)&lt;br /&gt;
*[https://bitbucket.org/azazar/bitcoin-json-rpc-client Bitcoin-JSON-RPC-Client project page] and [https://bitbucket.org/azazar/bitcoin-json-rpc-client/downloads downloads] (original release)&lt;br /&gt;
&lt;br /&gt;
[[Category:API Bindings]]&lt;br /&gt;
[[Category:Frontends]]&lt;br /&gt;
[[Category:Free Software]]&lt;br /&gt;
[[Category:License/MIT]]&lt;br /&gt;
[[Category:Open Source]]&lt;/div&gt;</summary>
		<author><name>Polve</name></author>
	</entry>
</feed>