Open kanzure opened 6 years ago
Hmm, that's an interesting idea.
What's the limit on maximum URL size for the shortener?
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")
Mind copying-n-pasting the error message you get?
@kanzure ?
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:
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.