Skip to content

Commit

Permalink
Merge #82: Display Bitcoin timestamps with appropriate precision
Browse files Browse the repository at this point in the history
44a1951 Display Bitcoin timestamps with appropriate precision (Peter Todd)

Pull request description:

  Previously would display them with precision down to the second, which misrepresents how precise a Bitcoin timestamp can actually be as adversarial miners can get away with creating blocks whose timestamps are inaccurate by multiple hours or more.

  For those who do want a more precise timestamp, the height of the block attesting to the timestamp is now displayed, allowing a manual investigation of it.

  Examples of the new UX:

  ```
  $ ots verify examples/empty.ots
  Assuming target filename is 'examples/empty'
  Success! Bitcoin block 129405 attests existence as of 2011-06-08 EDT
  ```

  ```
  $ git tag -v opentimestamps-client-v0.5.1
  object dcc4549
  type commit
  tag opentimestamps-client-v0.5.1
  tagger Peter Todd <[email protected]> 1513029381 -0500

  Release opentimestamps-client-v0.5.1
  ots: Got 1 attestation(s) from https://finney.calendar.eternitywall.com
  ots: Got 1 attestation(s) from https://bob.btc.calendar.opentimestamps.org
  ots: Success! Bitcoin block 498825 attests existence as of 2017-12-11 EST
  ots: Good timestamp
  gpg: Signature made Mon 11 Dec 2017 04:56:22 PM EST
  gpg:                using RSA key 2481403DA5F091FB
  gpg: Good signature from "Peter Todd <[email protected]>"
  gpg:                 aka "[jpeg image of size 5220]"
  ```

Tree-SHA512: e4e6186b493d0b6ab59994ceaa60da10d13e5464219fb3a45760900b12d09f7d270c387600cc43cef65482c2455401adc8776615e6dcd5a4b5a4d60a8e825405
  • Loading branch information
petertodd committed Mar 16, 2018
2 parents a239986 + 44a1951 commit 9a47876
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 0 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,6 @@ Use the setuptools development mode:

## Known Issues

* Displaying Bitcoin timestamps down to the second is false precision, and
misleading. But rounding off to the nearest day is over-doing it in the other
direction. See https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2016-September/013120.html
for more information on this issue.

* Need unit tests for the client.

* Git tree re-hashing support fails on certain filenames with invalid unicode
Expand Down
6 changes: 4 additions & 2 deletions otsclient/cmds.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,10 @@ def attestation_key(item):
logging.error("Bitcoin verification failed: %s" % str(err))
continue

logging.info("Success! Bitcoin attests data existed as of %s" %
time.strftime('%c %Z', time.localtime(attested_time)))
logging.info("Success! Bitcoin block %d attests existence as of %s" %
(attestation.height,
time.strftime('%Y-%m-%d %Z',
time.localtime(attested_time))))
good = True

# One Bitcoin attestation is enough
Expand Down

0 comments on commit 9a47876

Please sign in to comment.