-
Notifications
You must be signed in to change notification settings - Fork 85
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
How to find the attestation transaction id from an ots info file? #33
Comments
While you can figure out what the txid is, why do you want to know that? You only need block headers to verify a timestamp; look at how the BitcoinBlockHeaderAttestation code works. |
I was writing a blog post, and I wanted know how OpenTimestamps calendars record data in the blockchain... so I went looking for an OpenTimestamps transaction. I couldn't find one, but ended up finding a Reddit comment that
I see
So I get that Let me know if I'm thinking about this incorrectly. One primary issue is that I'm not sure how to read the |
Ah, that's an interesting blog post! Is it still a draft, or is that the final public post? An interesting follow-up would be a post describing how those same researchers could have done things right. Note that there is no such thing as ".info output" - the output of ots info isn't meant to be parsed as a file, rather it's meant to be a human-readable display of what's in the timestamp and how that timestamp works. I could probably improve the documentation of that to aid users in understanding what's going on. Basically, what the info command is showing you is the tree structure of the timestamp, and every operation applied. The arrows are where the tree branches - that's what allows one file to be timestamped by multiple attestations. The tricky part with adding txids, is the file itself doesn't tell you what is or isn't a tx. So you'd have to add huristics to the info command that tried to guess what parts of the timestamp were a tx, and those heuristics could get it wrong. I'm not opposed to doing that, but I'd want to be careful how it's presented to the user. As for "verifying what hash is in the blockchain", maybe the thing you actually want is for info to tell you the results of each operation. That'd let you easily see that the final result - what should be the merkle root of the block - is in fact in the Bitcoin chain. |
Final, but @profjsb have been discussing ways to "do it right", which would require a system for pre-registration of hypotheses. So in addition to proof of existence, we need solutions for proof of authorship and proof of exclusivity (that multiple versions of the hypothesis didn't exist). We're still brainstorming... any advice welcome. Regarding OTS info, I'll leave another comment after I have some more time to look into it. |
Yes, that would be super helpful. I also think it would help for the info to be in a structured format, so that it more clearly documents itself. YAML achieves a nice balance between human and machine readability. If you're opposed to a PyYAML dependency, JSON would also be an option. How about something like the following ( file_sha256_hash: 3e8931c7a0ff54b4c77ec845dd17a385d8705c285c88521d1428b39ab06421e7
timestamp:
- append: b1cbf92d328dee6f4c7ecd19ab94969e
sha256_hash: ''
- prepend: ed788ebf68555688fd41e529d1eae955fbb0b7e8e3d63ed59c9f3eed29b309e1
sha256_hash: ''
- - append: 8be1d43da44c76954746861b77a63ff4
sha256_hash: ''
- append: 8bda26c3e2fce829
prepend: 58b9e977
sha256_hash: ''
verify: PendingAttestation('https://alice.btc.calendar.opentimestamps.org')
- append: a5b22aa26333881605966bb2fe2fe17f0a088064806c3c2e4ec15bf440a6c313
sha256_hash: ''
# skip ahead
- append: 0d26ec24c36996d60adeab2e80b374185a897b00fbc0e582084ed43c9cc91cbf
sha256_hash: ''
- sha256_hash: ''
verify: BitcoinBlockHeaderAttestation(455671)
- sha256_hash: ''
- - append: c37914ced3ae02f1c43e8ef19ec11c1c
sha256_hash: ''
- append: bfea8361e1410f2f
prepend: 58b9e977
sha256_hash: ''
verify: PendingAttestation('https://bob.btc.calendar.opentimestamps.org') Such a format would also give you more flexibility to add additional metadata down the road. Additionally, improved machine readability would be nice for users who want to verify a timestamp independently of the OTS codebase.
So one of the
Do you expect that most attestations will share substantial portions of the tree? If not, it may make sense for readability to just use a list structure and duplicate the common portion of the tree. @petertodd, |
Hi @dhimmel, In a test branch I have the verbose output info which will print the following:
inside parenthesis you can see the timestamp message at the level of the operation in the same row, you can think it as the value on which the operation is applied. The first message is the sha256 of the @petertodd is this output format good enough or do you have any idea to make it better? The transaction id is inconvenient to find because its reversed... |
@RCasatta thanks for the implementation. It's a big improvement over the previous output. A good way for new users to understand the format is to look at lines like:
since it makes it obvious what the input / function / output is for each line. One thing that that users should note is that you can't just hash the characters. Instead you have to do the following (Python 3) to account for their hex encoding: encoded = 'faa6e88835c144ad73f48992bc05e691a52a9199df02450194f3a03b530dc2d7'
decoded = bytearray.fromhex(encoded)
sha_256_hash = hashlib.sha256(decoded)
sha_256_hash.hexdigest() This operation provides
I still think that in the long run you may want to use a standardized file format. I expect many users will want to do automated tasks using this output.
Is the underlying issue that the |
The standardized file format is the binary ots format. Textual output is useful for debugging and educational purpose. Users shouldn't make automated tasks based on the textual output.
As you understand |
Hey, sorry I missed this! How about we make the text output look something like:
I think that'd be a bit more clear to users trying to figure out what it means. |
Re: BitcoinTransactionAttestation, my thinking there not only can it always be replaced by a BitcoinBlockHeaderAttestation, verifying a transaction attestation requires a costly and non-scalable transaction index; we really don't want to encourage people to be creating timestamps that are difficult to verify. |
This is already better. We should consider also Andrew's more verbose output: |
Here is my last test:
@petertodd if you think it's ok I'll make the PR
|
@RCasatta I like your latest format and think you should open the pull request. I'd even favor replacing the default output (not requiring the One final question, if I look at the metadata for block 358391, I see the Merkle Root of |
I'm inclined to keep the == stuff as a verbose option; I use info all the time to see how a timestamp was made, but almost never need to know the exact results of each operation. @RCasatta Otherwise looks good; make that PR! |
@dhimmel Bitcoin uses a non-standard little-endian display for digests; try reading 8a1b66ecb7cbd07d8139a7e7d7f2c41aab1f5009b8364aaf61d03ad245e47e00 backwards. :) |
Ah I see: >>> digest = '8a1b66ecb7cbd07d8139a7e7d7f2c41aab1f5009b8364aaf61d03ad245e47e00'
>>> bytes(reversed(bytes.fromhex(digest))).hex()
'007ee445d23ad061af4a36b809501fab1ac4f2d7e7a739817dd0cbb7ec661b8a' Good to know. I'm guessing this is a common point of confusion. @RCasatta not sure if you have any ideas on whether the verbose output should add some sort of comment or whether users are just going to have to figure this out. |
I think that confusion is the kind of thing that should be explained in the documentation. Which speaking of: we need to write up at least some man pages, and preferably a guide to using OpenTimestamps. My blog post is a start, but just a start. |
Hi all, As much as I understand that a mere statement of existence of a stamp in a given block is a sufficient proof, not everyone (including a judge or jury) would understand that, and it would be extremely helpful to be able to show the exact transaction/hash info. I've also tried dragging the stamped files into the OpenTimeStamp website and examining the detailed digest that results, but I'm still not able to find the specific tx reference. There are a couple of "parse tx" hashes, but they don't seem to lead to a tx with script showing the expected DUP HASH160 output as Peter Todd showed in his post: https://petertodd.org/2016/opentimestamps-announcement#fn:hello-world-address Am I missing something? |
I get the following output from running
ots info
on one of my.ots
files:I see the attestation transaction was included in block 455671. But how can I tell which transaction roots the OpenTransactions merkle tree? Pointing me to more information on how to read an ots info file would also be helpful.
The text was updated successfully, but these errors were encountered: