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

Tweetable timestamps #57

Open
kanzure opened this issue Jul 22, 2017 · 4 comments
Open

Tweetable timestamps #57

kanzure opened this issue Jul 22, 2017 · 4 comments

Comments

@kanzure
Copy link
Contributor

kanzure commented Jul 22, 2017

When the proof is short enough, it's possible to link the proof in a URL shortener and post on twitter, including the entire matured timestamp. It would be nice if the client would give me a link in the following format:

https://opentimestamps.org/info.html?ots={serialized_timestamp}

This can get URL shortened and the URL shortener stores the proof and gives you a short URL to pass around in public. Fits nicely into a tweet, too.

Also, I believe the serialized timestamp should only include one attestation, not all of the available attestations from the OTS file.

When a timestamp was made from a merkle tree of many other elements, maybe the client should complain to the user and say that a URL shortener will not be likely to accept the input. These services often have a length limit, it's not like they gladly accept gif/webm data: URIs.

@petertodd
Copy link
Member

Hmm, that's an interesting idea.

What's the limit on maximum URL size for the shortener?

@kanzure
Copy link
Contributor Author

kanzure commented Jul 27, 2017

This doesn't seem to do quite what I want (serialization problems):

diff --git a/otsclient/cmds.py b/otsclient/cmds.py
index 84c3b19..51ccf05 100644
--- a/otsclient/cmds.py
+++ b/otsclient/cmds.py
@@ -505,6 +504,15 @@ def info_command(args):
     print("Timestamp:")
     print(detached_timestamp.timestamp.str_tree(verbosity=args.verbosity))
 
+def twitter_command(args):
+    ctx = StreamDeserializationContext(args.file)
+    detached_timestamp = DetachedTimestampFile.deserialize(ctx)
+    detached_timestamp.timestamp.attestations = set(list(detached_timestamp.timestamp.all_attestations())[-1])
+    detached_timestamp.timestamp.ops = list(detached_timestamp.timestamp.ops.values())[-1]
+    with open("twitter.ots", 'wb') as new_stamp_fd:
+        ctx = StreamSerializationContext(new_stamp_fd)
+        detached_timestamp.serialize(ctx)
+    print("Wrote to twitter.ots")

@petertodd
Copy link
Member

Mind copying-n-pasting the error message you get?

@jonathancross
Copy link
Contributor

@kanzure ?

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

3 participants