blockchain-anchor icon indicating copy to clipboard operation
blockchain-anchor copied to clipboard

BitCoin OP_RETURN - Check presence on the blockchain and return block depth

Open phbernard opened this issue 7 years ago • 3 comments

confirmOpReturnAsync only parses the response got from the insight service to check the presence of the Merkle root. This behavior leads the function to validate the receipt even when the corresponding BitCoin transaction is pending (ie. not mined yet).

This is misleading: isValidReceipt acknowledges the receipt whereas there is no guarantee that it will eventually be stored on the blockchain.

In addition, the block depth would be a valuable piece of information.

Both points can be addressed by checking blockheight in the insight service response.

In order to not break the existing clients, isValidReceipt could still return true as soon as the transaction is spotted by the insight service. The presence on a blockheight field passed to the callback could help new clients decide for themselves.

Note: I didn't check the other services, only BitCoin/OP_RETURN. Thus, this issue may or may not apply to the other techniques.

phbernard avatar Mar 14 '18 10:03 phbernard

Actually the confirmations field would be more relevant (in place of blockheight)

phbernard avatar Mar 14 '18 10:03 phbernard

Thanks for the feedback. We'll look into your enhancement request.

grempe avatar Mar 14 '18 17:03 grempe

Accidentally closed. Re-opened.

grempe avatar Mar 14 '18 17:03 grempe