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

Stamp verification without bitcoin full node #93

Open
korigod opened this issue Jul 4, 2018 · 4 comments
Open

Stamp verification without bitcoin full node #93

korigod opened this issue Jul 4, 2018 · 4 comments

Comments

@korigod
Copy link

korigod commented Jul 4, 2018

Is it possible to verify a timestamp without running bitcoin node? Even pruned one is not too easy to install as it requires downloading of the entire blockchain IIRC. Is it possible to use an SPV node for verification?

@petertodd
Copy link
Member

In principle yes, but actual software support for that isn't done yet.

Note that you can verify manually: the client will tell you what block height the timestamp was for, and what the expected merkleroot of that block was supposed to be.

@TomasJuocepis
Copy link

You could get the block hash from several online block explorers that provide an API. This might be an OK compromise for your scenario depending on your trust/security requirements.

@RCasatta
Copy link
Member

RCasatta commented Jul 8, 2018

You could get the block hash from several online block explorers that provide an API. This might be an OK compromise for your scenario depending on your trust/security requirements.

The javascript and java lib are actually doing this, javascript in particular to support in-browser verification. By our experience is a real mess, block explorers have different interfaces so we decided to support insight because there was a bunch of different domains serving with insight. This bunch of different domains frequently go down/disappear causing problems.

@Benjamin-Loison
Copy link

To precise @petertodd answer:

ots --no-bitcoin verify test.txt.ots
Assuming target filename is 'test.txt'
Got 3 attestation(s) from cache
Not checking Bitcoin attestation; Bitcoin disabled
To verify manually, check that Bitcoin block 785795 has merkleroot a6fb5252d2c107d6bdf7860f0832eab37f74cb2bec289f39f3997effb61090b6
Not checking Bitcoin attestation; Bitcoin disabled
To verify manually, check that Bitcoin block 785806 has merkleroot 43847a9dbe422f90379c93736e706d4dc018ed6f502eff468a38ea9c8330a7ac
Not checking Bitcoin attestation; Bitcoin disabled
To verify manually, check that Bitcoin block 785873 has merkleroot 7bfbb4fa713584ccb9f42f5c1ba53a025c805a86f7c3f2c99f95c3d1ca3e5b0b

As:

bitcoin-cli getblockhash 785795
error code: -8
error message:
Block height out of range

Get the block hash from elsewhere:

curl https://bitcoinexplorer.org/api/block/785795 | jq .hash
"000000000000000000015d965f5ac86619b2e279f28d116c984dcee714a444bb"

Verify both the block height (as we relied on a third-party service to get the block hash) and the merkle root:

bitcoin-cli getblockheader 000000000000000000015d965f5ac86619b2e279f28d116c984dcee714a444bb | jq '.merkleroot,.height'
"a6fb5252d2c107d6bdf7860f0832eab37f74cb2bec289f39f3997effb61090b6"
785795

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

5 participants