This repository has been archived by the owner on Nov 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
156 lines (150 loc) · 14.6 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
<!doctype html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta charset="utf-8"/>
<title>Simple Signal Replication Protocol Specification</title>
<link rel="stylesheet" href="./katex.min.css">
<link rel="stylesheet" href="./github-markdown.min.css">
<style>
body {
max-width: 80ch;
}
</style>
</head>
<body>
<h1>SSSP - Simple Signal Sharing Protocol</h1>
<h2>Abstract</h2>
<p>The Simple Signal Sharing Protocol is an interactive application-level protocol
making use of Ethereum smart contracts and the WebSocket standard for streaming
signal data over a period of time between two participants; a signal streamer
and a signal consumer.</p>
<p>A trustless payment mechanism is the core of the protocol; allowing the signal
streamer to gradually monetize their their signal and the signal consumer to
receive access to novel data streams.</p>
<h2>Overview</h2>
<p>Data sharing over the Internet has been made out to be technically challenging
by a few emergent companies e.g. Ocean Protocol, streamr and others. Key
challenges include the pricing of a data set and the trustless and atomic swap
of payment and data. Similarly, so called "data escapes" have been portrait as
"deal breakers" in the space too.</p>
<p>Having taken a look at some approaches to data sharing; we think there's still
amazing potential to improve the space with actual technical innovation. In the
following document; we hence like to introduce a simple Ethereum-based protocol
that allows to parties to share data verifiably and gradually - hence reducing
the risk of either party betraying the others.</p>
<h2>Problem</h2>
<p>All anonymous data sharing protocols currently require two parties to trust
each other. Indeed, totally anonymous sharing of data that involves crypto
currencies is nearly impossible without accepting the risk of one party
betraying the other.</p>
<p>For the scope of this work; we'd like to highlight two paths where data sharing
can fail in traditional protocols.</p>
<p>(1) Assuming that the data consumer pays the data publisher upfront; then the
risk of the data publisher just sending a random set of zeros and ones is high
and irretrivable. If e.g. on Ocean Protocol, I transferred some coins to a data
publisher and then proceeded to download the data set; I'd have no option for
recourse considering that anonymous users can enter data sets. Now, I'd have
lost money and didn't receive any data.</p>
<p>(2) Similarly, in the case that the data consumer pays the data publisher
<em>after</em> receiving the data; then the risk of the data consumer exit scaming the
data publisher is high and irretrivable. If e.g on Ocean Protocol, I downloaded
a data set from a publisher but then simply forgo payment afterwards - then the
data publisher would have no option for recourse considering that I could have
do all previous actions perfectly anonymous using e.g. the TOR network. Now I'd
have the data set and it wouldn't have cost me any money.</p>
<p>Being aware of these two scenario makes one realize that, in fact, the problem
isn't an easy one to solve atomically either as we'd argue it's rather
difficult to understand what equates a valuable data set.</p>
<p>Humans are fundamentally not good at understanding large corpuses of data and
so in cases where e.g. users download data sets; they may end up not being
aware of its quality until they've done some tests.</p>
<p>Hence, a key lesson that lies within the scope of this work, is that "shipping
data sets in objectified containers" isn't the right conceptual metaphor for
tackling the over all problem.</p>
<p>Indeed, data is often portrait as lake, package, container, zip file, csv etc.
But the reality of anyone working with data is that any point that makes a set
of data can be viewed as its own self-contained set of data too. Hence, in
future paragraphs of this work, we tend to favor the term "stream" or "signal"
over data as they correctly identify data as time-continuos resource rather
than one that is akin to an object.</p>
<h3>Mechanism</h3>
<p>A smart contract hosted on an EVM-enabled platform like Ethereum allows a data
publisher to offer a signal stream by publishing some basic meta data, e.g.:</p>
<pre><code>{
stream: {
name: "ETH/USD"
}
}
</code></pre>
<h2>Definitions</h2>
<h3>Theoretical Model of a Digital Signal</h3>
<p>A digital signal is used to represent data as a sequence of discrete values.
In theoretical terms, a signal is modeled within a vector space <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msup><mi mathvariant="double-struck">R</mi><mi>d</mi></msup></mrow><annotation encoding="application/x-tex">\reals^d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.849108em;vertical-align:0em;"></span><span class="mord"><span class="mord"><span class="mord mathbb">R</span></span><span class="msupsub"><span class="vlist-t"><span class="vlist-r"><span class="vlist" style="height:0.849108em;"><span style="top:-3.063em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">d</span></span></span></span></span></span></span></span></span></span></span>,
where <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi></mrow><annotation encoding="application/x-tex">d</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathnormal">d</span></span></span></span> represents a function's domain. Commonly-used domains to model
digital signals include <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>=</mo><mn>1</mn></mrow><annotation encoding="application/x-tex">d=1</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">1</span></span></span></span> to model time series data, or <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>d</mi><mo>=</mo><mn>2</mn></mrow><annotation encoding="application/x-tex">d=2</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.69444em;vertical-align:0em;"></span><span class="mord mathnormal">d</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span><span class="mrel">=</span><span class="mspace" style="margin-right:0.2777777777777778em;"></span></span><span class="base"><span class="strut" style="height:0.64444em;vertical-align:0em;"></span><span class="mord">2</span></span></span></span> to model
signals dependent on location [1]. Within the scope of this work, we assume
that a digital signal's domain is descrete, hence representing a finite number
of isolated points.</p>
<h2>Sampling</h2>
<p>Sampling is the process of reducing a continous-time <em>source</em> signal into a
discrete-time <em>replication</em> signal by repeatedly applying inputs to the source.</p>
<h2>Aliasing</h2>
<p>Aliasing is an effect appearing in signal sampling. It can lead to a
replication signal becoming indistinguishable from its source [3].</p>
<h2>Nyquist–Shannon Sampling Theorem</h2>
<p>Shannon's theorem states that if a function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(x)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span> contains no frequencies
higher than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> hertz then it can be determined by polling a series of points
spaced <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>1</mn><mi mathvariant="normal">/</mi><mn>2</mn><mi>B</mi></mrow><annotation encoding="application/x-tex">1 / 2B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">1</span><span class="mord">/</span><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> seconds apart. It can, hence, be assumed that taking more than
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mn>2</mn><mi>B</mi></mrow><annotation encoding="application/x-tex">2B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord">2</span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> samples of a function <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>f</mi><mo stretchy="false">(</mo><mi>x</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">f(x)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mopen">(</span><span class="mord mathnormal">x</span><span class="mclose">)</span></span></span></span> with a frequency no higher than <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>B</mi></mrow><annotation encoding="application/x-tex">B</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.68333em;vertical-align:0em;"></span><span class="mord mathnormal" style="margin-right:0.05017em;">B</span></span></span></span> hertz
yields a perfect reconstruction <span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msub><mi>f</mi><mi>s</mi></msub></mrow><annotation encoding="application/x-tex">f_s</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8888799999999999em;vertical-align:-0.19444em;"></span><span class="mord"><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="msupsub"><span class="vlist-t vlist-t2"><span class="vlist-r"><span class="vlist" style="height:0.151392em;"><span style="top:-2.5500000000000003em;margin-left:-0.10764em;margin-right:0.05em;"><span class="pstrut" style="height:2.7em;"></span><span class="sizing reset-size6 size3 mtight"><span class="mord mathnormal mtight">s</span></span></span></span><span class="vlist-s"></span></span><span class="vlist-r"><span class="vlist" style="height:0.15em;"><span></span></span></span></span></span></span></span></span></span> through sampling [2].</p>
<h2>Asynchronous System</h2>
<p>Asynchronous systems are able to handle the program flow as well as the
occurrence of independent events without the need for a a global coordination
mechanism like a clock or a centralized consensus. They do not rely strictly on
arrival times of messages or their ordering.</p>
<h2>Stateless System</h2>
<p>A system is stateless when it treats a any occurring message independently and
without the need for keeping track about messages in memory.</p>
<h2>Introduction</h2>
<h3>Purpose</h3>
<p>The Simple Signal Replication Protocol is an application-level protocol with
the lightness and speed necessary for distributed and collaborative information
systems. It allows the replication and discovery of digital signals over the
Internet.</p>
<h2>Example</h2>
<p>The following shows an example of a source initializing the signal replication
by replacing (<code>PUT</code>) the current entity (<code>BTC-USD</code>) with an incomplete <code>csv</code>
content. Using <code>PATCH</code>, the source then partially modifies the entity through
additional data.</p>
<pre><code class="language-http">PUT /signals/BTC-USD HTTP/1.1
Host: destination.com
Content-Type: text/csv
timestamp,value,currency
2021-02-19T22:37:26.102Z,55,529.65,USD
2021-02-19T22:39:09.973Z,55,550.11,USD
</code></pre>
<pre><code class="language-http">PATCH /signals/BTC-USD HTTP/1.1
Host: destination.com
Content-Type: text/csv
2021-02-19T22:37:26.102Z,55,529.65,USD
2021-02-19T22:39:09.973Z,55,550.11,USD
</code></pre>
<h2>Unfinished thoughts</h2>
<ul>
<li>Data needs to be replicable asynchronously. It may come out of order, but
that's OK because each data point shall be encoded such that the signal's
intel does not depent on it or that it can be ordered by the receiver later.</li>
<li>A sampler should be able request samples of data randomly from the source
through an dialog.</li>
<li>Samples should allow to include authentication data such as hashes or proofs</li>
</ul>
<h2>References</h2>
<ul>
<li>1: https://de.wikipedia.org/w/index.php?title=Signal&oldid=207389957</li>
<li>2: https://en.wikipedia.org/w/index.php?title=Nyquist%E2%80%93Shannon_sampling_theorem&oldid=1002056076</li>
<li>3: https://en.wikipedia.org/w/index.php?title=Aliasing&oldid=996719536</li>
<li>4: https://en.wikipedia.org/w/index.php?title=Sampling_(signal_processing)&oldid=1000373153</li>
</ul>
</body>
</html>