Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OP_RETURN equals brings back 0 actions taken but data is present #388

Closed
timstackblock opened this issue Aug 16, 2023 · 2 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@timstackblock
Copy link
Contributor

timstackblock commented Aug 16, 2023

Describe the bug
OP_Return equals is not bringing back data that I can see is present in the JSON output for a bitcoin transaction, here is the JSON output for the bitcoin transaction below.

I am scanning for = "equals": "0xaa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95"

Here are my decodes for the json file

OP_RETURN (null data output):

Output Script: "6a24aa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95"
This is an OP_RETURN output script. The data is encoded in hexadecimal and corresponds to 0xaa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95.

https://www.blockchain.com/explorer/transactions/btc/b77dbae24e68470100e29707d3d4f215e0fb562701cc0df5e73ec74e6783eacb

BITCOIN TRANSACTION JSON OUTPUT FROM THE BITCOIN EXPLORER

[{
  "txid": "04f1b6c0cee44a8ba10cade754a36f405576120d33abd58b59b54af8109d7fc8",
  "size": 214,
  "version": 2,
  "locktime": 0,
  "fee": 0,
  "inputs": [
    {
      "coinbase": true,
      "txid": "0000000000000000000000000000000000000000000000000000000000000000",
      "output": 4294967295,
      "sigscript": "037a420c0460ccdc642f466f756e6472792055534120506f6f6c202364726f70676f6c642f09e42844000001ca10010000",
      "sequence": 4294967295,
      "pkscript": null,
      "value": null,
      "address": null,
      "witness": [
        "0000000000000000000000000000000000000000000000000000000000000000"
      ]
    }
  ],
  "outputs": [
    {
      "address": "bc1qxhmdufsvnuaaaer4ynz88fspdsxq2h9e9cetdj",
      "pkscript": "001435f6de260c9f3bdee47524c473a6016c0c055cb9",
      "value": 636015433,
      "spent": false,
      "spender": null
    },
    {
      "address": null,
      "pkscript": "6a24aa21a9ed59ffb003fd75f0f029a78b1ce2e3ee565b59001b040ea4535d4a711f3dde721f",
      "value": 0,
      "spent": false,
      "spender": null
    }
  ],
  "block": {
    "height": 803450,
    "position": 0
  },
  "deleted": false,
  "time": 1692191839,
  "rbf": false,
  "weight": 748
}](https://www.blockchain.com/explorer/transactions/btc/b77dbae24e68470100e29707d3d4f215e0fb562701cc0df5e73ec74e6783eacb)

MY PREDICATE FILE

  {
  "uuid": "1",
  "name": "Hello Ordinals",
  "chain": "bitcoin",
  "version": 1,
  "networks": {
    "mainnet": {
      "start_block": 803449,
      "end_block": 803453,
      "if_this": {
        "scope": "outputs",
        "op_return": {
          "equals": "0xaa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95"
        }
      },
      "then_that": {
        "file_append": {
          "path": "automate/tests/bitcoin-predicates/OpReturn_equals/OpReturn-equals-file-results.json"
        }
      }
    }
  }
}

OUTPUT FROM CHAINHOOKS
Screenshot 2023-08-16 at 11 56 31 AM

@github-project-automation github-project-automation bot moved this to 🆕 New in DevTools Aug 16, 2023
@timstackblock timstackblock added the bug Something isn't working label Aug 16, 2023
@smcclellan smcclellan moved this from 🆕 New to 📋 Backlog in DevTools Aug 21, 2023
@timstackblock
Copy link
Contributor Author

timstackblock commented Aug 22, 2023

@MicaiahReid @smcclellan Just following up on the bugs I created last week. Will these issues be fixed or is this functionality no longer needed in Chinhooks?

@MicaiahReid MicaiahReid assigned csgui and unassigned MicaiahReid Sep 25, 2023
@andresgalante andresgalante moved this from 📋 Backlog to 🏗 In Progress in DevTools Nov 27, 2023
@csgui csgui moved this from 🏗 In Progress to 📋 Backlog in DevTools Dec 18, 2023
@csgui csgui moved this from 📋 Backlog to 🏗 In Progress in DevTools Dec 28, 2023
@csgui
Copy link
Contributor

csgui commented Dec 28, 2023

This issue seems to be solved. Validated with the same predicate and received the following Chainhook JSON output:

{
  "apply": [
    {
      "block_identifier": {
        "hash": "0x000000000000000000032d8644907c0ac72bd741dc3507874e9afc315bc7b4f2",
        "index": 803452
      },
      "metadata": {
        "network": "mainnet"
      },
      "parent_block_identifier": {
        "hash": "0x00000000000000000004d8e3682495f6953b2f45996d38828f44f22dce45f3ad",
        "index": 803451
      },
      "timestamp": 1692193080,
      "transactions": [
        {
          "metadata": {
            "proof": null
          },
          "operations": [],
          "transaction_identifier": {
            "hash": "0xb77dbae24e68470100e29707d3d4f215e0fb562701cc0df5e73ec74e6783eacb"
          }
        }
      ]
    }
  ],
  "chainhook": {
    "is_streaming_blocks": false,
    "predicate": {
      "op_return": {
        "equals": "0xaa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95"
      },
      "scope": "outputs"
    },
    "uuid": "1"
  },
  "rollback": []
}
{
  "apply": [
    {
      "block_identifier": {
        "hash": "0x000000000000000000032d8644907c0ac72bd741dc3507874e9afc315bc7b4f2",
        "index": 803452
      },
      "metadata": {
        "network": "mainnet"
      },
      "parent_block_identifier": {
        "hash": "0x00000000000000000004d8e3682495f6953b2f45996d38828f44f22dce45f3ad",
        "index": 803451
      },
      "timestamp": 1692193080,
      "transactions": [
        {
          "metadata": {
            "proof": null
          },
          "operations": [],
          "transaction_identifier": {
            "hash": "0xb77dbae24e68470100e29707d3d4f215e0fb562701cc0df5e73ec74e6783eacb"
          }
        }
      ]
    }
  ],
  "chainhook": {
    "is_streaming_blocks": false,
    "predicate": {
      "op_return": {
        "equals": "0xaa21a9ed51b46694a64587dcca78f6dcaf092c253727ca28a1e45a6c4256ae0f43740a95"
      },
      "scope": "outputs"
    },
    "uuid": "1"
  },
  "rollback": []
}

@csgui csgui closed this as completed Dec 28, 2023
@github-project-automation github-project-automation bot moved this from 🏗 In Progress to ✅ Done in DevTools Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

4 participants