Closed timstackblock closed 10 months ago
There is a problem with the predicate.
The type of transaction that was used in the Chainhook predicate is a SegWit P2WSH.
...
"p2wsh": {
"equals": "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6"
}
...
To comparison using a Pay-to-Public-Key-Hash (P2PKH) the JSON key should be p2pkh
...
"p2pkh": {
"equals": "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6"
}
...
With that change Chainhook is returning the following JSON result:
{
"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": {
"p2pkh": {
"equals": "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6"
},
"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": {
"p2pkh": {
"equals": "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6"
},
"scope": "outputs"
},
"uuid": "1"
},
"rollback": []
}
Describe the bug p2pk 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": "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6"
Here are my decodes for the json file
P2PKH (Pay-to-Public-Key-Hash) Output:
Address: "1K6KoYC69NnafWJ7YgtrpwJxBLiijWqwa6" Output Script: "76a914c6740a12d0a7d556f89782bf5faf0e12cf25a63988ac" This is a standard P2PKH output, where the receiver's address is encoded in the output script.
https://www.blockchain.com/explorer/transactions/btc/b77dbae24e68470100e29707d3d4f215e0fb562701cc0df5e73ec74e6783eacb
BITCOIN TRANSACTION JSON OUTPUT FROM THE BITCOIN EXPLORER
MY PREDICATE FILE
OUTPUT FROM CHAINHOOK