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

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

Open
phbernard opened this issue Mar 14, 2018 · 3 comments

Comments

@phbernard
Copy link

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
Copy link
Author

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

@grempe
Copy link
Contributor

grempe commented Mar 14, 2018

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

@grempe grempe closed this as completed Mar 14, 2018
@grempe grempe reopened this Mar 14, 2018
@grempe
Copy link
Contributor

grempe commented Mar 14, 2018

Accidentally closed. Re-opened.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants