Skip to main content
6 votes
Accepted

How do I get the scriptPubKey type from the raw output script?

Internally, Bitcoin does not have the concept of scriptPubKey type. To the system, scriptPubKey is simply a mathematical equation into which some bitcoins have been locked (UTXO) and the spender must ...
Ugam Kamat's user avatar
  • 7,427
6 votes

How can I tell if bitcoind was compiled with ZeroMQ support?

Since this question still comes up in search results, it's worth noting that bitcoin-cli now has a getzmqnotifications method. If you get something like this, you've successfully built with ZMQ: $ ...
davidfloyd91's user avatar
6 votes

How can I tell if bitcoind was compiled with ZeroMQ support?

As this question is related to executable compilation which has to do with linking (static or dynamic), therefore the ultimate way to know if your compiled bitcoind executable has been compiled with ...
daparic's user avatar
  • 181
6 votes
Accepted

How can I tell if bitcoind was compiled with ZeroMQ support?

You should have a file named config.log in your Bitcoin Core working directory. Look in the file for ZMQ related lines. If ZMQ is enabled, you should see things like #define ENABLE_ZMQ 1. If it is not ...
Ava Chow's user avatar
  • 71k
6 votes

Cannot compile bitcoind with zmq enabled

This will happen when you try to build with ZMQ support even though the required libraries are not on your system. In this case, configure will silently turn off ZMQ support, and you should see a line ...
christianb93's user avatar
5 votes

Using ZeroMQ of bitcoind to monitor addresses?

Actually, it's pretty much possible! You will have to listen for rawtx topic of ZeroMQ in order to retrieve binary representation of the transaction descriptor. Then you should parse the transaction ...
Robert Wood's user avatar
4 votes

How can we receive hashtx and hashblock from bitcoind by zmq subscribe?

The PPA you have installed (https://launchpad.net/~bitcoin/+archive/ubuntu/bitcoin/+packages) is not compiled with ZMQ support (It should in future). You need to self-compile bitcoin v0.13.0 or use ...
Jonas Schnelli's user avatar
4 votes

are official bitcoin core released compiled with zmq in general?

@PieterWuille is right, it is really not related to bitcoin but to ZeroMQ and docker. I look into the source code and bitcoin core uses zmq_bind( socket, bindingAddress ). For BindingAddress, I can ...
Hami's user avatar
  • 161
3 votes

How do I get the scriptPubKey type from the raw output script?

You need to parse the script and get to the script type by examining the opcodes. If you examine the rpc/rawtransaction.cpp source file on Bitcoin Core you'll see the RPC call that outputs this is ...
Jose Fonseca's user avatar
3 votes
Accepted

Deposit flow, user balances

These are indeed hard problems, but luckily already served by BTCPay Server, with extra features like lightning payments: https://github.com/btcpayserver/btcpayserver. You can just run it via the ...
Jürgen Strobel's user avatar
3 votes

How to increment the number of confirmation of a transaction?

A tx will only be included in a single block in any given blockchain. Confirmations is simply a count of how many new blocks extend the chain. If your tx is in block n, it has 1 confirmation. When ...
Raghav Sood's user avatar
  • 17.1k
3 votes

How to decode the block hash?

I believe what merklexy wanted to know is how to get information about the block. And the answer is, you cannot get details about the block from its hash. If you have access to the bitcoin command ...
Tobias Koller's user avatar
3 votes
Accepted

How to decode the block hash?

What do you mean by "decode"? A hash algorithm is a one-way function. The hash-function takes some block header information (timestamp, nonce, a hash of all transactions) and returns such a ...
hardfork's user avatar
  • 2,117
3 votes
Accepted

Where to connect to get streaming blockchain data?

Your best bet is to run a bitcoind node locally and then connect to it using zmq (ZeroMQ). Pulling it from anywhere else means you're trusting someone else and the data can easily be corrupted. Also ...
Jannes's user avatar
  • 6,344
3 votes
Accepted

How do I maintain a continuously updated copy of a local mempool?

There are two methods to do this: ZMQ and Tracepoints. The zmqpubsequence can be used to notifications for all mempool events. See the PR and test for more information. It was designed specifically ...
Ava Chow's user avatar
  • 71k
3 votes

Can I run LND without ZMQ?

According to LND install guide, ZMQ is a requirement to run the daemon as long as bitcoind is being used as the backend: Since lnd uses ZeroMQ to interface with bitcoind, your bitcoind installation ...
sr_gi's user avatar
  • 3,220
2 votes

What's the difference between hashtx and rawtx in ZeroMQ of bitcoind?

After some investigation, I found out that RAW topics actually include entire body of transaction/block descriptor. See, Raw Transactions. Actually, you could explore the transaction descriptor ...
Robert Wood's user avatar
2 votes

Bitcoin ZeroMQ and Scala application

It is not specified what to subscribe. socket.connect("tcp://127.0.0.1:28332") socket.subscribe("hashtx"); # if you need raw data or block data, to add-> socket.subscribe("hashblock"); socket....
hnak's user avatar
  • 21
2 votes

Using ZeroMQ of bitcoind to monitor addresses?

I'm pretty much doing the same thing. I recommend you to use distributed cache services such as Redis for your addresses' storage and query against that database.
Hamid's user avatar
  • 21
2 votes
Accepted

What happened to the "time" (and blocktime) field of raw transactions?

I am speculating, at this point, that these transactions that have no time associated with them are unconfirmed? Is this understanding correct? Yes. The Bitcoin.org Developer Reference explains: ...
David A. Harding's user avatar
2 votes
Accepted

How do i parse the zeroMQ messages in java?

Ok so i found the solution. The "hashtx, hashblock" etc messages are sent as raw binary bytes which then need to be converted to hexadecimal. Here is my code. public static void main(String[] args) ...
dudious maximus's user avatar
2 votes

How do i parse the zeroMQ messages in java?

Bitcoin Core does not give you strings for the data from ZMQ. It provides the raw bytes of the transactions, blocks, and their hashes. You will need to interpret the received data as byte arrays and ...
Ava Chow's user avatar
  • 71k
2 votes
Accepted

LND can't connect to ZMQ

I believe that your configs are ok, but when you launch lnd with the command like flags, you overwrite one parameter to a broken value. Specifically, I am talking about the flag --bitcoind....
Dmitry Laptev's user avatar
2 votes

ZeroMQ Notifications in Browser JavaScript

If I understand this correctly, you're trying to communicate with Bitcoin Core through ZeroMQ directly from the browser. This is not possible. The reason why JSMQ only supports Websockets (ws://) is ...
Reasv's user avatar
  • 21
2 votes
Accepted

Bitcoind not publishing blocks via ZMQ after reorganization

Is this expected behaviour? During a chain-reorganization, can I only expect ZMQ to publish the tip of the new chain Yes, a ZMQ notification is emitted any time the active tip of the chain changes. ...
Pieter Wuille's user avatar
2 votes
Accepted

Is the hash of ZMQ channel blockhash a merkleroot hash?

As the name suggests, it is the block hash, not the merkle root hash. It is the hash of the block header which includes the merkle root hash. To learn whether your tx is included in a block, you will ...
Ava Chow's user avatar
  • 71k
2 votes
Accepted

Understanding zmq notification output

What you're receiving are raw transactions, so you should use decoderawtransaction to decode them. Then the last hexstring decodes to this (on testnet): { "txid": "...
Vojtěch Strnad's user avatar
1 vote
Accepted

Bitcoin Core ZMQ "hashTx"

Both. A notification will be sent when a transaction is added to the mempool. For newly added blocks, a notification will be sent for every transaction in that block, so when a transaction is ...
Ava Chow's user avatar
  • 71k
1 vote
Accepted

Is it possible to catch up missing blocks with zeroMQ if script was down for a while?

No, it is not possible to catch up via ZMQ itself. A sequence number is present with each notification so you can detect when you've missed notifications. In those cases, then you can fetch the ...
Ava Chow's user avatar
  • 71k

Only top scored, non community-wiki answers of a minimum length are eligible