2

Is there any way to check for this data in blockchain?

I want to search this value: 554e6963444320 and want to return this transaction https://blockchain.info/tx/7e92e90f221ad28daf42b5b8bda4c8e244e37af48527fcd12b2518db5d3315bd

2
  • 1
    This will require parsing the blockchain and looking for your data string to match transaction(s) which contain that data. Building an index of all op_return transactions could speed this greatly, but to my knowledge it is not yet available as a service or product.
    – Scrybe
    Commented Mar 15, 2015 at 16:58
  • How to identify transactions with op_return? Commented Mar 15, 2015 at 17:17

3 Answers 3

2

The Chain.com API offers functionality for returning OP_RETURN data by:

  1. Address
  2. TxID
  3. Block height

The JSON return data from the REST API has a text field which is meant to be the decoded hex data sent (ie 6a``hex data) but it's returned in the format \\x``hex data.

In Python you can simply do this:

import __future__
import requests; from binascii import unhexlify
rdata = requests.get("https://api.chain.com/v2/bitcoin/addresses/%s/op-returns?api-key-id=DEMO-4a5e1e4" % "1Bj5UVzWQ84iBCUiy5eQ1NEfWfJ4a3yKG1") # substitute URL here
assert rdata.status_code == 200
jdata = rdata.json()
hexdata = [unhexlify(str(t["text"]).encode("utf-8"))) for t in jdata
print(hexdata)
2
  • How would I do a search in the bitcoin core? Commented Mar 16, 2015 at 13:51
  • 1
    api.chain.com doesn't work anymore
    – mixdev
    Commented Jun 15, 2017 at 7:24
2

This Blockchain explorer: https://blockchair.com/ allows you to search for embedded data in 19 different Blockchains. And on this URL https://bitcoinstrings.com/all I think you can get all embedded texts.

-1

You can do it via https://www.smartbit.com.au/ that already parses all the data including op_returns

1
  • 2
    It's now offline Commented Apr 12, 2022 at 15:38

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.