Skip to content

Commit

Permalink
Add tweet example
Browse files Browse the repository at this point in the history
  • Loading branch information
iknite committed Jun 3, 2019
1 parent 5d7f5d7 commit 0498001
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 9 deletions.
2 changes: 1 addition & 1 deletion rtd_docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Contents

use_cases/commits
use_cases/documentation
.. use_cases/tweets
use_cases/tweets

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion rtd_docs/source/use_cases/commits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ single character is changed.
Mapping Binaries to ``F2`` event
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

For this event, the SHA256 digest of the binary, will be simple and good to
detect changes.
Expand Down
2 changes: 1 addition & 1 deletion rtd_docs/source/use_cases/documentation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ the content of the file.
# Create the document event
document_hash=$(sha256sum <document> | cut -d' ' -f1 )
cat > docuent_event.json <<EOF
cat > document_event.json <<EOF
{
"document_hash": "${document_hash}",
}
Expand Down
87 changes: 81 additions & 6 deletions rtd_docs/source/use_cases/tweets.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
Lie Detector in Tweeter feeds
=============================

.. image:: /_static/images/Uc3.png

Can we know instantly (to some extent) if a tweet is real or not?

Day after day we faced the necessity to detect inconsistencies between what was
Expand All @@ -12,8 +10,85 @@ tries us to sell.
In this **Use case** we will discuss the high throughput that is required in
order to allow to detect inconsistencies in real time.

Logarithmic long tail
---------------------

Since QED is an cryptographic append-only storage, it has some design
capabilities and limitations. One of those it that the `Merkle Tree`_ has
Theory and Operation
--------------------

In Order to push to QED the tweets, we will need a stream publisher which can be
created with any third-party library that has `streaming-api` capabilities like
golang `go-twitter <https://github.com/dghubble/go-twitter/blob/master/examples/streaming.go>`_ module,
python's `tweeepy <http://docs.tweepy.org/en/v3.4.0/streaming_how_to.html>`_ library or,
npm `twitter <https://www.npmjs.com/package/twitter#streaming-api>`_ package.

.. image:: /_static/images/Uc3.png

Event Source
++++++++++++

Since the **Streaming Publisher** will act as the event source it will need to
process all the tweets and creating the events that identifies individual tweets
univocally. And since tweets are small in size, there's no need to digest it
beforehand.

.. note::

Mapping example of event ``F(TWEET)``:

.. code:: json
{
"user_screen_name": "TwitterDev",
"text": "Today's new update means that you can finally add Pizza Cat to your Retweet with comments! Learn more about this ne… https://t.co/Rbc9TF2s5X",
}
Auditor
+++++++

The **LIE DETECTOR** service will act as the auditor giving transparency to
any tweet source.

Untrusted Sources
+++++++++++++++++

Any source where you can fetch a tweet are susceptible to be used as untrusted
source to give transparency by auditing the event tweets.

Creating transparency in tweets
-------------------------------

.. warning::

The following snippets are atop :ref:`Quick start`. please visit it to
configure the required code.

We will process a tweet and creating his event ``F(TWEET)`` to send it to QED.

.. code:: shell
# Create the tweet event
cat > tweet_event.json <<EOF
{
"user_screen_name": "TwitterDev",
"text": "Today's new update means that you can finally add Pizza Cat to your Retweet with comments! Learn more about this ne… https://t.co/Rbc9TF2s5X",
}
EOF
Push the tweet event to QED.
.. code:: shell
# pushing the tweet event to QED server
qed_client \
add \
--event "$(cat tweet_event.json)"
And Finally retrieve and verify the proof.
.. code:: shell
# Verify the proof
qed_client \
membership \
--event "$(cat tweet_event.json)" \
--auto-verify

0 comments on commit 0498001

Please sign in to comment.