Questions tagged [json-rpc]

A remote-procedure-call (RPC) interface provided by the Bitcoin Core wallet and it's companion software bitcoind. This RPC interface uses the Javascript Object Notation (JSON) serialization format for data and allows other software programs to interact with Bitcoin-Core.

Filter by
Sorted by
Tagged with
22 votes
2 answers
18k views

How do I use walletnotify?

I have bitcoin daemon and I want to use the walletnotify option with a json-rpc call. Some of the examples use a "transaction.sh" file for walletnotify. What is it for? What do I have to write in ...
M.R's user avatar
  • 501
39 votes
11 answers
38k views

How to check if the block chain is up to date using bitcoind or json-rpc?

I read the full api method list and did not seem to find one. I suppose there is no command specifically for that purpose, so what is the general way of doing this? I would consider checking the ...
Steven Roose's user avatar
  • 11.8k
12 votes
2 answers
8k views

What is chainwork?

If I run the RPC call getBlock on the bitcoin-qt client it gives me field called chainwork containing a hash. I can't find any information what this value is about. Request: getblock ...
Dennis Kriechel's user avatar
23 votes
1 answer
18k views

Get non-wallet transactions using bitcoin rpc (gettransaction)

I am playing around with Bitcoin-qt. I want to iterate all blocks and all their transactions. So far I've been able to get a list of all tx's in the blocks I want to. Now I want to get information ...
Lars Holdgaard's user avatar
8 votes
3 answers
6k views

Checking/polling a balance of an address in Electrum via the command line/RPC

Suppose, I've dynamically -- via the command line/RPC -- created an address or payment_query in Electrum. And saved its details in a database along with the amount of bitcoins I expect to receive. ...
Kolayn's user avatar
  • 81
0 votes
1 answer
328 views

How to differentiate between BTC transactions and BRC20 transactions on a blockchain?

How to differentiate between BTC transactions and BRC20 transactions on a blockchain using the RCP interface? This is a transaction record that contains BRC20 tokens which I found on a blockchain ...
Mashaji's user avatar
10 votes
2 answers
8k views

Is there a light (SPV) version of bitcoin core (bitcoind)?

I'm trying to develop an SPV Bitcoin client which makes use of a library requiring bitcoin core (a running bitcoind service). However, from what I understand, Bitcoin Core is full node, meaning that ...
FedFranz's user avatar
  • 652
8 votes
3 answers
2k views

What's the best way for a website to detect payments from green addresses?

Does any proven third party code exist for this? Edit* To be more specific, what I haven't been able to find out is how to get the sender's bitcoin address when receiving a transaction. As far as ...
Amin's user avatar
  • 1,482
3 votes
1 answer
348 views

JSON-RPC to detect double-spent TXs

How can I be positive that one of the incoming payments to my bitcoin-core was double-spent after it was confirmed once by the network, through the JSON-RPC interface? Related questions: How do I ...
Doug Peters's user avatar
  • 1,366
0 votes
1 answer
243 views

Using importmulti with internal set to true does not add any change keys. What am I doing wrong?

First I call: curl --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "createwallet", "params":["ColdWallet", true] }' -H 'content-type: text/plain;' http://user:[email protected]:18332/ ...
Fontaine's user avatar
  • 466
40 votes
1 answer
40k views

What is the difference between the rpc port 8332 and port 8333?

What is the difference between the protocol and commands used on default ports 8332 and port 8333? From what I gather, port 8332 is the RPC port, it's "sensitive", only allowed by local host by ...
makerofthings7's user avatar
27 votes
5 answers
10k views

how to monitor +20,000 addresses for new received transactions?

I have around 20000 generated addresses which I want to monitor for new transactions. More addresses should probably come. Customers should use every address only once but I would like to monitor ...
curiosity's user avatar
  • 365
24 votes
3 answers
14k views

Bitcoin-Qt command line control on Mac

I'm trying to communicate with the new Bitcoin-Qt -server via a command line on Mac. I run ./Bitcoin-Qt -server, the application starts, but my terminal window is stuck on an empty line (no matter ...
ThePiachu's user avatar
  • 43k
15 votes
1 answer
12k views

How to generate SegWit address

How do I generate a SegWit address using Bitcoin Core CLI? Also will I be able to redeem those outputs and send them to a "legacy" address? If so, will this second transaction be accepted by older, ...
Paul's user avatar
  • 361
12 votes
2 answers
5k views

How to setup a LAN network with only one bitcoind client downloading the blockchain?

I want to do the following: I have one small server PC at home. I want to install bitcoind on that machine to download the blockchain information. Then I want this machine to accept RPC calls from my ...
Steven Roose's user avatar
  • 11.8k
12 votes
1 answer
2k views

What is the difference between time, blocktime and timereceived?

What is exactly the difference between time, blocktime and timereceived in transaction information returned by Bitcoind JSON RPC API? For example: { "amount": 0.02, "blockindex": 45, "...
Alexey Kalmykov's user avatar
10 votes
3 answers
2k views

What's the best practice for creating and maintaining an address index?

I am working on a Blockchain.info-like block explorer, and I have some questions regarding best practice for data retrieval. Bitcoin Core stores and serves all blocks and, if txindex is set to 1, all ...
user avatar
8 votes
2 answers
2k views

Import multiple watch-only addresses using importaddress?

With the importaddress RPC command it is possible to import one watch-only address. But how can I do that with, let's say, 100?
RoqueNE's user avatar
  • 81
7 votes
2 answers
3k views

Add a Watch-only Wallet in Bitcoind

When running bitcoind under OSX/Linux, how can we add a watch-only wallet using the JSON RPC? Do we need the public key or is the bitcoin address sufficient?
Nyxynyx's user avatar
  • 271
7 votes
2 answers
3k views

Calculating address balance

Is there some method how you can calculate the balance of an address without resorting to web-based API's? When I import a private key the rescanning of bitcoind takes hours. I know to get a balance ...
Maestro's user avatar
  • 1,967
7 votes
2 answers
4k views

How to check if an output has been spent?

Using an rpc client (e.g. bitcoin-cli), for a given transaction and index of an output of it, how can I tell if the output is currently an utxo, or if it has already been spent? In the latter case, I'...
shx2's user avatar
  • 803
7 votes
3 answers
2k views

How to know when a payment has been received by bitcoind?

I want to create a website which involves the creation of a new single-use address that a user would send bitcoins to. I'd like to know programmatically when the user has sent bitcoins to the address ...
Sanjay's user avatar
  • 205
5 votes
1 answer
6k views

rpcallowip=192.168.0.* ?? invalid configuration

I recently downloaded bitcoin from github and changed the settings to allow for rpc. This is how I have it: rpcallowip=192.168.0.* This does not work anymore. However when running bitcoind, it ...
Prem Govind's user avatar
5 votes
2 answers
1k views

Why does importmulti not support zpub and ypub?

As far as I can tell importmulti does not work with zpub/ypub. Why not? FWIW I prefer only to deal with xpubs, but I am curious.
Fontaine's user avatar
  • 466
4 votes
2 answers
4k views

-fallbackfee option in sendtoaddress

I'm trying to send some bitcoins using bitcoin-cli API, but bitcoin core tells me that Fallbackfee is disabled. How can I set a value for fallbackfee? I've tried to specify it like bitcoin-cli ...
dcfg's user avatar
  • 394
4 votes
2 answers
19k views

How do I call JSON RPC API using C#?

How do I access the JSON RPC API in C# in such a way that I can also read the errors that the interface provides?
makerofthings7's user avatar
3 votes
1 answer
1k views

Why is a transaction with outputs of less than ฿0.00005460 rejected?

I'm trying to create a transaction via JSON-RPC API. It has low outputs, but not below "dust" threshold, yet it's still getting rejected by bitcoind with error code "-22". Transaction includes fee of ฿...
user1450663's user avatar
3 votes
3 answers
4k views

Bitcoin.conf & JSON-RPC options

What does it mean in the bitcoin.conf file when it states: server=1 tells Bitcoin-Qt to accept JSON-RPC commands? If all one needs to do to solo mine is type setgenerate true in the console, ...
oemb1905's user avatar
  • 203
2 votes
3 answers
3k views

Bitcoin RPC works in bitcoin-cli but not in python-bitcoinrpc: No JSON object

I'm running a testnet node. I can use bitcoin-cli just fine: >bitcoin-cli.exe getinfo { "version" : 100000, "protocolversion" : 70002, "walletversion" : 60000, [... snipped] But when ...
Nick ODell's user avatar
  • 29.3k
2 votes
2 answers
259 views

How confirm my own doublespend transaction got confirmed

Transactions in the testnet are right now almost always double spent with a new txid (possible due to tx malleability). This is actually quite nice for testing purposes. So I'm wondering - when I ...
tobi's user avatar
  • 135
1 vote
4 answers
2k views

How to use JSON-RPC in C++ in Linux?

Which library I must use for JSON? Where is RPC call example ? How to use RPC of bitcoind or bitcoin-cli? or better Electrum API to get all new (maybe pending) transactions which appears in Bitcoin ...
Saku's user avatar
  • 151
1 vote
2 answers
361 views

Bitcoind confirmations during fork

I'm using bitcoind's JSONRPC interface to get transaction information for my wallet, specifically, I'm running a little script every time a block gets broadcast (using -blocknotify) which calls the ...
mpr's user avatar
  • 153
0 votes
2 answers
234 views

What does this output item in the result of the call with blocktrail api mean?

This is the result of a call with blocktrail api. It is about a transaction with the hash 6b1c57d98a557b5f578c02f6c386ef049df5890ebddd01d286bf345f47c5cecc {"raw":"...
Aqqqq's user avatar
  • 305
13 votes
1 answer
5k views

Why is JSON-RPC over SSL "strongly discouraged"?

The Wiki contains a page that simply states: JSON-RPC over SSL is strongly discouraged Why? I found a method for enabling JSON_RPC over SSL here. The post mentions nothing about JSON-RPC over SSL ...
Rich Apodaca's user avatar
  • 2,321
10 votes
1 answer
453 views

Obtaining historical stale blocks (chaintips) without old node

I'm attempting to do some research surrounding stale blocks within the Bitcoin network. From my understanding the best and really only way to obtain data for blocks that no longer exist in the main ...
Mason Ticehurst's user avatar
9 votes
1 answer
625 views

Importprivkey's "label" - is it the same as an account?

The "importprivkey" API call allows one to import a private key and save it with a label. Is the "label" in the API call synonymous with an account used in the wallet?
ThePiachu's user avatar
  • 43k
9 votes
1 answer
2k views

Passing a JSON argument to bitcoind in Windows command prompt

I've been trying to use sendmany on my local installation of Bitcoin-qt (version 0.7.0) from the Windows command prompt. I've seen examples but when I try them all I get is a JSON parsing error. I ...
Meni Rosenfeld's user avatar
7 votes
9 answers
8k views

How to communicate between Java and bitcoind?

I am having problems communicating between Java and bitcoind - every JSON RPC library I try has some issues. Can anyone provide a working implementation of even the most basic JSON RPC communication ...
ThePiachu's user avatar
  • 43k
7 votes
3 answers
2k views

Is it safe to run bitcoind on another server

I'm making first, rough concepts of some ideas for bitcoin-enabled services I have in mind. One thing that I wonder is, is there a best-practise approach on running bitcoind on another server that ...
Gundon's user avatar
  • 271
6 votes
2 answers
2k views

Manually creating transactions

Due to complete lack of documentation on the subject, how would the pseucode for creating a transaction look using the following functions: createrawtransaction signrawtransaction and ...
user1841964's user avatar
6 votes
1 answer
4k views

How to call JSON RPC API from C?

How do I make RPC calls from C? My question is related to the question: "How do I call JSON RPC API using C#?"
Geremia's user avatar
  • 4,556
6 votes
1 answer
3k views

What is the standard protocol for pools/miners?

The Bitcoin client protocol is well documented in the Bitcoin Wiki, but I can't find much on the protocol used by pools and miners. Is it described anywhere?
ThePiachu's user avatar
  • 43k
6 votes
1 answer
2k views

listsinceblock parameter: target-confirmations

listsinceblock help returns: listsinceblock ( "blockhash" target-confirmations ) Get all transactions in blocks since block [blockhash], or all transactions if omitted Arguments: 1. "blockhash" (...
Doug Peters's user avatar
  • 1,366
6 votes
3 answers
17k views

Historical BTC data in JSON

As of now, the only API I can find that serves historical data is https://blockchain.info/charts/market-price?timespan=60days&format=json. It only uses USD, and I need to serve non-USD data. My ...
Christopher Sardegna's user avatar
6 votes
3 answers
1k views

How to receive payments online to single address per user in scalable way?

Suppose we are building online casino/market and want to receive payments. To be scalable, safe and have good user experience, we: cannot generate new address for every single payment. Having single ...
Piotr Müller's user avatar
6 votes
2 answers
6k views

64: too-long-mempool-chain

I am using bitcoind json rpc api to send bitcoin to multiple bitcoin addresses. I am using sendrawtransaction. When i have 24 unconfirmed payments sent from my account, i can't send anymore because i ...
Adrian's user avatar
  • 59
5 votes
1 answer
2k views

JSON-RPC getwork data field

I recently tried playing around with the getwork command for JSON-RPC and I'm trying to understand what I got out of it. According to the API Call List wiki entry, the "data" field should contain the ...
ThePiachu's user avatar
  • 43k
5 votes
3 answers
5k views

How can I code a Bitcoin JSON-RPC "getwork" request in Java?

I'm not entirely sure whether to ask this question on Bitcoin-SE or Stack Overflow, but I decided to post it here due to the direct relevancy of the question to Bitcoin and the general prominence of ...
BinaryMage's user avatar
  • 1,346
5 votes
2 answers
5k views

How to get the immature balance of an account?

I have run bitcoind and have several accounts. How do I get the immature balance of one account using RPC calls (if possible) ?
drcelus's user avatar
  • 225
5 votes
3 answers
12k views

bitcoin-cli could not locate RPC credentials

I'm running a bitcoind 0.16 and it seem working, blockchain in sync etc.. I've used the "new" rpcauth, which is non deprecated so kind of referennce as explained here: https://github.com/bitcoin/...
Daniele Dellafiore's user avatar