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

MVP Test #2 says the tip is spent, but I can't find the spending transaction #2

Open
kulpreet opened this issue Jul 22, 2018 · 2 comments

Comments

@kulpreet
Copy link
Member

@ChristopherA I might be wrong or going down the wrong path, but the MVP Test #2 (https://github.com/w3c-ccg/did-hackathon-2018/blob/master/BTCR-DID-Tests.md) says the DID is revoked because the tip is spent, but I can't find any transaction with an input of txid: 2f1838f481be7b4f4d37542a751aa3a27be7114f798feb24ff0fc764730973d0 and vout: 0.

The output address for that txid/vout is mqkvMtYfTufj3iEXjYHmnopZrsowMFxrKw and both blockcypher and my little btcr-service are both failing to show any spends with txid: 2f1838f481be7b4f4d37542a751aa3a27be7114f798feb24ff0fc764730973d0 and vout: 0.

https://live.blockcypher.com/btc-testnet/address/mqkvMtYfTufj3iEXjYHmnopZrsowMFxrKw/

https://btcr-service.opdup.com/addr/mqkvMtYfTufj3iEXjYHmnopZrsowMFxrKw/spends

I am pretty sure I a missing some key point here. Wanted to check with you as I am sure I must be missing something.

@ChristopherA
Copy link
Contributor

No, it is quite likely I screwed up somewhere — needed better tools to see where.

@kulpreet
Copy link
Member Author

I thought a /tip endpoint might help, so I put together a quick and dirty solution.

/tip by default lists only the chain of spending transaction starting from the txref vout.

But if you want to see the entire set of transacation for the address in the txref vout, then you can pass a spendsOnly=false query string param to /tip.

There is an extra property in the transaction JSON called "InTipChain", and this is set to true if the transaction is part of the spending transactions starting from txref vout.

In case of our MVP examples:

  1. https://btcr-service.opdup.com/txref/txtest1:x705-jzv2-qqaz-7vuz/tip shows that the txref vout transaction has been spent.

  2. https://btcr-service.opdup.com/txref/txtest1:xz35-jzv2-qqs2-9wjt/tip shows the txref vout has not been spent. So you can see all the transactions by invoking the endpoint like so: https://btcr-service.opdup.com/txref/txtest1:xz35-jzv2-qqs2-9wjt/tip?spendsOnly=false

I am going to try and switch to the part about extracting the pubkeyhex, I think I will gain more clarity about the resolving algo by doing that.

Meanwhile I hope the /tip endpoint helps.

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